-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
41 lines (31 loc) · 863 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
41
OS = $(shell uname)
DESTDIR=/usr/local/
CC = gcc -g -L/usr/lib -Wall -O3 -D_BSD_SOURCE -I/usr/local/include/ -L/usr/local/lib/
LIBS_DEFAULT = -lldns -lpcap -levent
ifeq ($(OS), Linux)
LIBS_LINUX += -lrt
LIBS = $(LIBS_DEFAULT) $(LIBS_LINUX)
else
LIBS = $(LIBS_DEFAULT)
endif
dnsflow: dnsflow.c dcap.c dcap.h
@echo "Building on OS [${OS}]"
$(CC) dnsflow.c dcap.c -o dnsflow $(LIBS)
clean:
@rm -f *.o dnsflow
@rm -rf *.dSYM
uninstall: clean
@rm -v /usr/local/sbin/dnsflow
ubuntu-uninstall: uninstall
@update-rc.d -f dnsflow remove
@rm -v /etc/init.d/dnsflow
@rm -v /etc/default/dnsflow
install: dnsflow
@mkdir -p $(DESTDIR)/sbin/
@install -cv dnsflow $(DESTDIR)/sbin/
ubuntu-install: install
@install -cv init/dnsflow /etc/init.d/
@install -cv default/dnsflow /etc/default/
@update-rc.d dnsflow defaults
install-service:
@echo "install"