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