-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
40 lines (28 loc) · 817 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PROG = varnishkafka
SRCS = varnishkafka.c config.c base64.c
DESTDIR?=/usr/local
# Let packagers override version and default configuration file path
# through VER and CFPATH env variables.
ifeq (,${VER})
VER := `git describe --abbrev=6 --tags HEAD --always`
endif
ifeq (,${CFPATH})
CFPATH := /etc/varnishkafka.conf
endif
CFLAGS += -DVARNISHKAFKA_VERSION=\"$(VER)\"
CFLAGS += -DVARNISHKAFKA_CONF_PATH=\"$(CFPATH)\"
CFLAGS += -I/usr/include/varnish/ -I.
CFLAGS += -Wall -Werror -O2
LDFLAGS += -lyajl
LDFLAGS += -lrdkafka -lvarnishapi -lpthread -lrt -lz -lm
all:
gcc $(CFLAGS) $(SRCS) -o $(PROG) $(LDFLAGS)
install:
if [ "$(DESTDIR)" != "/usr/local" ]; then \
DESTDIR="$(DESTDIR)/usr"; \
else \
DESTDIR="$(DESTDIR)" ; \
fi ; \
install -t $${DESTDIR}/bin $(PROG)
clean:
rm -f *.o $(PROG)