summaryrefslogtreecommitdiffstats
path: root/usr.sbin/traceroute/Makefile
blob: 953c5d47114913a0208dc7e8a8419fd1d6a7e061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# $FreeBSD$

TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute
.PATH: ${TRACEROUTE_DISTDIR}

PROG=	traceroute
MAN=	traceroute.8
SRCS=	version.c traceroute.c ifaddrlist.c findsaddr-socket.c
BINOWN=	root
BINMODE=4555
CLEANFILES=	version.c

CFLAGS+= -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKIO_H=1 \
	 -DHAVE_NET_ROUTE_H=1 -DHAVE_NET_IF_DL_H=1 \
	 -DHAVE_STRERROR=1 -DHAVE_USLEEP=1 \
	 -DHAVE_SYS_SYSCTL_H=1 \
	 -DHAVE_SETLINEBUF=1 -DHAVE_RAW_OPTIONS=1 \
	 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_ICMP_NEXTMTU=1
.ifndef (NOIPSEC)
CFLAGS+= -DIPSEC
.endif
# RTT Jitter on the internet these days means printing 3 decimal places on
# > 1000ms times is plain useless.  Uncomment this to enable variable precision
# reporting, ie: print a variable precision from 0.001ms through 1000ms
# CFLAGS+= -DSANE_PRECISION

.ifndef (NOIPSEC)
DPADD=	${LIBIPSEC}
LDADD=	-lipsec
.endif

.if ${MACHINE_ARCH} == "alpha"
# gcc builtin memcpy causes unaligned access
CFLAGS+= -fno-builtin
.endif

CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl

version.c: ${TRACEROUTE_DISTDIR}/VERSION
	@rm -f ${.TARGET}
	head -1 ${TRACEROUTE_DISTDIR}/VERSION | \
	    sed -e 's/.*/char version[] = "&";/' \
	    > ${.TARGET}

.include <bsd.prog.mk>
OpenPOWER on IntegriCloud