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 35.if !target(smilint) && !empty(BMIBS) 36LOCALBASE?= /usr/local 37 38SMILINT?= ${LOCALBASE}/bin/smilint 39 40SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs 41 42SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership 43 44smilint: ${BMIBS} 45 SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC} 46.endif 47smilint: .PHONY 48 49.include <bsd.lib.mk> 50