1158343Sobrien# $FreeBSD: releng/10.3/sbin/ipf/ipf/Makefile 291814 2015-12-04 18:50:12Z bdrewery $
2145524Sdarrenr
3145524SdarrenrPROG=		ipf
4162199SobrienSRCS=		${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c
5239775Sissyl0MAN=		ipfilter.4 ipfilter.5 ipf.8 ipf.4 ipf.5 ipl.4
6239775Sissyl0MLINKS=		ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
7255332ScyCFLAGS+=	-I. -DIPFILTER_BPF -DHAS_SYS_MD5_H
8145524Sdarrenr
9162199SobrienGENHDRS=	ipf_l.h ipf_y.h
10162199SobrienCLEANFILES+=	${GENHDRS} ipf_y.c ipf_l.c
11145524Sdarrenr
12145524Sdarrenripf_y.c: ipf_y.y
13145524Sdarrenr	${YACC} -d ${.ALLSRC}
14145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
15145524Sdarrenr	    -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
16145524Sdarrenr	    y.tab.c > ${.TARGET}
17145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
18145524Sdarrenr	    y.tab.h > ${.TARGET:.c=.h}
19145524Sdarrenr
20145524Sdarrenripf_y.h: ipf_y.c
21145524Sdarrenr
22145524Sdarrenripf_l.c: lexer.c
23145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
24145524Sdarrenr	    -e 's/y.tab.h/ipf_y.h/' \
25145524Sdarrenr	    -e 's/lexer.h/ipf_l.h/' \
26145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
27145524Sdarrenr
28145524Sdarrenripf_l.h: lexer.h
29145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
30145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
31145524Sdarrenr
32145630Sdarrenr.if defined(RESCUE)
33145630SdarrenrLIBIPF_SRCS!=	cd ${.CURDIR}/../libipf && ${MAKE} -V SRCS
34145630SdarrenrSRCS+=	${LIBIPF_SRCS}
35146277Sdarrenr.else
36157721SruDPADD+=	${LIBPCAP}
37146277SdarrenrLDADD+=	-lpcap
38145524Sdarrenr.endif
39145524Sdarrenr
40145524Sdarrenr.include <bsd.prog.mk>
41