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