Name Date Size #Lines LOC

..--

MakefileH A D21-Aug-20252.1 KiB10388

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

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

bsd.READMEH A D26-Aug-202524.2 KiB742532

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

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

bsd.compat.mkH A D22-Aug-20254.7 KiB184141

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

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

bsd.confs.mkH A D07-Aug-20253.8 KiB146111

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

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

bsd.debug.mkH A D21-Aug-20251.9 KiB6947

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

bsd.dirs.mkH A D07-Aug-20251.7 KiB5539

bsd.doc.mkH A D07-Aug-20254.5 KiB200134

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

bsd.endian.mkH A D16-Aug-20251.4 KiB3729

bsd.files.mkH A D07-Aug-20254 KiB148109

bsd.incs.mkH A D07-Aug-20253.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 D23-Aug-202514.3 KiB493390

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

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

bsd.links.mkH A D07-Aug-2025992 3630

bsd.man.mkH A D28-Aug-20259.8 KiB336234

bsd.mkopt.mkH A D09-Aug-20255.8 KiB197110

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

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

bsd.opts.mkH A D21-Aug-20253.6 KiB12761

bsd.own.mkH A D21-Aug-20256.7 KiB301108

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-Aug-20258.8 KiB363295

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 D21-Jul-20256 KiB211133

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 D20-Aug-20258.6 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 D14-Jul-2025632 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 D09-Aug-2025673 3827

src.libnames.mkH A D31-Jul-202525 KiB932792

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

src.opts.mkH A D20-Aug-202512.1 KiB523380

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

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