1158343Sobrien# $FreeBSD: stable/11/sbin/ipf/ipf/Makefile 319185 2017-05-30 04:17:22Z ngie $
2145524Sdarrenr
3298107SgjbPACKAGE=	ipf
4145524SdarrenrPROG=		ipf
5162199SobrienSRCS=		${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c
6239775Sissyl0MAN=		ipfilter.4 ipfilter.5 ipf.8 ipf.4 ipf.5 ipl.4
7239775Sissyl0MLINKS=		ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
8255332ScyCFLAGS+=	-I. -DIPFILTER_BPF -DHAS_SYS_MD5_H
9145524Sdarrenr
10162199SobrienGENHDRS=	ipf_l.h ipf_y.h
11162199SobrienCLEANFILES+=	${GENHDRS} ipf_y.c ipf_l.c
12145524Sdarrenr
13145524Sdarrenripf_y.c: ipf_y.y
14145524Sdarrenr	${YACC} -d ${.ALLSRC}
15145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
16145524Sdarrenr	    -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
17145524Sdarrenr	    y.tab.c > ${.TARGET}
18145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
19145524Sdarrenr	    y.tab.h > ${.TARGET:.c=.h}
20145524Sdarrenr
21145524Sdarrenripf_y.h: ipf_y.c
22145524Sdarrenr
23145524Sdarrenripf_l.c: lexer.c
24145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
25145524Sdarrenr	    -e 's/y.tab.h/ipf_y.h/' \
26145524Sdarrenr	    -e 's/lexer.h/ipf_l.h/' \
27145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
28145524Sdarrenr
29145524Sdarrenripf_l.h: lexer.h
30145524Sdarrenr	sed -e 's/yy/ipf_yy/g' \
31145524Sdarrenr	    ${.ALLSRC} > ${.TARGET}
32145524Sdarrenr
33145630Sdarrenr.if defined(RESCUE)
34319185SngieLIBIPF_SRCS!=	cd ${.CURDIR:H}/libipf && ${MAKE} -V SRCS
35145630SdarrenrSRCS+=	${LIBIPF_SRCS}
36146277Sdarrenr.else
37275030SbaptLIBADD+=	pcap
38145524Sdarrenr.endif
39145524Sdarrenr
40145524Sdarrenr.include <bsd.prog.mk>
41