xref: /freebsd/share/mk/bsd.README (revision 4ba91e076ee84101112d8296785098ae31dac35e)
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
262The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
263it exists.
264
265=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
266
267The include file <bsd.own.mk> contains the owners, groups, etc. for both
268manual pages and binaries.
269
270It has no targets.
271
272It sets/uses the following variables:
273
274BINGRP		Binary group.
275
276BINMODE		Binary mode.
277
278BINOWN		Binary owner.
279
280MANDIR		Base path for manual installation.
281
282MANGRP		Manual group.
283
284MANMODE		Manual mode.
285
286MANOWN		Manual owner.
287
288INSTALL_LINK	Command to install a hard link.
289
290INSTALL_SYMLINK	Command to install a symbolic link.
291
292INSTALL_RSYMLINK	Command to install a relative symbolic link.
293
294LINKOWN		Owner of hard links created by INSTALL_LINK.
295
296LINKGRP		Group of hard links created by INSTALL_LINK.
297
298LINKMODE	Mode of hard links created by INSTALL_LINK.
299
300SYMLINKOWN	Owner of hard links created by INSTALL_[R]SYMLINK.
301
302SYMLINKGRP	Group of hard links created by INSTALL_[R]SYMLINK.
303
304SYMLINKMODE	Mode of hard links created by INSTALL_[R]SYMLINK.
305
306This file is generally useful when building your own Makefiles so that
307they use the same default owners etc. as the rest of the tree.
308
309=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
310
311The include file <bsd.prog.mk> handles building programs from one or
312more source files, along with their manual pages.  It has a limited number
313of suffixes, consistent with the current needs of the BSD tree.
314
315It has seven targets:
316
317	all:
318		build the program and its manual page
319	clean:
320		remove the program and any object files.
321	cleandir:
322		remove all of the files removed by the target clean, as
323		well as .depend, tags, and any manual pages.
324	depend:
325		make the dependencies for the source files, and store
326		them in the file .depend.
327	install:
328		install the program and its manual pages; if the Makefile
329		does not itself define the target install, the targets
330		beforeinstall and afterinstall may also be used to cause
331		actions immediately before and after the install target
332		is executed.
333	tags:
334		create a tags file for the source files.
335
336It sets/uses the following variables:
337
338BINGRP		Binary group.
339
340BINMODE		Binary mode.
341
342BINOWN		Binary owner.
343
344CLEANDIRS	Additional files (CLEANFILES) and directories (CLEANDIRS) to
345CLEANFILES	remove during clean and cleandir targets.  "rm -rf" and
346		"rm -f" are used, respectively.
347
348DIRS		A list of variables referring to directories.  For example:
349
350			DIRS+=	FOO
351			FOO=	/usr/share/foo
352
353		Owner, Group, Mode and Flags are handled by FOO_OWN,
354		FOO_GRP, FOO_MODE and FOO_FLAGS, respectively.
355
356		This allows FILESDIR to be set to FOO, and the directory
357		will be created before the files are installed and the
358		dependencies will be set correctly.
359
360FILES		A list of non-executable files.
361		The installation is controlled by the FILESNAME, FILESOWN,
362		FILESGRP, FILESMODE, FILESDIR variables that can be
363		further specialized by FILES<VAR>_<file>.
364
365LINKS		The list of binary links; should be full pathnames, the
366		linked-to file coming first, followed by the linked
367		file.  The files are hard-linked.  For example, to link
368		/bin/test and /bin/[, use:
369
370			LINKS=	/bin/test /bin/[
371
372LINKOWN		Owner of links created with LINKS [${BINOWN}].
373
374LINKGRP		Group of links created with LINKS [${BINGRP}].
375
376LINKMODE	Mode of links created with LINKS [${BINMODE}].
377
378
379MAN		Manual pages.  If no MAN variable is defined,
380		"MAN=${PROG}.1" is assumed. See bsd.man.mk for more details.
381
382PROG		The name of the program to build.  If not supplied, nothing
383		is built.
384
385PROGNAME	The name that the above program will be installed as, if
386		different from ${PROG}.
387
388PROG_CXX	If defined, the name of the program to build.  Also
389		causes <bsd.prog.mk> to link the program with the
390		standard C++ library.  PROG_CXX overrides the value
391		of PROG if PROG is also set.
392
393PROGS		When used with <bsd.progs.mk>, allow building multiple
394PROGS_CXX	PROG and PROG_CXX in one Makefile.  To define
395		individual variables for each program the VAR.prog
396		syntax should be used.  For example:
397
398		PROGS=		foo bar
399		SRCS.foo=	foo_src.c
400		LDADD.foo=	-lutil
401		SRCS.bar=	bar_src.c
402
403		The supported variables are:
404		- BINDIR
405		- BINGRP
406		- BINMODE
407		- BINOWN
408		- CFLAGS
409		- CXXFLAGS
410		- DEBUG_FLAGS
411		- DPADD
412		- DPSRCS
413		- INTERNALPROG (no installation)
414		- LDADD
415		- LDFLAGS
416		- LIBADD
417		- LINKS
418		- MAN
419		- MLINKS
420		- MK_WERROR=no
421		- PROGNAME
422		- SRCS
423		- STRIP
424		- WARNS
425
426SCRIPTS		A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
427		The installation is controlled by the SCRIPTSNAME, SCRIPTSOWN,
428		SCRIPTSGRP, SCRIPTSMODE, SCRIPTSDIR variables that can be
429		further specialized by SCRIPTS<VAR>_<script>.
430
431SRCS		List of source files to build the program.  If SRCS is not
432		defined, it's assumed to be ${PROG}.c or, if PROG_CXX is
433		defined, ${PROG_CXX}.cc.
434
435STRIP		The flag passed to the install program to cause the binary
436		to be stripped.  This is to be used when building your
437		own install script so that the entire system can be made
438		stripped/not-stripped using a single nob.
439
440SUBDIR		A list of subdirectories that should be built as well.
441		Each of the targets will execute the same target in the
442		subdirectories.
443
444The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
445if it exists, as well as the include file <bsd.man.mk>.
446
447Some simple examples:
448
449To build foo from foo.c with a manual page foo.1, use:
450
451	PROG=	foo
452
453	.include <bsd.prog.mk>
454
455To build foo from foo.c with a manual page foo.2, add the line:
456
457	MAN=	foo.2
458
459If foo does not have a manual page at all, add the line:
460
461	MAN=
462
463If foo has multiple source files, add the line:
464
465	SRCS=	a.c b.c c.c d.c
466
467=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
468
469The include file, <bsd.compat.mk>, allows programs (built with
470<bsd.prog.mk>) to be built for one the ABI(s) supported by the
471top-level Makefile.libcompat.  It requires that <bsd.prog.mk> also be
472included.
473
474NEED_COMPAT	Build and link targeting a compatibility ABI or fail if it
475		is not available.  Supported values are "32", "soft", and
476		"any" being a wildcard.
477
478WANT_COMPAT	Similar to NEED_COMPAT, but build with the base ABI if
479		the specified ABI is not available.
480
481=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
482
483The include file, <bsd.snmpmod.mk>, handles building MIB modules for bsnmpd
484from one or more source files, along with their manual pages.  It has a
485limited number of suffixes, consistent with the current needs of the BSD
486tree.
487
488bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and
489bsd.files.mk for installing MIB description and definition files.
490
491It implements the following additional targets:
492
493	smilint:
494		execute smilint on the MIBs defined by BMIBS.
495
496		The net-mgmt/libsmi package must be installed before
497		executing this target. The net-mgmt/net-snmp package
498		should be installed as well to reduce false positives
499		from smilint.
500
501It sets/uses the following variables:
502
503BMIBS		The MIB definitions to install.
504
505BMIBSDIR	The directory where the MIB definitions are installed.
506		This defaults to `${SHAREDIR}/snmp/mibs`.
507
508DEFS		The MIB description files to install.
509
510DEFSDIR		The directory where MIB description files are installed.
511		This defaults to `${SHAREDIR}/snmp/defs`.
512
513EXTRAMIBDEFS	Extra MIB description files to use as input when
514		generating ${MOD}_oid.h and ${MOD}_tree.[ch].
515
516EXTRAMIBSYMS	Extra MIB definition files used only for extracting
517		symbols.
518
519		EXTRAMIBSYMS are useful when resolving inter-module
520		dependencies and are useful with files containing only
521		enum-definitions.
522
523		See ${MOD}_oid.h for more details.
524
525LOCALBASE	The package root where smilint and the net-snmp
526		definitions can be found
527
528MOD		The bsnmpd module name.
529
530SMILINT		smilint binary to use with the smilint make target.
531
532SMILINT_FLAGS	flags to pass to smilint.
533
534SMIPATH		A colon-separated directory path where MIBs definitions
535		can be found. See "SMIPATH" in smi_config for more
536		details.
537
538XSYM		MIB names to extract symbols for. See ${MOD}_oid.h for
539		more details.
540
541It generates the following files:
542
543${MOD}_tree.c	A source file and header which programmatically describes
544${MOD}_tree.h	the MIB (type, OID name, ACCESS attributes, etc).
545
546		The files are generated via "gensnmptree -p".
547
548		See gensnmptree(1) for more details.
549
550${MOD}_oid.h	A header which programmatically describes the MIB root and
551		MIB tables.
552
553		The files are generated via "gensnmptree -e".
554
555		See gensnmptree(1) for more details.
556
557=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
558
559The include file <bsd.subdir.mk> contains the default targets for building
560subdirectories.  It has the same seven targets as <bsd.prog.mk>: all, clean,
561cleandir, depend, install, and tags.  For all of the directories listed in the
562variable SUBDIRS, the specified directory will be visited and the target made.
563There is also a default target which allows the command "make subdir" where
564subdir is any directory listed in the variable SUBDIRS.
565
566=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
567
568The include file <bsd.lib.mk> has support for building libraries.  It has the
569same seven targets as <bsd.prog.mk>: all, clean, cleandir, depend, install, and
570tags.  It has a limited number of suffixes, consistent with the current needs of
571the BSD tree.
572
573It sets/uses the following variables:
574
575LIB		The name of the library to build.  Both a shared and static
576		library will be built.  NO_PIC can be set to only build a
577		static library.
578
579LIBDIR		Target directory for libraries.
580
581LIBGRP		Library group.
582
583LIBMODE		Library mode.
584
585LIBOWN		Library owner.
586
587LIBRARIES_ONLY	Do not build or install files other than the library.
588
589LIB_CXX		The name of the library to build. It also causes
590		<bsd.lib.mk> to link the library with the
591		standard C++ library.  LIB_CXX overrides the value
592		of LIB if LIB is also set.  Both a shared and static library
593		will be built.  NO_PIC can be set to only build a static
594		library.
595
596LINKS		The list of binary links; should be full pathnames, the
597		linked-to file coming first, followed by the linked
598		file.  The files are hard-linked.  For example, to link
599		/bin/test and /bin/[, use:
600
601			LINKS=	/bin/test /bin/[
602
603LINKOWN		Owner of links created with LINKS [${LIBOWN}].
604
605LINKGRP		Group of links created with LINKS [${LIBGRP}].
606
607LINKMODE	Mode of links created with LINKS [${LIBMODE}].
608
609MAN		The manual pages to be installed. See bsd.man.mk for more
610		details.
611
612SHLIB		Like LIB but only builds a shared library.
613
614SHLIB_CXX	Like LIB_CXX but only builds a shared library.
615
616SHLIB_LDSCRIPT	Template file to generate shared library linker script.
617		If not defined, a simple symlink is created to the real
618		shared object.
619
620SRCS		List of source files to build the library.  Suffix types
621		.s, .c, and .f are supported.  Note, .s files are preferred
622		to .c files of the same name.  (This is not the default for
623		versions of make.)
624
625The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
626if it exists, as well as the include file <bsd.man.mk>.
627
628Libraries are ranlib'd before installation.
629
630=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
631
632The include file <bsd.test.mk> handles building one or more test programs
633intended to be used in the FreeBSD Test Suite under /usr/tests/.
634
635It has seven targets:
636
637	all:
638		build the test programs.
639	check:
640		runs the test programs with kyua test.
641
642		The beforecheck and aftercheck targets will be invoked, if
643		defined, to execute commands before and after the realcheck
644		target has been executed, respectively.
645
646		The devel/kyua package must be installed before invoking this
647		target.
648	clean:
649		remove the test programs and any object files.
650	cleandir:
651		remove all of the files removed by the target clean, as
652		well as .depend and tags.
653	depend:
654		make the dependencies for the source files, and store
655		them in the file .depend.
656	install:
657                install the test programs and their data files; if the
658                Makefile does not itself define the target install, the
659                targets beforeinstall and afterinstall may also be used
660                to cause actions immediately before and after the
661                install target is executed.
662	tags:
663		create a tags file for the source files.
664
665It sets/uses the following variables, among many others:
666
667ATF_TESTS_C	The names of the ATF C test programs to build.
668
669ATF_TESTS_CXX	The names of the ATF C++ test programs to build.
670
671ATF_TESTS_SH	The names of the ATF sh test programs to build.
672
673GTESTS		The names of the GoogleTest test programs to build.
674
675KYUAFILE	If 'auto' (the default), generate a Kyuafile out of the
676		test programs defined in the Makefile.  If 'yes', then a
677		manually-crafted Kyuafile must be supplied with the
678		sources.  If 'no', no Kyuafile is installed (useful for
679		subdirectories providing helper programs or data files
680		only).
681
682LOCALBASE	The --prefix for the kyua package.
683
684		The value of LOCALBASE defaults to /usr/local .
685
686NOT_FOR_TEST_SUITE
687		If defined, none of the built test programs get
688		installed under /usr/tests/ and no Kyuafile is
689		automatically generated.  Should not be used within the
690		FreeBSD source tree but is provided for the benefit of
691		third-parties.
692
693PLAIN_TESTS_C	The names of the plain (legacy) programs to build.
694
695PLAIN_TESTS_CXX	The names of the plain (legacy) test programs to build.
696
697PLAIN_TESTS_PORCH	The names of the plain (legacy) porch(1)-based
698		test programs to build.
699
700PLAIN_TESTS_SH	The names of the plain (legacy) test programs to build.
701
702TAP_PERL_INTERPRETER
703		Path to the Perl interpreter to be used for
704		TAP-compliant test programs that are written in Perl.
705		Refer to TAP_TESTS_PERL for details.
706
707TAP_TESTS_C	The names of the TAP-compliant C test programs to build.
708
709TAP_TESTS_CXX	The names of the TAP-compliant C++ test programs to
710		build.
711
712TAP_TESTS_PERL	The names of the TAP-compliant Perl test programs to
713		build.  The corresponding source files should end with
714		the .pl extension; the test program is marked as
715		requiring Perl; and TAP_PERL_INTERPRETER is used in the
716		built scripts as the interpreter of choice.
717
718TAP_TESTS_SH	The names of the TAP-compliant sh test programs to
719		build.
720
721TESTSBASE	Installation prefix for tests. Defaults to /usr/tests
722
723TESTSDIR	Path to the installed tests.  Must be a subdirectory of
724		TESTSBASE and the subpath should match the relative
725		location of the tests within the src tree.
726
727		The value of TESTSDIR defaults to
728		${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when
729		included from bin/ls/tests .
730
731TESTS_SUBDIRS	List of subdirectories containing tests into which to
732		recurse.  Differs from SUBDIR in that these directories
733		get registered into the automatically-generated
734		Kyuafile (if any).
735
736The actual building of the test programs is performed by <bsd.prog.mk>.
737Please see the documentation above for this other file for additional
738details on the behavior of <bsd.test.mk>.
739