---
name: "bsd.snmpmod.mk"
section: "7"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/bsd.snmpmod.mk"
---

# bsd.snmpmod.mk(7)

building modules for bsnmpd(1)

## NAME

**bsd.snmpmod.mk** – building modules for [bsnmpd(1)](/bsnmpd/1.md)

## SYNOPSIS

**.include \<bsd.snmpmod.mk\>**

## DESCRIPTION

The file ⟨bsd.snmpmod.mk⟩ simplifies the building of modules for the Begemot SNMP daemon, [bsnmpd(1)](/bsnmpd/1.md). It provides some common functions for building a module and relies on ⟨bsd.lib.mk⟩, which is included by ⟨bsd.snmpmod.mk⟩ to actually build the shared library.

The following [make(1)](/make/1.md) variables control the special functions:

- *MOD*

  The short name of the module. The name of the shared library will be *snmp\_${MOD}.so*. There must exist a file *${MOD}\_tree.def* for compilation with [gensnmptree(1)](/gensnmptree/1.md) which contains the definition of the MIB tree implemented by the module.

- *EXTRAMIBDEFS*

  A list of extra MIB definition files for [gensnmptree(1)](/gensnmptree/1.md). This is optional. This file list is given to both calls to [gensnmptree(1)](/gensnmptree/1.md) — the one that extracts the symbols in *XSYM* from the MIB definitions and the one that generates the table with OIDs served by this module.

- *EXTRAMIBSYMS*

  A list of extra MIB definition files for [gensnmptree(1)](/gensnmptree/1.md). This is optional. This file list is given only to the call to [gensnmptree(1)](/gensnmptree/1.md) that extracts symbols from MIB definition files. It is useful if there are dependencies on other MIBs or for extracting global definitions for enumeration constants.

- *XSYM*

  A list of symbols to be extracted from the MIB definition files by [gensnmptree(1)](/gensnmptree/1.md). This is optional.

- *DEFS*

  A list of MIB definition files to be installed. This is optional.

- *BMIBS*

  A list of textual MIBs to be installed. This is optional.

Three files are automatically created from the MIB definition files and the *XSYM* variable:

- *${MOD}\_tree.c*

  This contains a table with the tree implemented by the module. It is automatically included into the *SRCS* variable.

- *${MOD}\_tree.h*

  This contains preprocessor defines for all the OIDs defined by the module and can be included in the module's source code.

- *${MOD}\_oid.h*

  OID preprocessor definitions for all the symbols listed in *XSYMS*. This is to be included into the module's source code.

## SEE ALSO

[bsnmpd(1)](/bsnmpd/1.md), [gensnmptree(1)](/gensnmptree/1.md), [snmpmod(3)](/snmpmod/3.md)
