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