Name Date Size #Lines LOC

..--

MakefileH A D04-Jun-20252 KiB10186

atf.test.mkH A D16-Apr-20254.8 KiB156109

auto.obj.mkH A D03-Jun-20252.6 KiB8241

bsd.READMEH A D24-May-202524 KiB738529

bsd.arch.inc.mkH A D11-Jun-2010387 127

bsd.clang-analyze.mkH A D19-Apr-20253 KiB10056

bsd.compat.mkH A D19-Apr-20254.7 KiB183140

bsd.compat.pre.mkH A D19-Apr-2025392 147

bsd.compiler.mkH A D20-Jun-202512.6 KiB326207

bsd.confs.mkH A D19-Apr-20253.8 KiB146111

bsd.cpu.mkH A D20-Jan-202514.2 KiB415327

bsd.crunchgen.mkH A D10-Nov-20235.8 KiB188124

bsd.dep.mkH A D04-Jun-202511.4 KiB383267

bsd.dirs.mkH A D19-Apr-20251.7 KiB5539

bsd.doc.mkH A D23-Nov-20234.5 KiB200134

bsd.dtb.mkH A D16-Aug-202382 63

bsd.endian.mkH A D16-Aug-20231 KiB3026

bsd.files.mkH A D19-Apr-20254 KiB148109

bsd.incs.mkH A D16-Aug-20233.2 KiB11496

bsd.info.mkH A D16-Aug-20235.3 KiB196102

bsd.init.mkH A D19-Apr-20253 KiB9562

bsd.kmod.mkH A D16-Aug-202387 63

bsd.lib.mkH A D22-Apr-202514.6 KiB508408

bsd.libnames.mkH A D05-Jun-202510.1 KiB239214

bsd.linker.mkH A D19-Apr-20254.7 KiB14296

bsd.links.mkH A D15-Mar-2024996 3630

bsd.man.mkH A D16-Jun-20246.8 KiB259188

bsd.mkopt.mkH A D24-Feb-20254.2 KiB14578

bsd.nls.mkH A D16-Aug-20231.9 KiB8648

bsd.obj.mkH A D19-Apr-20256.5 KiB249154

bsd.opts.mkH A D04-Jun-20253.5 KiB12660

bsd.own.mkH A D22-May-20256.6 KiB296106

bsd.port.mkH A D02-Jan-2024698 2816

bsd.port.options.mkH A D16-Aug-202380 84

bsd.port.post.mkH A D16-Aug-202362 73

bsd.port.pre.mkH A D16-Aug-202364 73

bsd.port.subdir.mkH A D02-Jan-2024488 1811

bsd.prog.mkH A D21-Apr-20259.7 KiB398324

bsd.progs.mkH A D21-Apr-20254.8 KiB168113

bsd.sanitizer.mkH A D01-Nov-20221.6 KiB4429

bsd.snmpmod.mkH A D16-Aug-20231.3 KiB5234

bsd.subdir.mkH A D19-Apr-20256 KiB210132

bsd.suffixes-extra.mkH A D24-May-20253.1 KiB10279

bsd.suffixes-posix.mkH A D16-Aug-20231,004 5635

bsd.suffixes.mkH A D16-Aug-20232.4 KiB10375

bsd.symver.mkH A D19-Apr-20251.2 KiB5136

bsd.sys.mkH A D16-Apr-202516.1 KiB527392

bsd.sysdir.mkH A D16-Aug-2023545 1814

bsd.test.mkH A D04-Jun-20253.2 KiB10947

dirdeps-options.mkH A D14-Mar-20243.4 KiB11244

dirdeps-targets.mkH A D10-Feb-20255.4 KiB18293

dirdeps.mkH A D10-Feb-202533.9 KiB1,013578

gendirdeps.mkH A D10-Feb-202513.3 KiB426239

googletest.test.inc.mkH A D11-Apr-2025354 137

googletest.test.mkH A D16-Aug-20231.3 KiB4720

host-target.mkH A D23-Sep-20231.8 KiB6548

host.test.mkH A D04-Jun-20252.6 KiB9048

install-new.mkH A D16-Aug-20231.7 KiB6844

jobs.mkH A D03-Jun-20252.7 KiB10954

kmod.opts.mkH A D16-Aug-202365 42

local.autodep.mkH A D14-Mar-2024609 3219

local.dirdeps-options.mkH A D03-Nov-2023721 3023

local.dirdeps-targets.mkH A D14-Oct-2024178 85

local.dirdeps.mkH A D05-Jun-20258.5 KiB309218

local.gendirdeps.mkH A D14-Oct-20241.4 KiB6143

local.init.mkH A D19-Apr-20251.3 KiB4429

local.meta.stage.mkH A D16-Oct-2024224 74

local.meta.sys.env.mkH A D16-Aug-2023424 2113

local.sys.dirdeps.env.mkH A D23-Sep-20231.7 KiB6842

local.sys.dirdeps.mkH A D23-Sep-20234.4 KiB15197

local.sys.env.mkH A D11-Feb-20251.8 KiB6630

local.sys.machine.mkH A D23-Sep-2023660 2517

local.sys.mkH A D24-Sep-20232.9 KiB10875

meta.autodep.mkH A D24-Apr-20249.9 KiB335220

meta.stage.mkH A D14-Mar-202411.2 KiB371276

meta.subdir.mkH A D29-Jul-20242.1 KiB

meta.sys.mkH A D10-Feb-20254.1 KiB171102

meta2deps.pyH A D10-Feb-202526 KiB840690

meta2deps.shH A D14-Mar-202410.3 KiB458319

netbsd-tests.test.mkH A D19-Apr-2025883 3921

plain.test.mkH A D21-Oct-20242.2 KiB8055

src.init.linux.mkH A D23-Sep-2023380 198

src.init.mkH A D19-Apr-2025664 3827

src.libnames.mkH A D26-Jun-202524.7 KiB919781

src.lua.mkH A D19-Apr-20251.3 KiB4511

src.opts.mkH A D05-Jun-202512.2 KiB527380

src.sys.env.mkH A D16-Aug-20232.8 KiB9665

src.sys.mkH A D13-Nov-20231.8 KiB5026

src.sys.obj.mkH A D03-Jun-20257.1 KiB231147

src.tools.mkH A D19-Apr-2025891 269

stage-install.shH A D03-Jun-20253 KiB14271

suite.test.mkH A D16-Aug-20234 KiB12661

sys.dependfile.mkH A D10-Feb-20252.2 KiB6725

sys.dirdeps.mkH A D18-Apr-20245.3 KiB204119

sys.mkH A D04-Mar-20257.9 KiB329202

tap.test.mkH A D16-Aug-20232.8 KiB9766

version_gen.awkH A D16-Aug-20236.3 KiB251186

bsd.README

1
2This is the README file for the "include" files for the FreeBSD
3source tree.  The files are installed in /usr/share/mk, and are by
4convention, named with the suffix ".mk".  These files store several
5build options and should be handled with caution.
6
7Note, this file is not intended to replace reading through the .mk
8files for anything tricky.
9
10There are two main types of make include files.  One type is the generally
11usable make include files, such as bsd.prog.mk and bsd.lib.mk.  The other is
12the internal make include files, such as bsd.files.mk and bsd.man.mk, which
13can not/should not be used directly but are used by the other make include
14files.  In most cases it is only interesting to include bsd.prog.mk or
15bsd.lib.mk.
16
17bsd.arch.inc.mk		- includes arch-specific Makefile.$arch
18bsd.compat.mk		- definitions for building programs against compat ABIs
19bsd.compiler.mk		- defined based on current compiler
20bsd.confs.mk		- install of configuration files
21bsd.cpu.mk		- sets CPU/arch-related variables (included from sys.mk)
22bsd.crunchgen.mk	- building crunched binaries using crunchgen(1)
23bsd.dep.mk		- handle Makefile dependencies
24bsd.dirs.mk		- handle directory creation
25bsd.doc.mk		- building troff system documents
26bsd.endian.mk		- TARGET_ENDIAN=1234(little) or 4321 (big) for target
27bsd.files.mk		- install of general purpose files
28bsd.incs.mk		- install of include files
29bsd.info.mk		- building GNU Info hypertext system (deprecated)
30bsd.init.mk		- initialization for the make include files
31bsd.kmod.mk		- building loadable kernel modules
32bsd.lib.mk		- support for building libraries
33bsd.libnames.mk		- define library names
34bsd.links.mk		- install of links (sym/hard)
35bsd.man.mk		- install of manual pages and their links
36bsd.nls.mk		- build and install of NLS catalogs
37bsd.obj.mk		- creating 'obj' directories and cleaning up
38bsd.own.mk		- define common variables
39bsd.port.mk		- building ports
40bsd.port.post.mk	- building ports
41bsd.port.pre.mk		- building ports
42bsd.port.subdir.mk	- targets for building subdirectories for ports
43bsd.prog.mk		- building programs from source files
44bsd.progs.mk		- build multiple programs from sources
45bsd.snmpmod.mk		- building modules for the SNMP daemon bsnmpd
46bsd.subdir.mk		- targets for building subdirectories
47bsd.sys.mk		- common settings used for building FreeBSD sources
48bsd.test.mk		- building test programs from source files
49sys.mk			- default rules for all makes
50
51This file does not document bsd.port*.mk.  They are documented in ports(7).
52
53See also make(1), mkdep(1), style.Makefile(5) and `PMake - A
54Tutorial', located in /usr/share/doc/psd/12.make.
55
56=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
57
58Random things worth knowing about this document:
59
60If appropriate when documenting the variables the default value is
61indicated using square brackets e.g. [gzip].
62In some cases the default value depend on other values (e.g. system
63architecture).  In these cases the most common value is indicated.
64
65This document contains some simple examples of the usage of the BSD make
66include files.  For more examples look at the makefiles in the FreeBSD
67source tree.
68
69=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
70
71RANDOM THINGS WORTH KNOWING:
72
73The files are like C-style #include files, and pretty much behave like
74you'd expect.  The syntax is slightly different in that a single '.' is
75used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
76
77One difference that will save you lots of debugging time is that inclusion
78of the file is normally done at the *end* of the Makefile.  The reason for
79this is because .mk files often modify variables and behavior based on the
80values of variables set in the Makefile.  To make this work, remember that
81the FIRST target found is the target that is used, i.e. if the Makefile has:
82
83	a:
84		echo a
85	a:
86		echo a number two
87
88the command "make a" will echo "a".  To make things confusing, the SECOND
89variable assignment is the overriding one, i.e. if the Makefile has:
90
91	a=	foo
92	a=	bar
93
94	b:
95		echo ${a}
96
97the command "make b" will echo "bar".  This is for compatibility with the
98way the V7 make behaved.
99
100It's fairly difficult to make the BSD .mk files work when you're building
101multiple programs in a single directory.  It's a lot easier to split up
102the programs than to deal with the problem.  Most of the agony comes from
103making the "obj" directory stuff work right, not because we switch to a new
104version of make.  So, don't get mad at us, figure out a better way to handle
105multiple architectures so we can quit using the symbolic link stuff.
106(Imake doesn't count.)
107
108The file .depend in the source directory is expected to contain dependencies
109for the source files.  This file is read automatically by make after reading
110the Makefile.
111
112The variable DESTDIR works as before.  It's not set anywhere but will change
113the tree where the file gets installed.
114
115A ".pico" suffix denotes a position-independent relocatable object.
116".nossppico" denotes a position-independent relocatable object without
117stack smashing protection and without sanitizer instrumentation.
118
119=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
120
121The following variables are common:
122
123ACFLAGS		Flags to the compiler when preprocessing and
124		assembling .S files.
125ACFLAGS.${SRC}
126		Flags dependent on source file name.
127ACFLAGS.${.TARGET:T}
128		Flags dependent on output file name.
129
130AFLAGS		Flags to the assembler when assembling .s files.
131AFLAGS.${SRC}
132		Flags dependent on source file name.
133AFLAGS.${.TARGET:T}
134		Flags dependent on output file name.
135
136CFLAGS		Flags to the compiler when creating C objects.
137CFLAGS.${SRC}
138		Flags dependent on source file name.
139CFLAGS.${.TARGET:T}
140		Flags dependent on output file name.
141CFLAGS.${COMPILER_TYPE}
142		Flags dependent on compiler added to CFLAGS.
143CFLAGS.${MACHINE_ARCH}
144		Architectural flags added to CFLAGS.
145CFLAGS_NO_SIMD	Add this to CFLAGS for programs that don't want any SIMD
146		instructions generated. It is setup in bsd.cpu.mk to an
147		appropriate value for the compiler and target.
148
149CXXFLAGS.${COMPILER_TYPE}
150		Flags dependent on compiler added to CXXFLAGS.
151CXXFLAGS.${MACHINE_ARCH}
152		Architectural flags added to CXXFLAGS.
153CXXFLAGS.${SRC}
154		Flags dependent on source file name.
155CXXFLAGS.${.TARGET:T}
156		Flags dependent on output file name.
157
158DPADD		Additional dependencies.  Usually used for libraries.
159		For example, to depend on the compatibility and utility
160		libraries use:
161
162			DPADD=${LIBCOMPAT} ${LIBUTIL}
163
164		There is a predefined identifier for each (non-shared)
165		library and object.  Library file names are
166		transformed to identifiers by removing the extension and
167		converting to upper case.
168
169		There are no special identifiers for shared libraries
170		or objects.  The identifiers for the standard
171		libraries are used in DPADD.  This works correctly iff
172		all the libraries are built at the same time.
173		Unfortunately, it causes unnecessary relinks to shared
174		libraries when only the static libraries have changed.
175		Dependencies on shared libraries should be only on the
176		library version numbers.
177
178LDADD		Additional linker objects.  Usually used to add libraries.
179		For example, to load with the compatibility and utility
180		libraries, use:
181
182			LDADD=-lutil -lcompat
183
184LDADD.${.TARGET:T}
185		Loader objects dependent on output file name.
186
187LDFLAGS		Additional linker flags. Passed to the linker via CC,
188		since that's used to link programs as well, so linker
189		specific flags need to be prefixed with -Wl, to work.
190LDFLAGS.${.TARGET:T}
191		Flags dependent on output file name.
192
193LIBADD		Additional libraries.  This is for base system libraries
194		and is only valid inside of the FreeBSD tree.
195		Use LIBADD=name instead of LDADD=-lname.
196
197LIBADD.${.TARGET:T}
198		Libraries dependent on output file name.
199
200SHARED_CFLAGS	Additional compiler flags used when creating shared or
201		position independent object files.
202
203COMPILER_FEATURES
204		A list of features that the compiler supports. Zero or
205		more of:
206			c++11	Supports full C++ 11 standard.
207
208COMPILER_TYPE	Type of compiler, either clang or gcc, though other
209		values are possible. Don't assume != clang == gcc.
210
211COMPILER_VERSION
212		A numeric constant equal to:
213		     major * 10000 + minor * 100 + tiny
214		for the compiler's self-reported version.
215
216=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
217
218The include file <sys.mk> has the default rules for all makes, in the BSD
219environment or otherwise.  You probably don't want to touch this file.
220
221=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
222
223The include file <bsd.arch.inc.mk> includes other Makefiles for specific
224architectures, if they exist. It will include the first of the following
225files that it finds: Makefile.${MACHINE}, Makefile.${MACHINE_ARCH},
226Makefile.${MACHINE_CPUARCH}
227
228=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
229
230The include file <bsd.man.mk> handles installing manual pages and their
231links.
232
233It has three targets:
234
235	all-man:
236		build manual pages.
237	maninstall:
238		install the manual pages and their links.
239	manlint:
240		verify the validity of manual pages.
241
242It sets/uses the following variables:
243
244MAN		The manual pages to be installed (use a .1 - .9 suffix).
245
246MANDIR		Base path for manual installation.
247
248MANGRP		Manual group.
249
250MANMODE		Manual mode.
251
252MANOWN		Manual owner.
253
254MANSUBDIR	Subdirectory under the manual page section, i.e. "/vax"
255		or "/tahoe" for machine specific manual pages.
256
257MLINKS		List of manual page links (using a .1 - .9 suffix).  The
258		linked-to file must come first, the linked file second,
259		and there may be multiple pairs.  The files are hard-linked.
260
261The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
262it exists.
263
264=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
265
266The include file <bsd.own.mk> contains the owners, groups, etc. for both
267manual pages and binaries.
268
269It has no targets.
270
271It sets/uses the following variables:
272
273BINGRP		Binary group.
274
275BINMODE		Binary mode.
276
277BINOWN		Binary owner.
278
279MANDIR		Base path for manual installation.
280
281MANGRP		Manual group.
282
283MANMODE		Manual mode.
284
285MANOWN		Manual owner.
286
287INSTALL_LINK	Command to install a hard link.
288
289INSTALL_SYMLINK	Command to install a symbolic link.
290
291INSTALL_RSYMLINK	Command to install a relative symbolic link.
292
293LINKOWN		Owner of hard links created by INSTALL_LINK.
294
295LINKGRP		Group of hard links created by INSTALL_LINK.
296
297LINKMODE	Mode of hard links created by INSTALL_LINK.
298
299SYMLINKOWN	Owner of hard links created by INSTALL_[R]SYMLINK.
300
301SYMLINKGRP	Group of hard links created by INSTALL_[R]SYMLINK.
302
303SYMLINKMODE	Mode of hard links created by INSTALL_[R]SYMLINK.
304
305This file is generally useful when building your own Makefiles so that
306they use the same default owners etc. as the rest of the tree.
307
308=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
309
310The include file <bsd.prog.mk> handles building programs from one or
311more source files, along with their manual pages.  It has a limited number
312of suffixes, consistent with the current needs of the BSD tree.
313
314It has seven targets:
315
316	all:
317		build the program and its manual page
318	clean:
319		remove the program and any object files.
320	cleandir:
321		remove all of the files removed by the target clean, as
322		well as .depend, tags, and any manual pages.
323	depend:
324		make the dependencies for the source files, and store
325		them in the file .depend.
326	install:
327		install the program and its manual pages; if the Makefile
328		does not itself define the target install, the targets
329		beforeinstall and afterinstall may also be used to cause
330		actions immediately before and after the install target
331		is executed.
332	tags:
333		create a tags file for the source files.
334
335It sets/uses the following variables:
336
337BINGRP		Binary group.
338
339BINMODE		Binary mode.
340
341BINOWN		Binary owner.
342
343CLEANDIRS	Additional files (CLEANFILES) and directories (CLEANDIRS) to
344CLEANFILES	remove during clean and cleandir targets.  "rm -rf" and
345		"rm -f" are used, respectively.
346
347DIRS		A list of variables referring to directories.  For example:
348
349			DIRS+=	FOO
350			FOO=	/usr/share/foo
351
352		Owner, Group, Mode and Flags are handled by FOO_OWN,
353		FOO_GRP, FOO_MODE and FOO_FLAGS, respectively.
354
355		This allows FILESDIR to be set to FOO, and the directory
356		will be created before the files are installed and the
357		dependencies will be set correctly.
358
359FILES		A list of non-executable files.
360		The installation is controlled by the FILESNAME, FILESOWN,
361		FILESGRP, FILESMODE, FILESDIR variables that can be
362		further specialized by FILES<VAR>_<file>.
363
364LINKS		The list of binary links; should be full pathnames, the
365		linked-to file coming first, followed by the linked
366		file.  The files are hard-linked.  For example, to link
367		/bin/test and /bin/[, use:
368
369			LINKS=	/bin/test /bin/[
370
371LINKOWN		Owner of links created with LINKS [${BINOWN}].
372
373LINKGRP		Group of links created with LINKS [${BINGRP}].
374
375LINKMODE	Mode of links created with LINKS [${BINMODE}].
376
377
378MAN		Manual pages.  If no MAN variable is defined,
379		"MAN=${PROG}.1" is assumed. See bsd.man.mk for more details.
380
381PROG		The name of the program to build.  If not supplied, nothing
382		is built.
383
384PROGNAME	The name that the above program will be installed as, if
385		different from ${PROG}.
386
387PROG_CXX	If defined, the name of the program to build.  Also
388		causes <bsd.prog.mk> to link the program with the
389		standard C++ library.  PROG_CXX overrides the value
390		of PROG if PROG is also set.
391
392PROGS		When used with <bsd.progs.mk>, allow building multiple
393PROGS_CXX	PROG and PROG_CXX in one Makefile.  To define
394		individual variables for each program the VAR.prog
395		syntax should be used.  For example:
396
397		PROGS=		foo bar
398		SRCS.foo=	foo_src.c
399		LDADD.foo=	-lutil
400		SRCS.bar=	bar_src.c
401
402		The supported variables are:
403		- BINDIR
404		- BINGRP
405		- BINMODE
406		- BINOWN
407		- CFLAGS
408		- CXXFLAGS
409		- DEBUG_FLAGS
410		- DPADD
411		- DPSRCS
412		- INTERNALPROG (no installation)
413		- LDADD
414		- LDFLAGS
415		- LIBADD
416		- LINKS
417		- MAN
418		- MLINKS
419		- MK_WERROR=no
420		- PROGNAME
421		- SRCS
422		- STRIP
423		- WARNS
424
425SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
426		The installation is controlled by the SCRIPTSNAME, SCRIPTSOWN,
427		SCRIPTSGRP, SCRIPTSMODE, SCRIPTSDIR variables that can be
428		further specialized by SCRIPTS<VAR>_<script>.
429
430SRCS		List of source files to build the program.  If SRCS is not
431		defined, it's assumed to be ${PROG}.c or, if PROG_CXX is
432		defined, ${PROG_CXX}.cc.
433
434STRIP		The flag passed to the install program to cause the binary
435		to be stripped.  This is to be used when building your
436		own install script so that the entire system can be made
437		stripped/not-stripped using a single nob.
438
439SUBDIR		A list of subdirectories that should be built as well.
440		Each of the targets will execute the same target in the
441		subdirectories.
442
443The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
444if it exists, as well as the include file <bsd.man.mk>.
445
446Some simple examples:
447
448To build foo from foo.c with a manual page foo.1, use:
449
450	PROG=	foo
451
452	.include <bsd.prog.mk>
453
454To build foo from foo.c with a manual page foo.2, add the line:
455
456	MAN=	foo.2
457
458If foo does not have a manual page at all, add the line:
459
460	MAN=
461
462If foo has multiple source files, add the line:
463
464	SRCS=	a.c b.c c.c d.c
465
466=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
467
468The include file, <bsd.compat.mk>, allows programs (built with
469<bsd.prog.mk>) to be built for one the ABI(s) supported by the
470top-level Makefile.libcompat.  It requires that <bsd.prog.mk> also be
471included.
472
473NEED_COMPAT	Build and link targeting a compatibility ABI or fail if it
474		is not available.  Supported values are "32", "soft", and
475		"any" being a wildcard.
476
477WANT_COMPAT	Similar to NEED_COMPAT, but build with the base ABI if
478		the specified ABI is not available.
479
480=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
481
482The include file, <bsd.snmpmod.mk>, handles building MIB modules for bsnmpd
483from one or more source files, along with their manual pages.  It has a
484limited number of suffixes, consistent with the current needs of the BSD
485tree.
486
487bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and
488bsd.files.mk for installing MIB description and definition files.
489
490It implements the following additional targets:
491
492	smilint:
493		execute smilint on the MIBs defined by BMIBS.
494
495		The net-mgmt/libsmi package must be installed before
496		executing this target. The net-mgmt/net-snmp package
497		should be installed as well to reduce false positives
498		from smilint.
499
500It sets/uses the following variables:
501
502BMIBS		The MIB definitions to install.
503
504BMIBSDIR	The directory where the MIB definitions are installed.
505		This defaults to `${SHAREDIR}/snmp/mibs`.
506
507DEFS		The MIB description files to install.
508
509DEFSDIR		The directory where MIB description files are installed.
510		This defaults to `${SHAREDIR}/snmp/defs`.
511
512EXTRAMIBDEFS	Extra MIB description files to use as input when
513		generating ${MOD}_oid.h and ${MOD}_tree.[ch].
514
515EXTRAMIBSYMS	Extra MIB definition files used only for extracting
516		symbols.
517
518		EXTRAMIBSYMS are useful when resolving inter-module
519		dependencies and are useful with files containing only
520		enum-definitions.
521
522		See ${MOD}_oid.h for more details.
523
524LOCALBASE	The package root where smilint and the net-snmp
525		definitions can be found
526
527MOD		The bsnmpd module name.
528
529SMILINT		smilint binary to use with the smilint make target.
530
531SMILINT_FLAGS	flags to pass to smilint.
532
533SMIPATH		A colon-separated directory path where MIBs definitions
534		can be found. See "SMIPATH" in smi_config for more
535		details.
536
537XSYM		MIB names to extract symbols for. See ${MOD}_oid.h for
538		more details.
539
540It generates the following files:
541
542${MOD}_tree.c	A source file and header which programmatically describes
543${MOD}_tree.h	the MIB (type, OID name, ACCESS attributes, etc).
544
545		The files are generated via "gensnmptree -p".
546
547		See gensnmptree(1) for more details.
548
549${MOD}_oid.h	A header which programmatically describes the MIB root and
550		MIB tables.
551
552		The files are generated via "gensnmptree -e".
553
554		See gensnmptree(1) for more details.
555
556=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
557
558The include file <bsd.subdir.mk> contains the default targets for building
559subdirectories.  It has the same seven targets as <bsd.prog.mk>: all, clean,
560cleandir, depend, install, and tags.  For all of the directories listed in the
561variable SUBDIRS, the specified directory will be visited and the target made.
562There is also a default target which allows the command "make subdir" where
563subdir is any directory listed in the variable SUBDIRS.
564
565=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
566
567The include file <bsd.lib.mk> has support for building libraries.  It has the
568same seven targets as <bsd.prog.mk>: all, clean, cleandir, depend, install, and
569tags.  It has a limited number of suffixes, consistent with the current needs of
570the BSD tree.
571
572It sets/uses the following variables:
573
574LIB		The name of the library to build.  Both a shared and static
575		library will be built.  NO_PIC can be set to only build a
576		static library.
577
578LIBDIR		Target directory for libraries.
579
580LIBGRP		Library group.
581
582LIBMODE		Library mode.
583
584LIBOWN		Library owner.
585
586LIBRARIES_ONLY	Do not build or install files other than the library.
587
588LIB_CXX		The name of the library to build. It also causes
589		<bsd.lib.mk> to link the library with the
590		standard C++ library.  LIB_CXX overrides the value
591		of LIB if LIB is also set.  Both a shared and static library
592		will be built.  NO_PIC can be set to only build a static
593		library.
594
595LINKS		The list of binary links; should be full pathnames, the
596		linked-to file coming first, followed by the linked
597		file.  The files are hard-linked.  For example, to link
598		/bin/test and /bin/[, use:
599
600			LINKS=	/bin/test /bin/[
601
602LINKOWN		Owner of links created with LINKS [${LIBOWN}].
603
604LINKGRP		Group of links created with LINKS [${LIBGRP}].
605
606LINKMODE	Mode of links created with LINKS [${LIBMODE}].
607
608MAN		The manual pages to be installed. See bsd.man.mk for more
609		details.
610
611SHLIB		Like LIB but only builds a shared library.
612
613SHLIB_CXX	Like LIB_CXX but only builds a shared library.
614
615SHLIB_LDSCRIPT	Template file to generate shared library linker script.
616		If not defined, a simple symlink is created to the real
617		shared object.
618
619SRCS		List of source files to build the library.  Suffix types
620		.s, .c, and .f are supported.  Note, .s files are preferred
621		to .c files of the same name.  (This is not the default for
622		versions of make.)
623
624The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
625if it exists, as well as the include file <bsd.man.mk>.
626
627Libraries are ranlib'd before installation.
628
629=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
630
631The include file <bsd.test.mk> handles building one or more test programs
632intended to be used in the FreeBSD Test Suite under /usr/tests/.
633
634It has seven targets:
635
636	all:
637		build the test programs.
638	check:
639		runs the test programs with kyua test.
640
641		The beforecheck and aftercheck targets will be invoked, if
642		defined, to execute commands before and after the realcheck
643		target has been executed, respectively.
644
645		The devel/kyua package must be installed before invoking this
646		target.
647	clean:
648		remove the test programs and any object files.
649	cleandir:
650		remove all of the files removed by the target clean, as
651		well as .depend and tags.
652	depend:
653		make the dependencies for the source files, and store
654		them in the file .depend.
655	install:
656                install the test programs and their data files; if the
657                Makefile does not itself define the target install, the
658                targets beforeinstall and afterinstall may also be used
659                to cause actions immediately before and after the
660                install target is executed.
661	tags:
662		create a tags file for the source files.
663
664It sets/uses the following variables, among many others:
665
666ATF_TESTS_C	The names of the ATF C test programs to build.
667
668ATF_TESTS_CXX	The names of the ATF C++ test programs to build.
669
670ATF_TESTS_SH	The names of the ATF sh test programs to build.
671
672GTESTS		The names of the GoogleTest test programs to build.
673
674KYUAFILE	If 'auto' (the default), generate a Kyuafile out of the
675		test programs defined in the Makefile.  If 'yes', then a
676		manually-crafted Kyuafile must be supplied with the
677		sources.  If 'no', no Kyuafile is installed (useful for
678		subdirectories providing helper programs or data files
679		only).
680
681LOCALBASE	The --prefix for the kyua package.
682
683		The value of LOCALBASE defaults to /usr/local .
684
685NOT_FOR_TEST_SUITE
686		If defined, none of the built test programs get
687		installed under /usr/tests/ and no Kyuafile is
688		automatically generated.  Should not be used within the
689		FreeBSD source tree but is provided for the benefit of
690		third-parties.
691
692PLAIN_TESTS_C	The names of the plain (legacy) programs to build.
693
694PLAIN_TESTS_CXX	The names of the plain (legacy) test programs to build.
695
696PLAIN_TESTS_PORCH	The names of the plain (legacy) porch(1)-based
697		test programs to build.
698
699PLAIN_TESTS_SH	The names of the plain (legacy) test programs to build.
700
701TAP_PERL_INTERPRETER
702		Path to the Perl interpreter to be used for
703		TAP-compliant test programs that are written in Perl.
704		Refer to TAP_TESTS_PERL for details.
705
706TAP_TESTS_C	The names of the TAP-compliant C test programs to build.
707
708TAP_TESTS_CXX	The names of the TAP-compliant C++ test programs to
709		build.
710
711TAP_TESTS_PERL	The names of the TAP-compliant Perl test programs to
712		build.  The corresponding source files should end with
713		the .pl extension; the test program is marked as
714		requiring Perl; and TAP_PERL_INTERPRETER is used in the
715		built scripts as the interpreter of choice.
716
717TAP_TESTS_SH	The names of the TAP-compliant sh test programs to
718		build.
719
720TESTSBASE	Installation prefix for tests. Defaults to /usr/tests
721
722TESTSDIR	Path to the installed tests.  Must be a subdirectory of
723		TESTSBASE and the subpath should match the relative
724		location of the tests within the src tree.
725
726		The value of TESTSDIR defaults to
727		${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when
728		included from bin/ls/tests .
729
730TESTS_SUBDIRS	List of subdirectories containing tests into which to
731		recurse.  Differs from SUBDIR in that these directories
732		get registered into the automatically-generated
733		Kyuafile (if any).
734
735The actual building of the test programs is performed by <bsd.prog.mk>.
736Please see the documentation above for this other file for additional
737details on the behavior of <bsd.test.mk>.
738