-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
50 lines (38 loc) · 1.14 KB
/
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
42
43
44
45
46
47
48
49
50
CC = gcc
CFLAGS = -Wall -O2 -mtune=native
build: bin/dns_parse
#DEBUG=-g
install:
mkdir -p ${DESTDIR}/usr/local/sbin/
cp bin/* ${DESTDIR}/usr/local/sbin/
mkdir -p ${DESTDIR}/etc/init.d/
cp init/dnscapture ${DESTDIR}/etc/init.d/
cp etc/* ${DESTDIR}/etc/
tar: clean
if [ -z ${version} ]; then \
echo "set 'version' env variable first."; \
false;\
fi;
mkdir dns_parse-${version}
cp -r README LICENSE Makefile *.c *.h etc bin init Makefile dns_parse-${version}/
tar -czf dns_parse-${version}.tar.gz dns_parse-${version}
rm -rf dns_parse-${version}
OBJ=rtypes.o strutils.o network.o tcp.o
bin/dns_parse: dns_parse.c ${OBJ}
mkdir -p bin
${CC} ${CFLAGS} ${DEBUG} ${OBJ} -o bin/dns_parse dns_parse.c -lpcap
rtypes.o: rtypes.c rtypes.h
${CC} ${CFLAGS} ${DEBUG} -c rtypes.c
strutils.o: strutils.h strutils.c
${CC} ${CFLAGS} ${DEBUG} -c strutils.c
tcp.o: tcp.h tcp.c dns_parse.h
${CC} ${CFLAGS} ${DEBUG} -c tcp.c
network.o: network.h network.c dns_parse.h
${CC} ${CFLAGS} ${DEBUG} -c network.c
clean:
rm -f *.o
rm -rf bin/dns_parse dns_parse-*
test_strutils: strutils.c
mkdir bin
${CC} -o bin/test_strutils strutils.c
./bin/test_strutils