xref: /freebsd/usr.bin/netstat/Makefile (revision 2008043f386721d58158e37e0d7e50df8095942d)
1#	@(#)Makefile	8.1 (Berkeley) 6/12/93
2
3.include <src.opts.mk>
4
5PROG=	netstat
6SRCS=	if.c inet.c main.c mbuf.c mroute.c netisr.c nl_symbols.c route.c \
7	unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c common.c nhops.c nhgrp.c \
8	nl_defs.h
9
10nl_symbols.c: nlist_symbols
11	awk '\
12	    BEGIN { \
13		print "#include <sys/param.h>"; \
14		print "#include <nlist.h>"; \
15		print "struct nlist nl[] = {"; \
16	    } \
17	    !/^\#/ { printf("\t{ .n_name = \"%s\" },\n", $$2); } \
18	    END { print "\t{ .n_name = NULL },\n};" } \
19	    ' < ${.ALLSRC} > ${.TARGET} || rm -f ${.TARGET}
20nl_defs.h: nlist_symbols
21	awk '\
22	    BEGIN { \
23		print "#include <nlist.h>"; \
24		print "extern struct nlist nl[];"; \
25		i = 0; \
26	    } \
27	    !/^\#/ { printf("\#define\tN%s\t%s\n", toupper($$2), i++); }' \
28	    < ${.ALLSRC} > ${.TARGET} || rm -f ${.TARGET}
29CLEANFILES+=	nl_symbols.c nl_defs.h
30CFLAGS+=	-I${.OBJDIR}
31
32WARNS?=	3
33CFLAGS+=-fno-strict-aliasing
34
35CFLAGS+=-DIPSEC
36CFLAGS+=-DSCTP
37
38.if ${MK_INET_SUPPORT} != "no"
39CFLAGS+=-DINET
40.endif
41
42.if ${MK_INET6_SUPPORT} != "no"
43SRCS+=	inet6.c
44CFLAGS+=-DINET6
45.endif
46
47.if ${MK_OFED} != "no"
48CFLAGS+=-DSDP
49.endif
50
51.if ${MK_PF} != "no"
52CFLAGS+=-DPF
53.endif
54
55BINGRP=	kmem
56BINMODE=2555
57LIBADD=	kvm memstat xo util
58
59.if ${MK_NETGRAPH_SUPPORT} != "no"
60SRCS+=	netgraph.c
61LIBADD+=	netgraph
62CFLAGS+=-DNETGRAPH
63.endif
64
65.if ${MK_NETLINK_SUPPORT} != "no"
66SRCS+=	route_netlink.c
67.else
68CFLAGS+=-DWITHOUT_NETLINK
69.endif
70
71.if ${MK_JAIL} != "no" && !defined(RESCUE)
72CFLAGS+= -DJAIL
73LIBADD+= jail
74.endif
75
76.include <bsd.prog.mk>
77