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