xref: /freebsd/usr.sbin/bsnmpd/bsnmpd/Makefile (revision 8d20be1e22095c27faf8fe8b2f0d089739cc742e)
1# $FreeBSD$
2#
3# Author: Harti Brandt <harti@freebsd.org>
4
5.include <bsd.own.mk>
6
7CONTRIB=${.CURDIR}/../../../contrib/bsnmp
8.PATH: ${CONTRIB}/snmpd
9
10PROG=	bsnmpd
11SRCS=	main.c action.c config.c export.c trap.c trans_udp.c trans_lsock.c
12SRCS+=	oid.h tree.c tree.h
13XSYM=	snmpMIB begemotSnmpdModuleTable begemotSnmpd begemotTrapSinkTable \
14	sysUpTime snmpTrapOID coldStart authenticationFailure \
15	begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \
16	freeBSD freeBSDVersion
17CLEANFILES= oid.h tree.c tree.h
18MAN=	bsnmpd.1 snmpmod.3
19NO_WERROR=
20
21FILESGROUPS= BMIBS DEFS
22
23BMIBS=	FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt
24BMIBSDIR= ${SHAREDIR}/snmp/mibs
25DEFS=	tree.def
26DEFSDIR= ${SHAREDIR}/snmp/defs
27
28CFLAGS+= -DSNMPTREE_TYPES
29CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT
30CFLAGS+= -DUSE_TCPWRAPPERS -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
31CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY
32DPADD=	${LIBBEGEMOT} ${LIBBSNMP} ${LIBWRAP}
33LDADD=	-lbegemot -lbsnmp -lwrap
34
35LDFLAGS= -Wl,-export-dynamic
36
37.if ${MK_OPENSSL} != "no"
38CFLAGS+= -DHAVE_LIBCRYPTO
39.endif
40
41oid.h: tree.def Makefile
42	gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET}
43
44.ORDER: tree.c tree.h
45tree.c tree.h: tree.def
46	gensnmptree -l < ${.ALLSRC}
47
48MANFILTER=	sed -e 's%@MODPATH@%${LIBDIR}/%g'		\
49		    -e 's%@DEFPATH@%${DEFSDIR}/%g'		\
50		    -e 's%@MIBSPATH@%${BMIBSDIR}/%g'
51
52.include <bsd.prog.mk>
53