Debian Codegraph @

src/pcap_layers/Makefile

raw
1 NAME=pcap_layers
2 LIB=lib${NAME}.a
3 CFLAGS=-Wall -O2
4 PREFIX=/usr/local
5
6
7 all: ${LIB}
8
9 ${LIB}: ${NAME}.o
10 ar r $@ ${NAME}.o
11
12 ${NAME}.o: ${NAME}.c ${NAME}.h
13
14 demo: demo.c ${NAME}.o ${NAME}.h
15 ${CC} ${CFLAGS} -o $@ -I. demo.c ${NAME}.o -lpcap
16
17 install: ${LIB}
18 install -d -m 755 ${PREFIX}/lib
19 install -d -m 755 ${PREFIX}/include
20 install -C -m 644 ${LIB} ${PREFIX}/lib
21 install -C -m 644 ${NAME}.h ${PREFIX}/include
22 install -C -m 644 byteorder.h ${PREFIX}/include/pcap_layers_byteorder.h
23
24 clean:
25 rm -f ${NAME}.o
26 rm -f ${LIB}
27 rm -f demo