1include Makefile.config
2
3BIN=	kcat
4
5SRCS_y=	kcat.c format.c tools.c input.c
6SRCS_$(ENABLE_JSON) += json.c
7SRCS_$(ENABLE_AVRO) += avro.c
8OBJS=	$(SRCS_y:.c=.o)
9
10.PHONY:
11
12all: $(BIN) TAGS
13
14include 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
18CPPFLAGS := $(subst strict-dwarf,,$(CPPFLAGS))
19
20install: bin-install install-man
21
22install-man:
23	echo $(INSTALL) -d $$DESTDIR$(man1dir) && \
24	echo $(INSTALL) kcat.1 $$DESTDIR$(man1dir)
25
26
27clean: bin-clean
28
29test:
30	$(MAKE) -C tests
31
32TAGS: .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 $@.tmp - ; \
37		cmp $@ $@.tmp || mv $@.tmp $@ ; rm -f $@.tmp ; \
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 $@.tmp -L- ; \
42		cmp $@ $@.tmp || mv $@.tmp $@ ; rm -f $@.tmp ; \
43	fi)
44
45
46-include $(DEPS)
47