freebsd-skq/share/mk/bsd.snmpmod.mk
ngie 461f0088ab Add a make target (smilint) for running smilint tool against BMIBS
Running smilint against MIB definitions is useful in finding
functional problems with MIB definitions/descriptions.

This is inspired by the smilint targets defined in
usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile

Document all of the variables that are involved in running the
smilint target, as well as all of the prerequisites to running
it.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9099
2017-01-17 03:38:49 +00:00

43 lines
965 B
Makefile

# $FreeBSD$
INCSDIR= ${INCLUDEDIR}/bsnmp
SHLIB_NAME= snmp_${MOD}.so.${SHLIB_MAJOR}
SRCS+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h
CLEANFILES+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h
CFLAGS+= -I.
${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIBDEFS} ${EXTRAMIBSYMS}
cat ${.ALLSRC} | gensnmptree -e ${XSYM} > ${.TARGET}
.ORDER: ${MOD}_tree.c ${MOD}_tree.h
${MOD}_tree.h: .NOMETA
${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS}
cat ${.ALLSRC} | gensnmptree -p ${MOD}_
.if defined(DEFS)
FILESGROUPS+= DEFS
DEFSDIR?= ${SHAREDIR}/snmp/defs
.endif
.if defined(BMIBS)
FILESGROUPS+= BMIBS
BMIBSDIR?= ${SHAREDIR}/snmp/mibs
.endif
.if !target(smilint) && !empty(BMIBS)
LOCALBASE?= /usr/local
SMILINT?= ${LOCALBASE}/bin/smilint
SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs
SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership
smilint: ${BMIBS}
SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC}
.endif
smilint: .PHONY
.include <bsd.lib.mk>