Makefile 1.03 KB
Newer Older
Jordan Sissel's avatar
Jordan Sissel committed
1 2
VERSION=0.0.1

3 4
CFLAGS+=-Ibuild/include
#LDFLAGS+=-pthread
5
LDFLAGS=-Lbuild/lib -lzmq -rpath $$ORIGIN/build/lib
6

Jordan Sissel's avatar
Jordan Sissel committed
7
default: build/bin/lumberjack
8 9
include Makefile.ext

Jordan Sissel's avatar
Jordan Sissel committed
10 11 12 13 14 15
clean:
	-rm -fr lumberjack unixsock *.o build

rpm deb:
	fpm -s dir -t $@ -n lumberjack -v $(VERSION) --prefix /opt/lumberjack \
		bin/lumberjack build/lib
16

Jordan Sissel's avatar
Jordan Sissel committed
17 18 19 20 21 22 23 24 25
#unixsock.c: build/include/insist.h
backoff.c: backoff.h
harvester.c: harvester.h
lumberjack.c: build/include/insist.h build/include/zeromq.h
lumberjack.c: backoff.h harvester.h

build/bin/lumberjack: | build/bin build/lib/libzmq.$(LIBEXT)
build/bin/lumberjack: lumberjack.o backoff.o harvester.o
	$(CC) -o $@ $^
26 27 28 29
	echo ====
	echo "Build complete: $@"
	echo "Run 'make rpm' to build an rpm (or deb or tarball)"

30 31 32 33

build/include/insist.h: | build/include
	curl -s -o $@ https://raw.github.com/jordansissel/experiments/master/c/better-assert/insist.h

34 35 36
build/include/zeromq.h build/lib/libzmq.$(LIBEXT): | build
	$(MAKE) -C vendor/zeromq/ PREFIX=$$PWD/build

37 38 39 40 41 42
build:
	mkdir $@

build/include: | build
	mkdir $@

Jordan Sissel's avatar
Jordan Sissel committed
43 44
build/bin: | build
	mkdir $@