| 1 |
include Makefile.config |
| 2 |
|
| 3 |
BIN= kcat |
| 4 |
|
| 5 |
SRCS_y= kcat.c format.c tools.c input.c |
| 6 |
SRCS_$(ENABLE_JSON) += json.c |
| 7 |
SRCS_$(ENABLE_AVRO) += avro.c |
| 8 |
OBJS= $(SRCS_y:.c=.o) |
| 9 |
|
| 10 |
.PHONY: |
| 11 |
|
| 12 |
all: $(BIN) TAGS |
| 13 |
|
| 14 |
include mklove/Makefile.base |
| 15 |
|
| 16 |
# librdkafka must be compiled with -gstrict-dwarf, but kcat must not, |
| 17 |
# due to some clang bug on OSX 10.9 |
| 18 |
CPPFLAGS := $(subst strict-dwarf,,$(CPPFLAGS)) |
| 19 |
|
| 20 |
install: bin-install install-man |
| 21 |
|
| 22 |
install-man: |
| 23 |
echo $(INSTALL) -d $$DESTDIR$(man1dir) && \ |
| 24 |
echo $(INSTALL) kcat.1 $$DESTDIR$(man1dir) |
| 25 |
|
| 26 |
|
| 27 |
clean: bin-clean |
| 28 |
|
| 29 |
test: |
| 30 |
$(MAKE) -C tests |
| 31 |
|
| 32 |
TAGS: .PHONY |
| 33 |
@(if which etags >/dev/null 2>&1 ; then \ |
| 34 |
echo "Using etags to generate $@" ; \ |
| 35 |
git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h)$$' | \ |
| 36 |
etags -f [email protected] - ; \ |
| 37 |
cmp $@ [email protected] || mv [email protected] $@ ; rm -f [email protected] ; \ |
| 38 |
elif which ctags >/dev/null 2>&1 ; then \ |
| 39 |
echo "Using ctags to generate $@" ; \ |
| 40 |
git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h)$$' | \ |
| 41 |
ctags -e -f [email protected] -L- ; \ |
| 42 |
cmp $@ [email protected] || mv [email protected] $@ ; rm -f [email protected] ; \ |
| 43 |
fi) |
| 44 |
|
| 45 |
|
| 46 |
-include $(DEPS) |