xref: /freebsd/usr.sbin/bsnmpd/bsnmpd/Makefile (revision 66df505066f51e6d8411b966765d828817f88971)
1# $FreeBSD$
2#
3# Author: Harti Brandt <harti@freebsd.org>
4
5.include <src.opts.mk>
6
7CONTRIB=${SRCTOP}/contrib/bsnmp
8.PATH: ${CONTRIB}/snmpd
9
10CONFS=	snmpd.config
11CONFSMODE=	600
12PROG=	bsnmpd
13SRCS=	main.c action.c config.c export.c trap.c trans_udp.c trans_lsock.c
14SRCS+=	trans_inet.c oid.h tree.c tree.h
15XSYM=	snmpMIB begemotSnmpdModuleTable begemotSnmpd begemotTrapSinkTable \
16	sysUpTime snmpTrapOID coldStart authenticationFailure \
17	begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \
18	freeBSD freeBSDVersion begemotSnmpdTransInet
19CLEANFILES= oid.h tree.c tree.h
20
21MAN=	bsnmpd.1 snmpmod.3
22
23MLINKS+=	snmpmod.3 FIND_OBJECT_INT.3
24MLINKS+=	snmpmod.3 FIND_OBJECT_INT_LINK.3
25MLINKS+=	snmpmod.3 FIND_OBJECT_INT_LINK_INDEX.3
26MLINKS+=	snmpmod.3 FIND_OBJECT_OID.3
27MLINKS+=	snmpmod.3 FIND_OBJECT_OID_LINK.3
28MLINKS+=	snmpmod.3 FIND_OBJECT_OID_LINK_INDEX.3
29MLINKS+=	snmpmod.3 INSERT_OBJECT_INT.3
30MLINKS+=	snmpmod.3 INSERT_OBJECT_INT_LINK.3
31MLINKS+=	snmpmod.3 INSERT_OBJECT_INT_LINK_INDEX.3
32MLINKS+=	snmpmod.3 INSERT_OBJECT_OID.3
33MLINKS+=	snmpmod.3 INSERT_OBJECT_OID_LINK.3
34MLINKS+=	snmpmod.3 INSERT_OBJECT_OID_LINK_INDEX.3
35MLINKS+=	snmpmod.3 NEXT_OBJECT_INT.3
36MLINKS+=	snmpmod.3 NEXT_OBJECT_INT_LINK.3
37MLINKS+=	snmpmod.3 NEXT_OBJECT_INT_LINK_INDEX.3
38MLINKS+=	snmpmod.3 NEXT_OBJECT_OID.3
39MLINKS+=	snmpmod.3 NEXT_OBJECT_OID_LINK.3
40MLINKS+=	snmpmod.3 NEXT_OBJECT_OID_LINK_INDEX.3
41MLINKS+=	snmpmod.3 bsnmpd_get_target_stats.3
42MLINKS+=	snmpmod.3 bsnmpd_get_usm_stats.3
43MLINKS+=	snmpmod.3 bsnmpd_reset_usm_stats.3
44MLINKS+=	snmpmod.3 buf_alloc.3
45MLINKS+=	snmpmod.3 buf_size.3
46MLINKS+=	snmpmod.3 comm_define.3
47MLINKS+=	snmpmod.3 community.3
48MLINKS+=	snmpmod.3 fd_deselect.3
49MLINKS+=	snmpmod.3 fd_resume.3
50MLINKS+=	snmpmod.3 fd_select.3
51MLINKS+=	snmpmod.3 fd_suspend.3
52MLINKS+=	snmpmod.3 get_ticks.3
53MLINKS+=	snmpmod.3 index_append.3
54MLINKS+=	snmpmod.3 index_append_off.3
55MLINKS+=	snmpmod.3 index_compare.3
56MLINKS+=	snmpmod.3 index_compare_off.3
57MLINKS+=	snmpmod.3 index_decode.3
58MLINKS+=	snmpmod.3 ip_commit.3
59MLINKS+=	snmpmod.3 ip_get.3
60MLINKS+=	snmpmod.3 ip_rollback.3
61MLINKS+=	snmpmod.3 ip_save.3
62MLINKS+=	snmpmod.3 or_register.3
63MLINKS+=	snmpmod.3 or_unregister.3
64MLINKS+=	snmpmod.3 oid_commit.3
65MLINKS+=	snmpmod.3 oid_get.3
66MLINKS+=	snmpmod.3 oid_rollback.3
67MLINKS+=	snmpmod.3 oid_save.3
68MLINKS+=	snmpmod.3 oid_usmNotInTimeWindows.3
69MLINKS+=	snmpmod.3 oid_usmUnknownEngineIDs.3
70MLINKS+=	snmpmod.3 oid_zeroDotZero.3
71MLINKS+=	snmpmod.3 reqid_allocate.3
72MLINKS+=	snmpmod.3 reqid_base.3
73MLINKS+=	snmpmod.3 reqid_istype.3
74MLINKS+=	snmpmod.3 reqid_next.3
75MLINKS+=	snmpmod.3 reqid_type.3
76MLINKS+=	snmpmod.3 snmp_input_finish.3
77MLINKS+=	snmpmod.3 snmp_input_start.3
78MLINKS+=	snmpmod.3 snmp_output.3
79MLINKS+=	snmpmod.3 snmp_pdu_auth_access.3
80MLINKS+=	snmpmod.3 snmp_send_port.3
81MLINKS+=	snmpmod.3 snmp_send_trap.3
82MLINKS+=	snmpmod.3 snmpd_target_stat.3
83MLINKS+=	snmpmod.3 snmpd_usmstats.3
84MLINKS+=	snmpmod.3 start_tick.3
85MLINKS+=	snmpmod.3 string_commit.3
86MLINKS+=	snmpmod.3 string_free.3
87MLINKS+=	snmpmod.3 string_get.3
88MLINKS+=	snmpmod.3 string_get_max.3
89MLINKS+=	snmpmod.3 string_rollback.3
90MLINKS+=	snmpmod.3 string_save.3
91MLINKS+=	snmpmod.3 systemg.3
92MLINKS+=	snmpmod.3 this_tick.3
93MLINKS+=	snmpmod.3 timer_start.3
94MLINKS+=	snmpmod.3 timer_start_repeat.3
95MLINKS+=	snmpmod.3 timer_stop.3
96MLINKS+=	snmpmod.3 target_activate_address.3
97MLINKS+=	snmpmod.3 target_address.3
98MLINKS+=	snmpmod.3 target_delete_address.3
99MLINKS+=	snmpmod.3 target_delete_notify.3
100MLINKS+=	snmpmod.3 target_delete_param.3
101MLINKS+=	snmpmod.3 target_first_address.3
102MLINKS+=	snmpmod.3 target_first_notify.3
103MLINKS+=	snmpmod.3 target_first_param.3
104MLINKS+=	snmpmod.3 target_flush_all.3
105MLINKS+=	snmpmod.3 target_next_address.3
106MLINKS+=	snmpmod.3 target_next_notify.3
107MLINKS+=	snmpmod.3 target_next_param.3
108MLINKS+=	snmpmod.3 target_new_address.3
109MLINKS+=	snmpmod.3 target_new_notify.3
110MLINKS+=	snmpmod.3 target_new_param.3
111MLINKS+=	snmpmod.3 target_notify.3
112MLINKS+=	snmpmod.3 target_param.3
113MLINKS+=	snmpmod.3 usm_delete_user.3
114MLINKS+=	snmpmod.3 usm_find_user.3
115MLINKS+=	snmpmod.3 usm_first_user.3
116MLINKS+=	snmpmod.3 usm_flush_users.3
117MLINKS+=	snmpmod.3 usm_next_user.3
118MLINKS+=	snmpmod.3 usm_new_user.3
119MLINKS+=	snmpmod.3 usm_user.3
120
121FILESGROUPS= BMIBS DEFS
122
123DEFSPACKAGE=	bsnmp
124BMIBSPACKAGE=	bsnmp
125
126BMIBS=	FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt
127BMIBSDIR= ${SHAREDIR}/snmp/mibs
128DEFS=	tree.def
129DEFSDIR= ${SHAREDIR}/snmp/defs
130
131CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT
132CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY
133LIBADD=	begemot bsnmp
134
135LDFLAGS= -Wl,-export-dynamic
136
137.if ${MK_OPENSSL} != "no"
138CFLAGS+= -DHAVE_LIBCRYPTO
139.endif
140
141.if ${MK_TCP_WRAPPERS} != "no"
142CFLAGS+=	-DUSE_TCPWRAPPERS
143LIBADD+=	wrap
144.endif
145
146oid.h: tree.def Makefile
147	gensnmptree -I${CONTRIB}/lib -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET}
148
149.ORDER: tree.c tree.h
150tree.h: .NOMETA
151tree.c tree.h: tree.def
152	gensnmptree -I${CONTRIB}/lib -l -f < ${.ALLSRC}
153
154MANFILTER=	sed -e 's%@MODPATH@%${LIBDIR}/%g'		\
155		    -e 's%@DEFPATH@%${DEFSDIR}/%g'		\
156		    -e 's%@MIBSPATH@%${BMIBSDIR}/%g'
157
158.include <bsd.prog.mk>
159