xref: /freebsd/usr.sbin/traceroute/Makefile (revision 7aa383846770374466b1dcb2cefd71bde9acf463)
1# $FreeBSD$
2
3TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute
4.PATH: ${TRACEROUTE_DISTDIR}
5
6PROG=	traceroute
7MAN=	traceroute.8
8SRCS=	as.c version.c traceroute.c ifaddrlist.c findsaddr-udp.c
9BINOWN=	root
10BINMODE=4555
11CLEANFILES=	version.c
12
13CFLAGS+= -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKIO_H=1 \
14	 -DHAVE_NET_ROUTE_H=1 -DHAVE_NET_IF_DL_H=1 \
15	 -DHAVE_STRERROR=1 -DHAVE_USLEEP=1 \
16	 -DHAVE_SYS_SYSCTL_H=1 \
17	 -DHAVE_SETLINEBUF=1 -DHAVE_RAW_OPTIONS=1 \
18	 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_ICMP_NEXTMTU=1
19.if !defined(TRACEROUTE_NO_IPSEC)
20CFLAGS+= -DIPSEC
21.endif
22# RTT Jitter on the internet these days means printing 3 decimal places on
23# > 1000ms times is plain useless.  Uncomment this to enable variable precision
24# reporting, ie: print a variable precision from 0.001ms through 1000ms
25# CFLAGS+= -DSANE_PRECISION
26
27.if !defined(TRACEROUTE_NO_IPSEC)
28DPADD=	${LIBIPSEC}
29LDADD=	-lipsec
30.endif
31
32CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl -I${TRACEROUTE_DISTDIR}
33
34WARNS?=	0
35
36version.c: ${TRACEROUTE_DISTDIR}/VERSION
37	@rm -f ${.TARGET}
38	head -1 ${TRACEROUTE_DISTDIR}/VERSION | \
39	    sed -e 's/.*/char version[] = "&";/' \
40	    > ${.TARGET}
41
42.include <bsd.prog.mk>
43