Add a .mk file for building modules for the SNMP daemon. This may be

use in-tree as well as for 3rd party modules. This file is more or less
what was in usr.sbin/bsnmpd/modules/Makefile.inc with some modifications
and omissions. Usage examples can be found under usr.sbin/bsnmpd/modules/*.

Idea by:	phk
This commit is contained in:
harti 2005-11-10 10:03:22 +00:00
parent 8ac32b507e
commit 86929f9937
3 changed files with 31 additions and 1 deletions

View File

@ -8,7 +8,7 @@ FILES+= bsd.kmod.mk
FILES+= bsd.lib.mk bsd.libnames.mk bsd.links.mk bsd.man.mk bsd.nls.mk
FILES+= bsd.obj.mk bsd.own.mk
FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk
FILES+= bsd.prog.mk bsd.subdir.mk bsd.sys.mk
FILES+= bsd.prog.mk bsd.snmpmod.mk bsd.subdir.mk bsd.sys.mk
FILES+= sys.mk
NO_OBJ=
FILESDIR= ${BINDIR}/mk

View File

@ -36,6 +36,7 @@ bsd.port.post.mk - building ports
bsd.port.pre.mk - building ports
bsd.port.subdir.mk - targets for building subdirectories for ports
bsd.prog.mk - building programs from source files
bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd
bsd.subdir.mk - targets for building subdirectories
bsd.sys.mk - common settings used for building FreeBSD sources
sys.mk - default rules for all makes

29
share/mk/bsd.snmpmod.mk Normal file
View File

@ -0,0 +1,29 @@
# $FreeBSD$
.include <bsd.init.mk>
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${.OBJDIR}
${MOD}_oid.h: ${MOD}_tree.def ${EXTRAMIBDEFS}
cat ${.ALLSRC} | gensnmptree -e ${XSYM} > ${.TARGET}
.ORDER: ${MOD}_tree.c ${MOD}_tree.h
${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS}
cat ${.ALLSRC} | gensnmptree -p ${MOD}_
.if defined(DEFS)
FILESGROUPS+= DEFS
.endif
DEFSDIR= ${SHAREDIR}/snmp/defs
.if defined(BMIBS)
FILESGROUPS+= BMIBS
.endif
BMIBSDIR= ${SHAREDIR}/snmp/mibs
.include <bsd.lib.mk>