xref: /freebsd/sbin/ipf/ipftest/Makefile (revision 3fe92528afe8313fecf48822dde74bad5e380f48)
1#	$FreeBSD$
2
3PROG=		ipftest
4SRCS=		${GENHDRS} ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
5		ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \
6		ip_pool.c ip_scan.c ip_sync.c ip_rules.c \
7		ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \
8		ipf_l.c ipnat_y.c ipnat_l.c md5.c radix.c bpf_filter.c
9MAN=		ipftest.1
10
11CFLAGS+=	-DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
12		-DIPFILTER_SCAN -DIPFILTER_SYNC -DIPFILTER_CKSUM -I.
13
14.PATH:		${.CURDIR}/../../../sys/contrib/ipfilter/netinet
15
16GENHDRS=	ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h
17DPSRCS+=	${GENHDRS}
18
19CLEANFILES+=	${GENHDRS}
20CLEANFILES+=	ipf_y.c ipf_l.c
21CLEANFILES+=	ipf.tab.c ipf.tab.h
22CLEANFILES+=	ipnat_y.c ipnat_l.c
23CLEANFILES+=	ipnat.tab.c ipnat.tab.h
24CLEANFILES+=	ippool_y.c ippool_l.c
25CLEANFILES+=	ippool.tab.c ippool.tab.h
26
27ipnat_y.c: ipnat_y.y
28	${YACC} -b ipnat -d ${.ALLSRC}
29	sed -e 's/yy/ipnat_yy/g' \
30	    -e 's/y.tab.c/ipnat_y.c/' \
31	    -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
32	    ipnat.tab.c > ${.TARGET}
33	sed -e 's/yy/ipnat_yy/g' \
34	    -e 's/y.tab.h/ipnat_y.h/' \
35	    ipnat.tab.h > ${.TARGET:.c=.h}
36
37ipnat_y.h: ipnat_y.c
38
39ipnat_l.c: lexer.c
40	sed -e 's/yy/ipnat_yy/g' \
41	    -e 's/y.tab.h/ipnat_y.h/' \
42	    -e 's/lexer.h/ipnat_l.h/' \
43	    ${.ALLSRC} > ${.TARGET}
44
45ipnat_l.h: lexer.h
46	sed -e 's/yy/ipnat_yy/g' \
47	    ${.ALLSRC} > ${.TARGET}
48
49ippool_y.c: ippool_y.y
50	${YACC} -b ippool -d ${.ALLSRC}
51	sed -e 's/yy/ippool_yy/g' \
52	    -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
53	    ippool.tab.c > ${.TARGET}
54	sed -e 's/yy/ippool_yy/g' \
55	    ippool.tab.h > ${.TARGET:.c=.h}
56
57ippool_y.h: ippool_y.c
58
59ippool_l.c: lexer.c
60	sed -e 's/yy/ippool_yy/g' \
61	    -e 's/y.tab.h/ippool_y.h/' \
62	    -e 's/lexer.h/ippool_l.h/' \
63	    ${.ALLSRC} > ${.TARGET}
64
65ippool_l.h: lexer.h
66	sed -e 's/yy/ippool_yy/g' \
67	    ${.ALLSRC} > ${.TARGET}
68
69ipf_y.c: ipf_y.y
70	${YACC} -b ipf -d ${.ALLSRC}
71	sed -e 's/yy/ipf_yy/g' \
72	    -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
73		ipf.tab.c > ${.TARGET}
74	sed -e 's/yy/ipf_yy/g' \
75		ipf.tab.h > ${.TARGET:.c=.h}
76
77ipf_y.h: ipf_y.c
78
79ipf_l.c: lexer.c
80	sed -e 's/yy/ipf_yy/g' \
81	     -e 's/y.tab.h/ipf_y.h/' \
82	     -e 's/lexer.h/ipf_l.h/' \
83	    ${.ALLSRC} > ${.TARGET}
84
85ipf_l.h: lexer.h
86	sed -e 's/yy/ipf_yy/g' \
87	    ${.ALLSRC} > ${.TARGET}
88
89.include <bsd.prog.mk>
90