1145524Sdarrenr#	$FreeBSD: releng/10.2/sbin/ipf/ipftest/Makefile 255332 2013-09-06 23:11:19Z cy $
2145524Sdarrenr
3145524SdarrenrPROG=		ipftest
4162199SobrienSRCS=		${GENHDRS} ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
5255332Scy		ip_nat6.c \
6145524Sdarrenr		ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \
7145524Sdarrenr		ip_pool.c ip_scan.c ip_sync.c ip_rules.c \
8145524Sdarrenr		ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \
9255332Scy		ipf_l.c ipnat_y.c ipnat_l.c md5.c radix_ipf.c ip_dstlist.c
10145524SdarrenrMAN=		ipftest.1
11145524Sdarrenr
12204585SuqsWARNS?=		0
13145524SdarrenrCFLAGS+=	-DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
14255332Scy		-DIPFILTER_SYNC -DIPFILTER_CKSUM -DHAS_SYS_MD5_H -I.
15145524Sdarrenr
16255332Scy# XXX	The original tarball does not define IPFILTER_SCAN when building this
17255332Scy# XXX	and other modules. It is believed the reason is it fails to build.
18255332Scy# XXX	It has been removed for now.
19255332Scy# XXX CFLAGS+=		-DIPFILTER_SCAN
20255332Scy
21255332Scy
22145555Sdarrenr.PATH:		${.CURDIR}/../../../sys/contrib/ipfilter/netinet
23145524Sdarrenr
24162199SobrienGENHDRS=	ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h
25162199SobrienDPSRCS+=	${GENHDRS}
26145524Sdarrenr
27162199SobrienCLEANFILES+=	${GENHDRS} 
28162199SobrienCLEANFILES+=	ipf_y.c ipf_l.c
29145524SdarrenrCLEANFILES+=	ipf.tab.c ipf.tab.h
30162199SobrienCLEANFILES+=	ipnat_y.c ipnat_l.c
31145524SdarrenrCLEANFILES+=	ipnat.tab.c ipnat.tab.h
32162199SobrienCLEANFILES+=	ippool_y.c ippool_l.c
33145524SdarrenrCLEANFILES+=	ippool.tab.c ippool.tab.h
34145524Sdarrenr
35145524Sdarrenripnat_y.c: ipnat_y.y
36145524Sdarrenr	${YACC} -b ipnat -d ${.ALLSRC}
37145524Sdarrenr	sed -e 's/yy/ipnat_yy/g' \
38145524Sdarrenr	    -e 's/y.tab.c/ipnat_y.c/' \
39145524Sdarrenr	    -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
40145524Sdarrenr	    ipnat.tab.c > ${.TARGET}
41145524Sdarrenr	sed -e 's/yy/ipnat_yy/g' \
42145524Sdarrenr	    -e 's/y.tab.h/ipnat_y.h/' \
43145524Sdarrenr	    ipnat.tab.h > ${.TARGET:.c=.h}
44145524Sdarrenr
45145524Sdarrenripnat_y.h: ipnat_y.c
46145524Sdarrenr
47145524Sdarrenripnat_l.c: lexer.c
48145524Sdarrenr	sed -e 's/yy/ipnat_yy/g' \
49145524Sdarrenr	    -e 's/y.tab.h/ipnat_y.h/' \
50145524Sdarrenr	    -e 's/lexer.h/ipnat_l.h/' \
51145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
52145524Sdarrenr
53145524Sdarrenripnat_l.h: lexer.h
54145524Sdarrenr	sed -e 's/yy/ipnat_yy/g' \
55145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
56145524Sdarrenr
57145524Sdarrenrippool_y.c: ippool_y.y
58145524Sdarrenr	${YACC} -b ippool -d ${.ALLSRC}
59145524Sdarrenr	sed -e 's/yy/ippool_yy/g' \
60145524Sdarrenr	    -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
61145524Sdarrenr	    ippool.tab.c > ${.TARGET}
62145524Sdarrenr	sed -e 's/yy/ippool_yy/g' \
63145524Sdarrenr	    ippool.tab.h > ${.TARGET:.c=.h}
64145524Sdarrenr
65145524Sdarrenrippool_y.h: ippool_y.c
66145524Sdarrenr
67145524Sdarrenrippool_l.c: lexer.c
68145524Sdarrenr	sed -e 's/yy/ippool_yy/g' \
69145524Sdarrenr	    -e 's/y.tab.h/ippool_y.h/' \
70145524Sdarrenr	    -e 's/lexer.h/ippool_l.h/' \
71145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
72145524Sdarrenr
73145524Sdarrenrippool_l.h: lexer.h
74145524Sdarrenr	sed -e 's/yy/ippool_yy/g' \
75145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
76145524Sdarrenr
77145524Sdarrenripf_y.c: ipf_y.y
78145524Sdarrenr	${YACC} -b ipf -d ${.ALLSRC}
79145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
80145524Sdarrenr	    -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
81145524Sdarrenr		ipf.tab.c > ${.TARGET}
82145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
83145524Sdarrenr		ipf.tab.h > ${.TARGET:.c=.h}
84145524Sdarrenr
85145524Sdarrenripf_y.h: ipf_y.c
86145524Sdarrenr
87145524Sdarrenripf_l.c: lexer.c
88145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
89145524Sdarrenr	     -e 's/y.tab.h/ipf_y.h/' \
90145524Sdarrenr	     -e 's/lexer.h/ipf_l.h/' \
91145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
92145524Sdarrenr
93145524Sdarrenripf_l.h: lexer.h
94145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
95145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
96145524Sdarrenr
97145524Sdarrenr.include <bsd.prog.mk>
98