Precise how to build/install/uninstall curvetun.
[netsniff-ng.git] / src / bpfc / Makefile
blobcf5d9b1bdef325e2e8036678d609af0255d3d1e8
2 # Makefile for bpfc
3 # Author: Daniel Borkmann
6 include ../definitions.mk
8 INCLUDE = -I.. -I.
9 CFLAGS +=
10 LIBS =
12 core-objs = bpfc.o
13 lib-objs = xmalloc.o \
14 bpf.o \
15 lex.yy.o \
16 bpf_parser.tab.o \
17 strlcpy.o
18 flex-obj = ../bpf_lexer.l
19 bison-obj = ../bpf_parser.y
21 target = bpfc
23 all: clean gen-version build doc
24 debug: all
25 deploy: all strip
27 gen-version:
28 @cd .. && cat ../VERSION | xargs ./gen_build_info.pl
30 gen-flex-bison:
31 @$(FL) $(flex-obj)
32 @$(BI) $(bison-obj)
33 @mv bpf_parser.tab.c ../
34 @mv bpf_parser.tab.h ../
35 @mv lex.yy.c ../
37 build: $(lib-objs) $(core-objs)
38 @$(LD) $(target) $(core-objs) $(lib-objs) $(LIBS)
40 strip:
41 @strip $(target)
43 doc:
44 # @cd ../../Documentation && make clean
45 # @cd ../../Documentation && make ifpps
46 # @cp ../../Documentation/man/* .
47 # @cp ../../Documentation/pdf/* .
48 # @cp ../../Documentation/html/* .
50 ../bpf_parser.tab.c: gen-flex-bison
51 ../lex.yy.c: gen-flex-bison
53 %.o: ../%.c
54 @$(CC) -g $(CFLAGS) $(INCLUDE) $<
56 clean:
57 @rm *.o *~ $(target) ../version.h *.gz *.pdf *.html *.8 *.css \
58 ../bpf_parser.tab.c ../bpf_parser.tab.h ../lex.yy.c > /dev/null 2>&1 || true
60 install:
61 @install -D $(target) $(DESTDIR)/$(BINDIR)/$(target)
62 @install -D $(target).8.gz $(DESTDIR)/usr/share/man/man8/$(target).8.gz
64 uninstall:
65 @rm $(DESTDIR)/$(BINDIR)/$(target) || true
66 @rm $(DESTDIR)/usr/share/man/man8/$(target).8.gz || true
68 help:
69 @echo 'Cleaning targets:'
70 @echo ' clean - Remove generated files'
71 @echo 'Building targets:'
72 @echo ' all - Build bpfc (default)'
73 @echo ' debug - Build bpfc for debugging _only_'
74 @echo ' deploy - Build bpfc for productive use'
75 @echo 'Setup targets:'
76 @echo ' install - Install bpfc'
77 @echo ' uninstall - Uninstall bpfc'
78 @echo 'Other targets:'
79 @echo ' help - Print this help'