1# $FreeBSD$ 2 3INCSDIR= ${INCLUDEDIR}/bsnmp 4 5SHLIB_NAME= snmp_${MOD}.so.${SHLIB_MAJOR} 6SRCS+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h 7CLEANFILES+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h 8CFLAGS+= -I. 9GENSNMPTREEFLAGS+= -I${SHAREDIR}/snmpdefs 10 11 12${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIBDEFS} ${EXTRAMIBSYMS} 13 cat ${.ALLSRC} | gensnmptree ${GENSNMPTREEFLAGS} -e ${XSYM} > ${.TARGET} 14 15# Multi-output targets both expect a .meta file and will fight over it. Only 16# allow it on the .c file instead. 17${MOD}_tree.h: ${MOD}_tree.c .NOMETA 18# Force rebuild the .c file if any of its other outputs are missing. 19.if !exists(${MOD}_tree.h) 20${MOD}_tree.c: .PHONY .META 21.endif 22${MOD}_tree.c: ${MOD}_tree.def ${EXTRAMIBDEFS} 23 cat ${.ALLSRC} | gensnmptree -f ${GENSNMPTREEFLAGS} -p ${MOD}_ 24 25.if defined(DEFS) 26FILESGROUPS+= DEFS 27DEFSDIR?= ${SHAREDIR}/snmp/defs 28.endif 29 30.if defined(BMIBS) 31FILESGROUPS+= BMIBS 32BMIBSDIR?= ${SHAREDIR}/snmp/mibs 33.endif 34 35DEFSPACKAGE= bsnmp 36BMIBSPACKAGE= bsnmp 37 38.if !target(smilint) && !empty(BMIBS) 39LOCALBASE?= /usr/local 40 41SMILINT?= ${LOCALBASE}/bin/smilint 42 43SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs 44 45SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership 46 47smilint: ${BMIBS} 48 SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC} 49.endif 50smilint: .PHONY 51 52.include <bsd.lib.mk> 53