]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/tools/Makefile
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / tools / Makefile
1 #
2 # Copyright (C) 1993-2001 by Darren Reed.
3 #
4 # See the IPFILTER.LICENCE file for details on licencing.
5 #
6 DEST=.
7
8 all: $(DEST)/ipf_y.c $(DEST)/ipf_y.h $(DEST)/ipf_l.c \
9         $(DEST)/ipmon_y.c $(DEST)/ipmon_y.h $(DEST)/ipmon_l.c \
10         $(DEST)/ipnat_y.c $(DEST)/ipnat_y.h $(DEST)/ipnat_l.c \
11         $(DEST)/ipscan_y.c $(DEST)/ipscan_y.h $(DEST)/ipscan_l.c \
12         $(DEST)/ippool_y.c $(DEST)/ippool_y.h $(DEST)/ippool_l.c \
13         $(DEST)/ipf_l.h $(DEST)/ipnat_l.h $(DEST)/ipscan_l.h \
14         $(DEST)/ippool_l.h $(DEST)/ipmon_l.h
15
16 $(DEST)/ipf_y.h: $(DEST)/ipf_y.c
17
18 $(DEST)/ipf_y.c: ipf_y.y
19         yacc -d ipf_y.y
20         sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.c/' \
21             -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
22             y.tab.c > $(DEST)/ipf_y.c
23         sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' y.tab.h > $(DEST)/ipf_y.h
24         /bin/rm -f y.tab.c y.tab.h
25
26 $(DEST)/ipf_l.c: lexer.c
27         sed -e 's/yy/ipf_yy/g' -e 's/y.tab.h/ipf_y.h/' \
28             -e 's/lexer.h/ipf_l.h/' lexer.c > $@
29
30 $(DEST)/ipmon_y.n: $(DEST)/ipmon_y.c
31
32 $(DEST)/ipmon_y.c $(DEST)/ipmon_y.h: ipmon_y.y
33         yacc -d ipmon_y.y
34         sed -e 's/yy/ipmon_yy/g' -e 's/"ipmon_y.y"/"..\/tools\/ipmon_y.y"/' \
35             y.tab.c > $(DEST)/ipmon_y.c
36         sed -e 's/yy/ipmon_yy/g' y.tab.h > $(DEST)/ipmon_y.h
37         /bin/rm -f y.tab.c y.tab.h
38
39 $(DEST)/ipmon_l.c: lexer.c
40         sed -e 's/yy/ipmon_yy/g' -e 's/y.tab.h/ipmon_y.h/' \
41             -e 's/lexer.h/ipmon_l.h/' lexer.c > $@
42
43 $(DEST)/ipscan_y.h: $(DEST)/ipscan_y.c
44
45 $(DEST)/ipscan_y.c $(DEST)/ipscan_y.h: ipscan_y.y
46         yacc -d ipscan_y.y
47         sed -e 's/yy/ipscan_yy/g' \
48             -e 's/"ipscan_y.y"/"..\/tools\/ipscan_y.y"/' \
49             y.tab.c > $(DEST)/ipscan_y.c
50         sed -e 's/yy/ipscan_yy/g' y.tab.h > $(DEST)/ipscan_y.h
51         /bin/rm -f y.tab.c y.tab.h
52
53 $(DEST)/ipscan_l.c: lexer.c
54         sed -e 's/yy/ipscan_yy/g' -e 's/y.tab.h/ipscan_y.h/' \
55             -e 's/lexer.h/ipscan_l.h/' lexer.c > $@
56
57 $(DEST)/ippool_y.h: $(DEST)/ippool_y.c
58
59 $(DEST)/ippool_y.c $(DEST)/ippool_y.h: ippool_y.y
60         yacc -d ippool_y.y
61         sed -e 's/yy/ippool_yy/g' -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
62             y.tab.c > $(DEST)/ippool_y.c
63         sed -e 's/yy/ippool_yy/g' y.tab.h > $(DEST)/ippool_y.h
64         /bin/rm -f y.tab.c y.tab.h
65
66 $(DEST)/ippool_l.c: lexer.c
67         sed -e 's/yy/ippool_yy/g' -e 's/y.tab.h/ippool_y.h/' \
68             -e 's/lexer.h/ippool_l.h/' lexer.c > $@
69
70 $(DEST)/ipnat_y.h: $(DEST)/ipnat_y.c
71
72 $(DEST)/ipnat_y.c $(DEST)/ipnat_y.h: ipnat_y.y
73         yacc -d ipnat_y.y
74         sed -e 's/yy/ipnat_yy/g' -e 's/y.tab.c/ipnat_y.c/' \
75             -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
76             y.tab.c > $(DEST)/ipnat_y.c
77         sed -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \
78             y.tab.h > $(DEST)/ipnat_y.h
79         /bin/rm -f y.tab.c y.tab.h
80
81 $(DEST)/ipnat_l.c: lexer.c
82         sed -e 's/yy/ipnat_yy/g' -e 's/y.tab.h/ipnat_y.h/' \
83             -e 's/lexer.h/ipnat_l.h/' lexer.c > $@
84
85 $(DEST)/ipf_l.h: lexer.h
86         sed -e 's/yy/ipf_yy/g' lexer.h > $@
87
88 $(DEST)/ipmon_l.h: lexer.h
89         sed -e 's/yy/ipmon_yy/g' lexer.h > $@
90
91 $(DEST)/ipscan_l.h: lexer.h
92         sed -e 's/yy/ipscan_yy/g' lexer.h > $@
93
94 $(DEST)/ippool_l.h: lexer.h
95         sed -e 's/yy/ippool_yy/g' lexer.h > $@
96
97 $(DEST)/ipnat_l.h: lexer.h
98         sed -e 's/yy/ipnat_yy/g' lexer.h > $@
99
100 clean:
101         /bin/rm -f $(DEST)/ipf_y.c $(DEST)/ipf_y.h $(DEST)/ipf_l.c
102         /bin/rm -f $(DEST)/ipmon_y.c $(DEST)/ipmon_y.h $(DEST)/ipmon_l.c
103         /bin/rm -f $(DEST)/ipscan_y.c $(DEST)/ipscan_y.h $(DEST)/ipscan_l.c
104         /bin/rm -f $(DEST)/ippool_y.c $(DEST)/ippool_y.h $(DEST)/ippool_l.c
105         /bin/rm -f $(DEST)/ipnat_y.c $(DEST)/ipnat_y.h $(DEST)/ipnat_l.c
106         /bin/rm -f $(DEST)/ipf_l.h $(DEST)/ipmon_l.h $(DEST)/ippool_l.h
107         /bin/rm -f $(DEST)/ipscan_l.h $(DEST)/ipnat_l.h