1# $NetBSD: bsd.README,v 1.462 2025/12/28 18:43:25 thorpej Exp $
2# @(#)bsd.README 8.2 (Berkeley) 4/2/94
3
4This is the README file for the make "include" files for the NetBSD
5source tree. The files are installed in /usr/share/mk, and are,
6by convention, named with the suffix ".mk".
7
8Other sources of relevant documentation are BUILDING in the top
9level of the NetBSD source tree, and the mk.conf(5) man page.
10
11Note: this file is not intended to replace reading through the .mk
12files for anything tricky.
13
14=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
15
16RANDOM THINGS WORTH KNOWING:
17
18The files are simply C-style #include files, and pretty much behave like
19you'd expect. The syntax is slightly different in that a single '.' is
20used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
21
22One difference that will save you lots of debugging time is that inclusion
23of the file is normally done at the *end* of the Makefile. The reason for
24this is because .mk files often modify variables and behavior based on the
25values of variables set in the Makefile. To make this work, remember that
26the FIRST target found is the target that is used, i.e. if the Makefile has:
27
28 a:
29 echo a
30 a:
31 echo a number two
32
33the command "make a" will echo "a". To make things confusing, the SECOND
34variable assignment is the overriding one, i.e. if the Makefile has:
35
36 a= foo
37 a= bar
38
39 b:
40 echo ${a}
41
42the command "make b" will echo "bar". This is for compatibility with the
43way the V7 make behaved.
44
45It's fairly difficult to make the BSD .mk files work when you're building
46multiple programs in a single directory. It's a lot easier to split up the
47programs than to deal with the problem. Most of the agony comes from making
48the "obj" directory stuff work right, not because we switched to a new version
49of make. So, don't get mad at us, figure out a better way to handle multiple
50architectures so we can quit using the symbolic link stuff. (Imake doesn't
51count.)
52
53The file .depend in the source directory is expected to contain dependencies
54for the source files. This file is read automatically by make after reading
55the Makefile.
56
57The variable DESTDIR works as before. It's not set anywhere but will change
58the tree where the file gets installed.
59
60The profiled libraries are no longer built in a different directory than
61the regular libraries. A new suffix, ".po", is used to denote a profiled
62object, and ".pico" denotes a shared (position-independent) object.
63
64There are various make variables used during the build.
65
66Many variables support a (case sensitive) value of "no" or "yes",
67and are tested with ${VAR} == "no" and ${VAR} != "no" .
68
69
70The basic rule for the variable naming scheme is as follows:
71
72HOST_<cmd> A command that runs on the host machine regardless of
73 whether or not the system is being cross compiled, or
74 options for such a command.
75
76MK<feature> Can be set to "no" to disable feature <feature>,
77 or "yes" to enable feature <feature>.
78 Usually defaults to "yes", although some variables
79 default to "no".
80 Due to make(1) implementation issues, if a temporary
81 command-line override of a mk.conf(5) or <bsd.own.mk>
82 setting is required whilst still honoring a particular
83 Makefile's setting of MK<feature>, use
84 env MK<feature>=value make
85 instead of
86 make MK<feature>=value
87
88NO<feature> If defined, disables feature <feature>, overriding
89 a user's MK<feature>=yes configuration.
90 Not intended for users.
91 This is to allow Makefiles to disable functionality
92 that they don't support (such as missing man pages).
93 NO<feature> variables must be defined before <bsd.own.mk>
94 is included, which generally means define before
95 any <*.mk> is included.
96 See "Variables for a Makefile".
97
98TOOL_<tool> A tool that is provided as part of the USETOOLS
99 framework. When not using the USETOOLS framework,
100 TOOL_<tool> variables should refer to tools that are
101 already installed on the host system.
102
103Various mk.conf(5) variables control the NetBSD system build.
104These should not be set by Makefiles; they're for the user to define
105in MAKECONF (see mk.conf(5) or <bsd.own.mk> documented below) or on
106the make(1) command line.
107
108The supported mk.conf(5) make variables are:
109
110 BSDOBJDIR, BSDSRCDIR, BUILD, BUILDID, BUILDINFO, BUILDSEED,
111 CDEXTRA, CONFIGOPTS, COPTS, CPUFLAGS, DESTDIR, EXTERNAL_TOOLCHAIN,
112 INSTALLBOOT_BOARDS, INSTALLWORLDDIR, KERNARCHDIR, KERNCONFDIR,
113 KERNEL_DIR, KERNOBJDIR, KERNSRCDIR, LOCALTIME, MAKEVERBOSE,
114 MKADOSFS, MKAUTOFS, MKAMDGPUFIRMWARE, MKARGON2, MKARZERO, MKATF,
115 MKAUDIO, MKBIND, MKBINUTILS, MKBLUETOOTH, MKBSDGREP, MKBSDTAR,
116 MKCATPAGES, MKCD9660FS, MKCHFS, MKCLEANSRC, MKCLEANVERIFY, MKCOMPAT,
117 MKCOMPATMODULES, MKCOMPATTESTS, MKCOMPATX11, MKCOMPLEX, MKCROSSGDB,
118 MKCTF, MKCVS, MKCXX, MKDEBUG, MKDEBUGKERNEL, MKDEBUGLIB, MKDEBUGTOOLS,
119 MKDEPINCLUDES, MKDOC, MKDTB, MKDTC, MKDTRACE, MKDYNAMICROOT, MKEFS,
120 MKEXT2FS, MKFDESCFS, MKFIDO2, MKFILECOREFS, MKFIRMWARE, MKGCC,
121 MKGCCCMDS, MKGDB, MKGROFF, MKGROFFHTMLDOC, MKHESIOD, MKHFS, MKKERNFS,
122 MKHOSTOBJ, MKHTML, MKIEEEFP, MKINET6, MKINFO, MKIPFILTER, MKIPSEC,
123 MKISCSI, MKKERBEROS, MKKMOD, MKKYUA, MKLDAP, MKLFS, MKLIBCSANITIZER,
124 MKLIBCXX, MKLIBSTDCXX, MKLINKLIB, MKLINT, MKLLVM, MKLLVMRT, MKLVM,
125 MKMAKEMANDB, MKMAN, MKMANDOC, MKMANZ, MKMDNS, MKMSDOSFS, MKNFS, MKNLS,
126 MKNILFS, MKNOUVEAUFIRMWARE, MKNPF, MKNSD, MKNTFS, MKNULLFS, MKOBJ,
127 MKOBJDIRS, MKOVERLAYFS, MKPAM, MKPCC, MKPF, MKPIC, MKPICINSTALL,
128 MKPICLIB, MKPIE, MKPIGZGZIP, MKPOSTFIX, MKPROCFS, MKPROFILE, MKPTYFS,
129 MKQEMUFWCFG, MKRADEONFIRMWARE, MKRELRO, MKREPRO, MKREPRO_TIMESTAMP,
130 MKRUMP, MKSANITIZER, MKSHARE, MKSKEY, MKSLJIT, MKSOFTFLOAT, MKSSH,
131 MKSTATICLIB, MKSTATICPIE, MKSTRIPIDENT, MKSTRIPSYM, MKSYSVBFS,
132 MKTEGRAFIRMWARE, MKTMPFS, MKTPM, MKUDF, MKUMAPFS, MKUNBOUND, MKUNIONFS,
133 MKUNPRIVED, MKUPDATE, MKUSB, MKV7FS, MKWLAN, MKX11, MKX11FONTS,
134 MKX11MOTIF, MKXORG_SERVER, MKYP, MKZFS, NETBSDSRCDIR,
135 NETBSD_OFFICIAL_RELEASE, NOCLEANDIR, NODISTRIBDIRS, NOINCLUDES,
136 OBJMACHINE, RELEASEDIR, RUMPUSER_THREADS, RUMP_CURLWP, RUMP_DEBUG,
137 RUMP_DIAGNOSTIC, RUMP_KTRACE, RUMP_LOCKDEBUG, RUMP_LOCKS_UP,
138 RUMP_NBCOMPAT, RUMP_VIRTIF, RUMP_VNODE_LOCKDEBUG, TOOLCHAIN_MISSING,
139 TOOLDIR, USETOOLS, USE_FORT, USE_HESIOD, USE_INET6, USE_JEMALLOC,
140 USE_KERBEROS, USE_LDAP, USE_LIBCSANITIZER, USE_PAM, USE_PIGZGZIP,
141 USE_SANITIZER, USE_SKEY, USE_SSP, USE_XZ_SETS, USE_YP, X11MOTIFPATH,
142 X11SRCDIR.
143
144The obsolete mk.conf(5) make variables are:
145
146 EXTSRCSRCDIR, MKBFD, MKCRYPTO, MKEXTSRC, MKKDEBUG, MKKERBEROS4,
147 MKLLD, MKLLDB, MKMCLINKER, MKPERFUSE, MKTOOLSDEBUG, NBUILDJOBS,
148 SHAREDSTRINGS, USE_COMBINE, USE_NEW_TOOLCHAIN.
149
150Notable variables documented in mk.conf(5) and duplicated here:
151
152DESTDIR Directory to contain the built NetBSD system. If set,
153 special options are passed to the compilation tools to
154 prevent their default use of the host system's
155 /usr/include, /usr/lib, and so forth. This pathname must
156 be an absolute path, and should not end with a slash (/)
157 character. (For installation into the system's root
158 directory, set DESTDIR to an empty string, not to "/").
159 The directory must reside on a file system which supports
160 long file names and hard links.
161
162 Note: build.sh will provide a default of
163 "destdir.MACHINE" (in the top-level .OBJDIR) unless run
164 in `expert' mode with the -E option.
165
166 Default: Empty string if USETOOLS=yes; otherwise unset.
167
168RELEASEDIR If set, specifies the directory to which a release(7)
169 layout will be written at the end of a "make release".
170 If specified, must be an absolute path.
171
172 Note: build.sh will provide a default of "releasedir" (in
173 the top-level .OBJDIR) unless run in `expert' mode with
174 the -E option.
175
176 Default: Unset.
177
178COPTS.lib<lib>
179OBJCOPTS.lib<lib>
180LDADD.lib<lib>
181CPPFLAGS.lib<lib>
182CXXFLAGS.lib<lib>
183COPTS.<prog>
184OBJCOPTS.<prog>
185LDADD.<prog>
186CPPFLAGS.<prog>
187CXXFLAGS.<prog> These provide a way to specify additions to the associated
188 variables in a way that applies only to a particular library
189 or program. <lib> corresponds to the LIB variable set in
190 the library's makefile. <prog> corresponds to either PROG
191 or PROG_CXX (if set). For example, if COPTS.libcrypto is
192 set to "-g", "-g" will be added to COPTS only when compiling
193 the crypto library.
194 See bsd.prog.mk below for more details about these variables.
195
196The active compiler is selected using the following variables:
197AVAILABLE_COMPILER
198 List of available compiler suites. Processed in order
199 for selecting the active compiler for each frontend.
200HAVE_PCC If defined, PCC is present and enabled.
201HAVE_LLVM If defined, LLVM/Clang is present and enabled.
202UNSUPPORTED_COMPILER.<comp>
203 If defined, the support for compiler <comp> is disabled.
204
205For the frontends (CC, CPP, CXX, FC and OBJC) the following variables exist:
206ACTIVE_CC Active compile suite for the CC frontend.
207SUPPORTED_CC Compile suite with support for the CC frontend.
208TOOL_CC.<comp> Path to the CC frontend for compiler <comp>.
209
210
211=-=-=-=-= Variables for a Makefile =-=-=-=-=
212
213If the following varialbes are defined in the Makefile before
214any make(1) .include directives, they force the specific behavior.
215
216NOCOMPAT Force MKCOMPAT=no.
217NOCTF Force MKCTF=no.
218NODEBUG Force MKDEBUG=no.
219NODEBUGLIB Force MKDEBUGLIB=no.
220NODOC Force MKDOC=no.
221NOFORT Force USE_FORT=no.
222NOHTML Force MKHTML=no.
223NOINFO Force MKINFO=no.
224NOLIBCSANITIZER Force MKLIBCSANITIZER=no (and USE_LIBCSANITIZER=no)
225NOLINKLIB Force MKLINKLIB=no.
226NOLINT Force MKLINT=no.
227NOMAN Force MKMAN=no.
228NOMANDOC Force MKMANDOC=no.
229NONLS Force MKNLS=no.
230NOOBJ Force MKOBJ=no.
231NOPIC Force MKPIC=no.
232NOPICINSTALL Force MKPICINSTALL=no.
233NOPIE Force MKPIE=no.
234NOPROFILE Force MKPROFILE=no.
235NORELRO Force MKREPRO=no.
236NOSANITIZER Force MKSANITIZER=no (and USE_SANITIZER=no)
237NOSHARE Force MKSHARE=no.
238NOSSP Force USE_SSP=no.
239NOSTATICLIB Force MKSTATICLIB=no.
240
241Special variations:
242
243NOFULLRELRO!=no Force MKRELRO=no if MKRELRO=full
244
245TODO: NOFULLRELRO should just be a defined test for consistency.
246
247
248=-=-=-=-= sys.mk =-=-=-=-=
249
250The include file <sys.mk> has the default rules for all makes, in the BSD
251environment or otherwise. You probably don't want to touch this file.
252
253=-=-=-=-= bsd.own.mk =-=-=-=-=
254
255The include file <bsd.own.mk> contains source tree configuration parameters,
256such as the owners, groups, etc. for both manual pages and binaries, and
257a few global "feature configuration" parameters.
258
259It has no targets.
260
261To get system-specific configuration parameters, <bsd.own.mk> will try to
262include the mk.conf(5) file specified by the MAKECONF variable, which may
263be either set in the environment or provided on the make(1) command line.
264MAKECONF defaults to /etc/mk.conf. mk.conf(5) may define any of the
265variables described below.
266
267<bsd.own.mk> sets the following variables, if they are not already defined
268(defaults are in brackets):
269
270NETBSDSRCDIR The path to the top level of the NetBSD sources.
271 If _SRC_TOP_ != "", that will be used as the default,
272 otherwise BSDSRCDIR will be used as the default.
273 Various makefiles within the NetBSD source tree will
274 use this to reference the top level of the source tree.
275 Default: Top level of the NetBSD source tree (as
276 determined by the presence of build.sh and tools/) if
277 make(1) is run from within that tree; otherwise BSDSRCDIR
278 will be used.
279
280_SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
281 based on the presence of tools/ and build.sh. This variable
282 is "internal" to <bsd.own.mk>, although its value is only
283 determined once and then propagated to all sub-makes.
284
285_NETBSD_VERSION_DEPENDS
286 A list of files which contain information about
287 the version of the NetBSD being built. This is
288 defined only if the current directory appears
289 to be inside a NetBSD source tree. The list of
290 files includes ${NETBSDSRCDIR}/sys/sys/param.h
291 (which contains the kernel version number),
292 ${NETBSDSRCDIR}/sys/conf/newvers.sh and
293 ${NETBSDSRCDIR}/sys/conf/osrelease.sh (which
294 interpret the information in sys/sys/param.h), and
295 ${_SRC_TOP_OBJ_}/params (which is an optional file,
296 created by "make build" in ${_SRC_TOP_}/Makefile,
297 containing all the variables that may influence the
298 build).
299
300 Targets that depend on the NetBSD version, or on
301 variables defined at build time, can declare a
302 dependency on ${_NETBSD_VERSION_DEPENDS}, like this:
303
304 version.c: ${_NETBSD_VERSION_DEPENDS}
305 commands to create version.c
306
307BSDSRCDIR The real path to the NetBSD source tree, if NETBSDSRCDIR
308 isn't defined.
309 Default: "/usr/src".
310
311BSDOBJDIR The real path to the object directory tree for the NetBSD
312 source tree.
313 Default: "/usr/obj".
314
315BINGRP Binary group. [wheel]
316
317BINOWN Binary owner. [root]
318
319BINMODE Binary mode. [555]
320
321NONBINMODE Mode for non-executable files. [444]
322
323MANDIR Base path for manual installation. [/usr/share/man/cat]
324
325MANGRP Manual group. [wheel]
326
327MANOWN Manual owner. [root]
328
329MANMODE Manual mode. [${NONBINMODE}]
330
331MANINSTALL Manual installation type. Space separated list:
332 catinstall, htmlinstall, maninstall
333 Default value derived from MKCATPAGES and MKHTML.
334
335MAKELINKLIB Defaults to ${MKLINKLIB} but can be overridden by Makefiles
336
337MAKESTATICLIB Defaults to ${MKSTATICLIB} but can be overridden by Makefiles
338
339LDSTATIC Control program linking; if set blank, link everything
340 dynamically. If set to "-static", link everything statically.
341 If not set, programs link according to their makefile.
342
343LIBDIR Base path for library installation. [/usr/lib]
344
345LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
346
347LIBGRP Library group. [${BINGRP}]
348
349LIBOWN Library owner. [${BINOWN}]
350
351LIBMODE Library mode. [${NONBINMODE}]
352
353LINKINSTALL Install libraries used by users to link against (.a/.so)
354 defaults to ${MAKELINKLIB}
355
356DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
357 installation. [/usr/share/doc]
358
359DOCGRP Documentation group. [wheel]
360
361DOCOWN Documentation owner. [root]
362
363DOCMODE Documentation mode. [${NONBINMODE}]
364
365GZIP_N_FLAG Options to pass to TOOL_GZIP to prevent it from inserting
366 file names or timestamps in the compressed output.
367 [-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
368
369NLSDIR Base path for Native Language Support files installation.
370 [/usr/share/nls]
371
372NLSGRP Native Language Support files group. [wheel]
373
374NLSOWN Native Language Support files owner. [root]
375
376NLSMODE Native Language Support files mode. [${NONBINMODE}]
377
378X11SRCDIR Directory containing the modular Xorg source. If
379 specified, must be an absolute path. The main modular
380 Xorg source is found in ${X11SRCDIR}/external/mit.
381
382 Default: ${NETBSDSRCDIR}/../xsrc, if that exists; otherwise
383 "/usr/xsrc".
384
385X11SRCDIR.local The path to the local X11 src tree. [${X11SRCDIR}/local]
386
387X11SRCDIR.lib<package>
388X11SRCDIR.<package>
389 The path to the xorg src tree for the specified package>.
390 [${X11SRCDIR}/external/mit/xorg/<package>/dist]
391
392X11ROOTDIR Root directory of the X11 installation. [/usr/X11R7]
393
394X11BINDIR X11 bin directory. [${X11ROOTDIR}/bin]
395
396X11FONTDIR X11 font directory. [${X11ROOTDIR}/lib/X11/fonts]
397
398X11INCDIR X11 include directory. [${X11ROOTDIR}/include]
399
400X11LIBDIR X11 lib/x11 (config) directory. [${X11ROOTDIR}/lib/X11]
401
402X11MANDIR X11 manual directory. [${X11ROOTDIR}/man]
403
404X11USRLIBDIR X11 library directory. [${X11ROOTDIR}/lib]
405
406STRIPFLAG The option passed to the install program to cause the binary
407 to be stripped. This is to be used when building your
408 own install script so that the entire system can be made
409 stripped/not-stripped using a single knob. []
410
411COPY The option passed to the install program to cause the binary
412 to be copied rather than moved. This is to be used when
413 building our own install script so that the entire system
414 can either be installed with copies, or with moves using
415 a single knob. [-c]
416
417MAKEDIRTARGETENV
418 Environment variables passed to the child make process
419 invoked by MAKEDIRTARGET.
420
421MAKEDIRTARGET dir target [params]
422 Runs "cd $${dir} && ${MAKE} [params] $${target}",
423 displaying a "pretty" message whilst doing so.
424
425RELEASEMACHINEDIR
426 Subdirectory used below RELEASEDIR when building
427 a release. [${MACHINE},
428 or ${MACHINE}-${MACHINE_ARCH} for evb{arm,mips,sh3}*]
429
430RELEASEMACHINE Subdirectory or path component used for the following
431 paths:
432 distrib/${RELEASEMACHINE}
433 distrib/notes/${RELEASEMACHINE}
434 etc/etc.${RELEASEMACHINE}
435 Used when building a release. [${MACHINE}]
436
437Additionally, the following variables may be set by <bsd.own.mk> or in a
438make configuration file to modify the behavior of the system build
439process (default values are in brackets along with comments, if set by
440<bsd.own.mk>):
441
442USETOOLS Can be set to "yes" or "no". Indicates whether the tools
443 specified by ${TOOLDIR} should be used as part of a build in
444 progress. Must be set to "yes" if cross-compiling.
445 Supported values:
446
447 yes Use the tools from TOOLDIR.
448
449 no Do not use the tools from TOOLDIR, but refuse to
450 build native compilation tool components that are
451 version-specific for that tool.
452
453 never Do not use the tools from TOOLDIR, even when
454 building native tool components. This is similar to
455 the traditional NetBSD build method, but does not
456 verify that the compilation tools in use are
457 up-to-date enough in order to build the tree
458 successfully. This may cause build or runtime
459 problems when building the whole NetBSD source tree.
460
461 Default: "no" when using <bsd.*.mk> outside the NetBSD
462 source tree (detected automatically) or if
463 TOOLCHAIN_MISSING=yes; otherwise "yes".
464
465OBJECT_FMT Object file format. [set to "ELF" on architectures that
466 use ELF -- currently all architectures].
467
468TOOLCHAIN_MISSING
469 Can be set to "yes" or "no". If not "no", this
470 indicates that the platform "MACHINE_ARCH" being built
471 does not have a working in-tree toolchain.
472 If the ${MACHINE_ARCH} in question falls into this category,
473 TOOLCHAIN_MISSING is conditionally assigned the value "yes".
474 Otherwise, the variable is unconditionally assigned the
475 value "no".
476
477 If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no.
478
479 Default: "no".
480
481EXTERNAL_TOOLCHAIN
482 This variable is not directly set by <bsd.own.mk>, but
483 including <bsd.own.mk> is the canonical way to gain
484 access to this variable. The variable should be defined
485 either in the user's environment or in the user's mk.conf(5)
486 file.
487
488 If defined, this variable indicates the root directory of
489 an external toolchain which will be used to build the
490 tree. For example, if a platform is a ${TOOLCHAIN_MISSING}
491 platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
492 cross-compile framework.
493
494 If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since
495 the external version of the compiler may not be able to build
496 the library components of the in-tree compiler.
497
498 This variable should be used in conjunction with an
499 appropriate HAVE_GCC or HAVE_LLVM setting to control the
500 compiler options.
501
502 Note: This variable is not yet used in as many places as
503 it should be. Expect the exact semantics of this variable
504 to change in the short term as parts of the cross-compile
505 framework continue to be cleaned up.
506
507The following variables are defined to commands to perform the
508appropriate operation, with the default in [brackets]. Note that
509the defaults change if USETOOLS == "yes":
510
511TOOL_AMIGAAOUT2BB aout to Amiga bootblock converter. [amiga-aout2bb]
512
513TOOL_AMIGAELF2BB ELF to Amiga bootblock converter. [amiga-elf2bb]
514
515TOOL_AMIGATXLT Amiga assembly language format translator. [amiga-txlt]
516
517TOOL_ARMELF2AOUT ELF to a.out executable converter [arm-elf2aout}
518
519TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile]
520
521TOOL_AWK Pattern-directed scanning/processing language. [awk]
522
523TOOL_CAP_MKDB Create capability database. [cap_mkdb]
524
525TOOL_CAT Concatenate and print files. [cat]
526
527TOOL_CKSUM Display file checksums. [cksum]
528
529TOOL_COMPILE_ET Error table compiler. [compile_et]
530
531TOOL_CONFIG Build kernel compilation directories. [config]
532
533TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen]
534
535TOOL_CTAGS Create a tags file. [ctags]
536
537TOOL_DB Manipulate db(3) databases. [db]
538
539TOOL_DISKLABEL Read and write disk pack label. [disklabel]
540
541TOOL_EQN Format equations for groff. [eqn]
542
543TOOL_FDISK MS-DOS partition maintenance program. [fdisk]
544
545TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen]
546
547TOOL_GENASSYM Generate constants for assembly files. [genassym]
548
549TOOL_GENCAT Generate NLS message catalogs. [gencat]
550
551TOOL_GMAKE GNU make utility. [gmake]
552
553TOOL_GREP Print lines matching a pattern. [grep]
554
555TOOL_GROFF Front end for groff document formatting system. [groff]
556
557TOOL_GZIP Compression/decompression tool. [gzip]
558
559TOOL_GZIP_N Same as TOOL_GZIP, plus a command line option to
560 prevent it from inserting file names or timestamps
561 into the compressed output.
562 [${TOOL_GZIP} ${GZIP_N_FLAG}]
563
564TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump]
565
566TOOL_HP300MKBOOT Make bootable image for hp300. [hp300-mkboot]
567
568TOOL_HPPAMKBOOT Make bootable image for hppa. [hppa-mkboot]
569
570TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib]
571
572TOOL_INSTALLBOOT Install disk bootstrap software. [installboot]
573
574TOOL_INSTALL_INFO Update info/dir entries. [install-info]
575
576TOOL_JOIN Relational database operator. [join]
577
578TOOL_M4 M4 macro language processor. [m4]
579
580TOOL_M68KELF2AOUT ELF to a.out executable converter [m68k-elf2aout}
581
582TOOL_MACPPCFIXCOFF Fix up xcoff headers for macppc. [macppc-fixcoff]
583
584TOOL_MAKEFS Create file system image from directory tree. [makefs]
585
586TOOL_MAKEINFO Translate Texinfo documents. [makeinfo]
587
588TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis]
589
590TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage]
591
592TOOL_MENUC Menu compiler. [menuc]
593
594TOOL_MIPSELF2ECOFF Convert ELF-format executable to ECOFF for mips.
595 [mips-elf2ecoff]
596
597TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper]
598
599TOOL_MKESDB Make encoding scheme database. [mkesdb]
600
601TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale]
602
603TOOL_MKMAGIC Create database for file(1). [file]
604
605TOOL_MKNOD Make device special file. [mknod]
606
607TOOL_MKTEMP Make (unique) temporary file name. [mktemp]
608
609TOOL_MSGC Simple message list compiler. [msgc]
610
611TOOL_MTREE Map a directory hierarchy. [mtree]
612
613TOOL_NCDCS Turn ELF kernel into a NCD firmware image. [ncdcs]
614
615TOOL_PAX Manipulate file archives and copy directories. [pax]
616
617TOOL_PIC Compile pictures for groff. [pic]
618
619TOOL_PIGZ Parallel compressor. [pigz]
620
621TOOL_POWERPCMKBOOTIMAGE Make bootable image for powerpc. [powerpc-mkbootimage]
622
623TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb]
624
625TOOL_REFER Preprocess bibliographic references for groff. [refer]
626
627TOOL_ROFF_ASCII Generate ASCII groff output. [nroff]
628
629TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi]
630
631TOOL_ROFF_HTML Generate HTML groff output.
632 [${TOOL_GROFF} -Tlatin1 -mdoc2html]
633
634TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps]
635
636TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z]
637
638TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen]
639
640TOOL_SED Stream editor. [sed]
641
642TOOL_SOELIM Eliminate .so's from groff input. [soelim]
643
644TOOL_SPARKCRC Generate a crc suitable for use in a sparkive file.
645 [sparkcrc]
646
647TOOL_STAT Display file status. [stat]
648
649TOOL_STRFILE Create a random access file for storing strings.
650 [strfile]
651
652TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel]
653
654TOOL_TBL Format tables for groff. [tbl]
655
656TOOL_UUDECODE Uudecode a binary file. [uudecode]
657
658TOOL_VAXMOPCOPY Creates a MOP image from another executable format.
659 [vax-mopcopy]
660
661TOOL_VGRIND Grind nice listings of programs. [vgrind -f]
662
663TOOL_ZIC Time zone compiler. [zic]
664
665For each possible value of MACHINE_CPU, MACHINES.${MACHINE_CPU} contain a
666list of what ports can be built for it. This keeps those definitions in
667centralized place.
668
669<bsd.own.mk> is generally useful when building your own Makefiles so that
670they use the same default owners etc. as the rest of the tree.
671
672
673=-=-=-=-= bsd.clean.mk =-=-=-=-=
674
675The include file <bsd.clean.mk> defines the clean and cleandir
676targets. It uses the following variables:
677
678CLEANFILES Files to remove for both the clean and cleandir targets.
679
680CLEANDIRFILES Files to remove for the cleandir target, but not for
681 the clean target.
682
683MKCLEANSRC Controls whether or not the clean and cleandir targets
684 will delete files from both the object directory,
685 ${.OBJDIR}, and the source directory, ${.CURDIR}.
686
687 If MKCLEANSRC is set to "no", then the file names in
688 CLEANFILES or CLEANDIRFILES are interpreted relative
689 to the object directory, ${.OBJDIR}. This is the
690 traditional behaviour.
691
692 If MKCLEANSRC is set to "yes", then the file deletion
693 is performed relative to both the object directory,
694 ${.OBJDIR}, and the source directory, ${.CURDIR}. (This
695 has no effect if ${.OBJDIR} is the same as ${.CURDIR}.)
696 Deleting files from ${.CURDIR} is intended to remove
697 stray output files that had been left in the source
698 directory by an earlier build that did not use object
699 directories.
700
701 The default is MKCLEANSRC=yes. If you always build with
702 separate object directories, and you are sure that there
703 are no stray files in the source directories, then you
704 may set MKCLEANSRC=no to save some time.
705
706MKCLEANVERIFY Controls whether or not the clean and cleandir targets
707 will verify that files have been deleted.
708
709 If MKCLEANVERIFY is set to "no", then the files will
710 be deleted using a "rm -f" command, and its success or
711 failure will be ignored.
712
713 If MKCLEANVERIFY is set to "yes", then the success of
714 the "rm -f" command will be verified using an "ls"
715 command.
716
717 The default is MKCLEANVERIFY=yes. If you are sure that
718 there will be no problems caused by file permissions,
719 read-only file systems, or the like, then you may set
720 MKCLEANVERIFY=no to save some time.
721
722To use the clean and cleandir targets defined in <bsd.clean.mk>, other
723Makefiles or bsd.*.mk files should append file names to the CLEANFILES
724or CLEANDIRFILES variables. For example:
725
726 CLEANFILES+= a.out
727 CLEANDIRFILES+= .depend
728
729 .include <bsd.clean.mk>
730
731The files listed in CLEANFILES and CLEANDIRFILES must not be
732directories, because the potential risk from running "rm -rf" commands
733in bsd.clean.mk is considered too great. If you want to recursively
734delete a directory as part of "make clean" or "make cleandir" then you
735need to provide your own target.
736
737=-=-=-=-= bsd.dep.mk =-=-=-=-=
738
739The include file <bsd.dep.mk> contains the default targets for building
740.depend files. It creates .d files from entries in SRCS and DPSRCS
741that are C, C++, or Objective C source files, and builds .depend from the
742.d files. All other files in SRCS and all of DPSRCS will be used as
743dependencies for the .d files. In order for this to function correctly,
744it should be .included after all other .mk files and directives that may
745modify SRCS or DPSRCS. It uses the following variables:
746
747SRCS List of source files to build the program.
748
749DPSRCS List of source files which are needed for generating
750 dependencies, but are not needed in ${SRCS}.
751
752NODPSRCS TODO
753
754=-=-=-=-= bsd.files.mk =-=-=-=-=
755
756The include file <bsd.files.mk> handles the FILES variables and is included
757from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
758
759FILES The list of files to install.
760
761CONFIGFILES Similar semantics to FILES, except that the files
762 are installed by the `configinstall' target,
763 not the `install' target.
764 The FILES* variables documented below also apply.
765
766FILESOWN File owner. [${BINOWN}]
767
768FILESGRP File group. [${BINGRP}]
769
770FILESMODE File mode. [${NONBINMODE}]
771
772FILESDIR The location to install the files.
773
774FILESNAME Optional name to install each file as.
775
776FILESOWN_<fn> File owner of the specific file <fn>.
777
778FILESGRP_<fn> File group of the specific file <fn>.
779
780FILESMODE_<fn> File mode of the specific file <fn>.
781
782FILESDIR_<fn> The location to install the specific file <fn>.
783
784FILESNAME_<fn> Optional name to install <fn> as.
785
786FILESBUILD If this variable is defined, then its value will be
787 used as the default for all FILESBUILD_<fn> variables.
788 Otherwise, the default will be "no".
789
790FILESBUILD_<fn> A value different from "no" will add the file to the list of
791 targets to be built by `realall'. Users of that variable
792 should provide a target to build the file.
793
794
795BUILDSYMLINKS List of two word items:
796 lnsrc lntgt
797 For each lnsrc item, create a symlink named lntgt.
798 The lntgt symlinks are removed by the cleandir target.
799
800UUDECODE_FILES List of files which are stored as <file>.uue in the source
801 tree. Each one will be decoded with ${TOOL_UUDECODE}.
802 The source files have a `.uue' suffix, the generated files do
803 not.
804
805UUDECODE_FILES_RENAME_<fn>
806 Rename the output from the decode to the provided name.
807
808 Note: These files are simply decoded, with no install or other
809 rule applying implicitly except being added to the clean
810 target.
811
812=-=-=-=-= bsd.gcc.mk =-=-=-=-=
813
814The include file <bsd.gcc.mk> computes various parameters related to GCC
815support libraries. It defines no targets. <bsd.own.mk> MUST be included
816before <bsd.gcc.mk>.
817
818The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
819of which need to know where to find certain GCC support libraries.
820
821The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
822which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then
823the compiler is asked where to find the support libraries, otherwise the
824support libraries are found in ${DESTDIR}/usr/lib.
825
826<bsd.gcc.mk> sets the following variables:
827
828_GCC_CRTBEGIN The full path name to crtbegin.o.
829
830_GCC_CRTBEGINS The full path name to crtbeginS.o.
831
832_GCC_CRTEND The full path name to crtend.o.
833
834_GCC_CRTENDS The full path name to crtendS.o.
835
836_GCC_LIBGCCDIR The directory where libgcc.a is located.
837
838
839=-=-=-=-= bsd.inc.mk =-=-=-=-=
840
841The include file <bsd.inc.mk> defines the includes target and uses the
842variables:
843
844INCS The list of include files.
845
846INCSDIR The location to install the include files.
847
848INCSNAME Target name of the include file, if only one; same as
849 FILESNAME, but for include files.
850
851INCSYMLINKS Similar to SYMLINKS in <bsd.links.mk>, except that these
852 are installed in the 'includes' target and not the
853 (much later) 'install' target.
854
855INCSNAME_<file> The name file <file> should be installed as, if not <file>,
856 same as FILESNAME_<file>, but for include files.
857
858
859=-=-=-=-= bsd.info.mk =-=-=-=-=
860
861The include file <bsd.info.mk> is used to generate and install GNU Info
862documentation from respective Texinfo source files. It defines three
863implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
864following variables:
865
866TEXINFO List of Texinfo source files. Info documentation will
867 consist of single files with the extension replaced by
868 .info.
869
870INFOFLAGS Options to pass to makeinfo. []
871
872
873=-=-=-=-= bsd.kernobj.mk =-=-=-=-=
874
875The include file <bsd.kernobj.mk> defines variables related to the
876location of kernel sources and object directories.
877
878KERNSRCDIR Directory at the top of the kernel source..
879 [${NETBSDSRCDIR}/sys]
880
881KERNARCHDIR Directory under KERNSRCDIR containing the machine
882 dependent kernel sources.
883 [arch/${MACHINE}]
884
885KERNCONFDIR Directory containing the kernel configuration files.
886 [${KERNSRCDIR}/${KERNARCHDIR}/conf]
887
888KERNOBJDIR Directory for kernel builds. For example, the kernel
889 GENERIC will be compiled in KERNOBJDIR/GENERIC.
890 Default:
891 ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
892 if it exists or the make(1) target 'obj' is being made;
893 otherwise ${KERNSRCDIR}/${KERNARCHDIR}/compile.
894
895It is important that Makefiles (such as those under src/distrib) that
896wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
897rather than make assumptions about the location of the compiled kernel.
898
899
900=-=-=-=-= bsd.kinc.mk =-=-=-=-=
901
902The include file <bsd.kinc.mk> defines the many targets (includes,
903subdirectories, etc.), and is used by kernel makefiles to handle
904include file installation. It is intended to be included alone, by
905kernel Makefiles. It uses similar variables to <bsd.inc.mk>.
906Please see <bsd.kinc.mk> for more details, and keep the documentation
907in that file up to date.
908
909=-=-=-=-= bsd.syscall.mk =-=-=-=-=
910
911The include file <bsd.syscall.mk> contains the logic to create syscall
912files for various emulations. It includes <bsd.kinc.mk> to handle the
913rest of the targets.
914
915=-=-=-=-= bsd.lib.mk =-=-=-=-=
916
917The include file <bsd.lib.mk> has support for building libraries. It has
918the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
919includes, install, lint, and tags. Additionally, it has a checkver target
920which checks for installed shared object libraries whose version is greater
921that the version of the source. It has a limited number of suffixes,
922consistent with the current needs of the BSD tree. <bsd.lib.mk> includes
923<bsd.shlib.mk> to get shared library parameters.
924
925It sets/uses the following variables:
926
927LIB The name of the library to build.
928
929LIBDIR Target directory for libraries.
930
931SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
932 is not "no".
933
934LIBSUBDIR If nonempty, subdirectory of LIBDIR where this library
935 is installed.
936 Default: Empty.
937
938SHLIB_MAJOR
939SHLIB_MINOR
940SHLIB_TEENY Major, minor, and teeny version numbers of shared library
941
942USE_SHLIBDIR If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
943 as the path to install shared libraries to.
944 USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
945 Default: no
946
947LIBISMODULE If not "no", install as ${LIB}.so (without the "lib" prefix),
948 and act as "MKDEBUGLIB=no MKPICINSTALL=no MKPROFILE=no
949 MKSTATICLIB=no". Also do not install the lint library.
950 Default: no
951
952LIBISPRIVATE If not "no", act as "MKDEBUGLIB=no MKPIC=no MKPROFILE=no",
953 and don't install the (.a) library or the lint library.
954 This is useful for "build only" helper libraries.
955 If set to "pic", then a _pic.a library is also produced,
956 so that it can be incorporated into other shared objects.
957 Default: no
958
959LIBISCXX If not "no", Use ${CXX} instead of ${CC} to link
960 shared libraries.
961 This is useful for C++ libraries.
962 Default: no
963
964LINTLIBDIR Target directory for lint libraries.
965
966LIBGRP Library group.
967
968LIBOWN Library owner.
969
970LIBMODE Library mode.
971
972LDADD Additional loader objects.
973
974MAN The manual pages to be installed (use a .1 - .9 suffix).
975
976NOCHECKVER_<library>
977NOCHECKVER If set, disables checking for installed shared object
978 libraries with versions greater than the source. A
979 particular library name, without the "lib" prefix, may
980 be appended to the variable name to disable the check for
981 only that library.
982
983SRCS List of source files to build the library. Suffix types
984 .s, .c, and .f are supported. Note, .s files are preferred
985 to .c files of the same name. (This is not the default for
986 versions of make.)
987
988LIBDPLIBS/
989PROGDPLIBS A list of the tuples:
990 libname path-to-srcdir-of-libname
991
992 Instead of depending on installed versions of the libraries,
993 one can depend on their built version in the source directory.
994 This is useful for finding private libraries (LIBISPRIVATE).
995
996 For each tuple;
997 * LIBDO.libname contains the .OBJDIR of the library
998 `libname', and if it is not set it is determined
999 from the srcdir and added to MAKEOVERRIDES (the
1000 latter is to allow for build time optimization).
1001 * LDADD gets -L${LIBDO.libname} -llibname added.
1002 * DPADD gets ${LIBDO.libname}/liblibname.so or
1003 ${LIBDO.libname}/liblibname.a added.
1004
1005 The special value "_external" for LIBDO.lib makes the
1006 build system to assume the library comes from outside
1007 of the NetBSD source tree and only causes -llibname
1008 to be added to LDADD.
1009
1010 This variable may be used for individual libraries/programs,
1011 as well as in parent directories to cache common libraries
1012 as a build-time optimization.
1013
1014LIBDPSUBDIRS/
1015PROGDPSUBDIRS/ A list of subdirectory paths _subdir_ for which the
1016 ldflags
1017
1018 -L${SHLIBDIR}/${_subdir_}
1019 -Wl,-rpath,${SHLIBDIR}/${_subdir_}
1020
1021 should be added, for libraries or programs that depend
1022 on libraries which are installed in nonstandard
1023 locations like /usr/lib/private.
1024 Default: Empty.
1025
1026LIB_EXPSYM File listing all symbols expected to be defined by the
1027 library. Each line has a single symbol. If the symbol
1028 is versioned, it is followed by `@@', if it is the
1029 default version, or `@', if not, and the symbol
1030 version. The lines must be sorted in LANG=C.
1031
1032 bsd.lib.mk checks to make sure exactly the set of
1033 symbols in this file is defined when the library is
1034 built; if not, the build will fail and print a diff
1035 from the expected symbols to the actual symbols.
1036 During development, you can update the expected symbols
1037 from the actual ones with `make update-symbols'.
1038
1039VERSION_MAP Path to an ld version script to use when linking the
1040 library. Resolved from .PATH like a target
1041 prerequisite.
1042
1043
1044The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
1045if it exists, as well as the include file <bsd.man.mk>.
1046
1047It has rules for building profiled objects; profiled libraries are
1048built by default.
1049
1050Libraries are ranlib'd when made.
1051
1052
1053=-=-=-=-= bsd.links.mk =-=-=-=-=
1054
1055The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1056and is included from <bsd.lib.mk> and <bsd.prog.mk>.
1057
1058LINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log
1059is used. The defaults may be modified by other bsd.*.mk files which
1060include bsd.links.mk. In the future, these variables may be replaced
1061by a method for explicitly recording hard links in a metadata log.
1062
1063LINKS The list of hard links, consisting of pairs of paths:
1064 source-file target-file
1065 ${DESTDIR} is prepended to both paths before linking.
1066 For example, to link /bin/test and /bin/[, use:
1067 LINKS=/bin/test /bin/[
1068
1069CONFIGLINKS Similar semantics to LINKS, except that the links
1070 are installed by the `configinstall' target,
1071 not the `install' target.
1072
1073SYMLINKS The list of symbolic links, consisting of pairs of paths:
1074 source-file target-file
1075 ${DESTDIR} is only prepended to target-file before linking.
1076 For example, to symlink /usr/bin/tar to /bin/tar resulting
1077 in ${DESTDIR}/usr/bin/tar -> /bin/tar:
1078 SYMLINKS=/bin/tar /usr/bin/tar
1079
1080CONFIGSYMLINKS Similar semantics to SYMLINKS, except that the symbolic links
1081 are installed by the `configinstall' target,
1082 not the `install' target.
1083
1084LINKSOWN Link owner. [${BINOWN}]
1085
1086LINKSGRP Link group. [${BINGRP}]
1087
1088LINKSMODE Link mode. [${NONBINMODE}]
1089
1090LINKSOWN_<fn> Link owner of the specific file <fn>.
1091
1092LINKSGRP_<fn> Link group of the specific file <fn>.
1093
1094LINKSMODE_<fn> Link mode of the specific file <fn>.
1095
1096
1097=-=-=-=-= bsd.man.mk =-=-=-=-=
1098
1099The include file <bsd.man.mk> handles installing manual pages and their
1100links.
1101
1102It has a three targets:
1103
1104 catinstall:
1105 Install the preformatted manual pages and their links.
1106 htmlinstall:
1107 Install the HTML manual pages and their links.
1108 maninstall:
1109 Install the manual page sources and their links.
1110
1111It sets/uses the following variables:
1112
1113MANDIR Base path for manual installation.
1114
1115MANGRP Manual group.
1116
1117MANOWN Manual owner.
1118
1119MANMODE Manual mode.
1120
1121MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
1122 or "/tahoe" for machine specific manual pages.
1123
1124MAN The manual pages to be installed (use a .1 - .9 suffix).
1125
1126MLINKS List of manual page links (using a .1 - .9 suffix). The
1127 linked-to file must come first, the linked file second,
1128 and there may be multiple pairs.
1129
1130The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
1131it exists.
1132
1133
1134=-=-=-=-= bsd.obj.mk =-=-=-=-=
1135
1136The include file <bsd.obj.mk> defines targets related to the creation
1137and use of separated object and source directories.
1138
1139If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
1140${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1141it exists. Otherwise make(1) looks for the existence of a
1142subdirectory (or a symlink to a directory) of the source directory
1143into which built targets should be placed. If an environment variable
1144named MAKEOBJDIR is set, make(1) uses its value as the name of the
1145object directory; failing that, make first looks for a subdirectory
1146named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1147
1148Object directories are not created automatically by make(1) if they
1149don't exist; you need to run a separate "make obj". (This will happen
1150during a top-level build if "MKOBJDIRS" is set to a value other than
1151"no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
1152and this is determined by a simple string prefix comparison -- object
1153directories are created in a separate object directory tree, and a
1154symlink to the object directory in that tree is created in the source
1155directory; otherwise, "make obj" assumes that you're not in the main
1156source tree and that it's not safe to use a separate object tree.
1157
1158Several variables used by <bsd.obj.mk> control exactly what
1159directories and links get created during a "make obj":
1160
1161MAKEOBJDIR If set, this is the component name of the object
1162 directory.
1163
1164OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
1165 object directories or links named "obj.${MACHINE}";
1166 otherwise, just creates ones named "obj".
1167
1168OBJMACHINE_ARCH If set with OBJMACHINE, creates object directories or
1169 links named "obj.${MACHINE}-${MACHINE_ARCH}".
1170
1171USR_OBJMACHINE If set, and the current directory is a subdirectory of
1172 ${BSDSRCDIR}, create object directory in the
1173 corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
1174 otherwise, create it in the corresponding subdirectory
1175 of ${BSDOBJDIR}
1176
1177BUILDID Identifier for the build. If set, this should be a short
1178 string that is suitable for use as part of a file or
1179 directory name. The identifier will be appended to
1180 object directory names; if OBJMACHINE is also set, then
1181 .BUILDID is appended after .MACHINE. The identifier will
1182 also be used as part of the kernel version string, which
1183 can be shown by “uname -v”.
1184
1185 Default: Unset.
1186
1187
1188=-=-=-=-= bsd.prog.mk =-=-=-=-=
1189
1190The include file <bsd.prog.mk> handles building programs from one or
1191more source files, along with their manual pages. It has a limited number
1192of suffixes, consistent with the current needs of the BSD tree.
1193<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1194
1195It has eight targets:
1196
1197 all:
1198 build the program and its manual page. This also
1199 creates a GDB initialization file (.gdbinit) in
1200 the objdir. The .gdbinit file sets the shared library
1201 prefix to ${DESTDIR} to facilitate cross-debugging.
1202 clean:
1203 remove the program, any object files and the files a.out,
1204 Errs, errs, mklog, and ${PROG}.core.
1205 cleandir:
1206 remove all of the files removed by the target clean, as
1207 well as .depend, tags, and any manual pages.
1208 `distclean' is a synonym for `cleandir'.
1209 depend:
1210 make the dependencies for the source files, and store
1211 them in the file .depend.
1212 includes:
1213 install any header files.
1214 install:
1215 install the program and its manual pages; if the Makefile
1216 does not itself define the target install, the targets
1217 beforeinstall and afterinstall may also be used to cause
1218 actions immediately before and after the install target
1219 is executed.
1220 lint:
1221 run lint on the source files
1222 tags:
1223 create a tags file for the source files.
1224
1225It sets/uses the following variables:
1226
1227BINGRP Binary group.
1228
1229BINOWN Binary owner.
1230
1231BINMODE Binary mode.
1232
1233CLEANDIRFILES Additional files to remove for the cleandir target.
1234
1235CLEANFILES Additional files to remove for the clean and cleandir targets.
1236
1237CONFIGOPTS Additional options to config(1) when building kernels.
1238
1239 Default: Unset.
1240
1241COPTS Extra options for the C compiler. Should be appended to
1242 (e.g., COPTS+=-g), rather than explicitly set.
1243
1244 Note: CPUFLAGS, not COPTS, should be used for compiler
1245 options that select CPU-related options.
1246
1247COPTS.<fn> Extra options for the C compiler when creating the
1248 C objects for <fn>.
1249 For <fn>.[ly], "<fn>.c" must be used.
1250
1251CPUFLAGS Additional options passed to the compiler/assembler to
1252 select CPU instruction set options, CPU tuning options,
1253 etc.
1254
1255 Note: Such options should not be specified in COPTS,
1256 because some parts of the build process need to override
1257 CPU-related compiler options.
1258
1259 Default: Unset.
1260
1261CPUFLAGS.<fn> Additional options to the compiler/assembler for <fn>.
1262 For <fn>.[ly], "<fn>.c" must be used.
1263
1264CPPFLAGS Additional options to the C pre-processor.
1265
1266CPPFLAGS.<fn> Additional options to the C pre-processor for <fn>.
1267 For <fn>.[ly], "<fn>.c" must be used.
1268
1269GDBINIT List of GDB initialization files to add to "source"
1270 directives in the .gdbinit file that is created in the
1271 objdir.
1272
1273LDADD Additional loader objects. Usually used for libraries.
1274 For example, to load with the compatibility and utility
1275 libraries, use:
1276
1277 LDADD+=-lutil -lcompat
1278
1279LDFLAGS Additional linker options (passed to ${CC} during link).
1280
1281LINKS See <bsd.links.mk>
1282
1283OBJCOPTS Additional options to the compiler when creating ObjC objects.
1284
1285OBJCOPTS.<fn> Additional options to the compiler when creating the
1286 ObjC objects for <fn>.
1287 For <fn>.[ly], "<fn>.c" must be used.
1288
1289SYMLINKS See <bsd.links.mk>
1290
1291MAN Manual pages (should end in .1 - .9). If no MAN variable is
1292 defined, "MAN=${PROG}.1" is assumed.
1293
1294PAXCTL_FLAGS If defined, run paxctl(1) on the program binary after link
1295 time, with the value of this variable as options to paxctl(1).
1296
1297PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1298
1299PROG The name of the program to build. If not supplied, nothing
1300 is built.
1301
1302PROG_CXX If defined, the name of the program to build. Also
1303 causes <bsd.prog.mk> to link the program with the C++
1304 compiler rather than the C compiler. PROG_CXX overrides
1305 the value of PROG if PROG is also set.
1306
1307PROGNAME The name that the above program will be installed as, if
1308 different from ${PROG}.
1309
1310PROGS Multiple programs to build from a single directory.
1311 Defaults to PROG. For each program ${_P} in ${PROGS},
1312 uses SRCS.${_P}, defaulting to ${_P}.c.
1313
1314PROGS_CXX Multiple C++ programs to build from a single directory.
1315 Defaults to PROG_CXX. For each program ${_P} in ${PROGS_CXX},
1316 uses SRCS.${_P}, defaulting to ${_P}.cc.
1317
1318SRCS List of source files to build the program. If SRCS is not
1319 defined, it's assumed to be ${PROG}.c or ${PROG_CXX}.cc.
1320
1321DPSRCS List of source files which are needed for generating
1322 dependencies, but are not needed in ${SRCS}.
1323
1324DPADD Additional dependencies for the program. Usually used for
1325 libraries. For example, to depend on the compatibility and
1326 utility libraries use:
1327
1328 DPADD+=${LIBCOMPAT} ${LIBUTIL}
1329
1330 The following system libraries are predefined for DPADD:
1331
1332 LIBARCHIVE?= ${DESTDIR}/usr/lib/libarchive.a
1333 LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a
1334 LIBATF_C?= ${DESTDIR}/usr/lib/libatf-c.a
1335 LIBATF_CXX?= ${DESTDIR}/usr/lib/libatf-c++.a
1336 LIBBLOCKLIST?= ${DESTDIR}/usr/lib/libblocklist.a
1337 LIBBLUETOOTH?= ${DESTDIR}/usr/lib/libbluetooth.a
1338 LIBBSDMALLOC?= ${DESTDIR}/usr/lib/libbsdmalloc.a
1339 LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a
1340 LIBC?= ${DESTDIR}/usr/lib/libc.a
1341 LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
1342 LIBCBOR?= ${DESTDIR}/usr/lib/libcbor.a
1343 LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
1344 LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a
1345 LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
1346 LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a
1347 LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
1348 LIBCXX?= ${DESTDIR}/usr/lib/libc++.a
1349 LIBDES?= ${DESTDIR}/usr/lib/libdes.a
1350 LIBDNS?= ${DESTDIR}/usr/lib/libdns.a
1351 LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1352 LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
1353 LIBEVENT_OPENSSL?= ${DESTDIR}/usr/lib/libevent_openssl.a
1354 LIBEVENT_PTHREADS?= ${DESTDIR}/usr/lib/libevent_pthreads.a
1355 LIBEXECINFO?= ${DESTDIR}/usr/lib/libexecinfo.a
1356 LIBEXPAT?= ${DESTDIR}/usr/lib/libexpat.a
1357 LIBFETCH?= ${DESTDIR}/usr/lib/libfetch.a
1358 LIBFIDO2?= ${DESTDIR}/usr/lib/libfido2.a
1359 LIBFL?= ${DESTDIR}/usr/lib/libfl.a
1360 LIBFORM?= ${DESTDIR}/usr/lib/libform.a
1361 LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
1362 LIBGNUCTF?= ${DESTDIR}/usr/lib/libgnuctf.a
1363 LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1364 LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a
1365 LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a
1366 LIBHEIMBASE?= ${DESTDIR}/usr/lib/libheimbase.a
1367 LIBHEIMNTLM?= ${DESTDIR}/usr/lib/libheimntlm.a
1368 LIBHX500?= ${DESTDIR}/usr/lib/libhx500.a
1369 LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
1370 LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
1371 LIBISC?= ${DESTDIR}/usr/lib/libisc.a
1372 LIBISCCC?= ${DESTDIR}/usr/lib/libisccc.a
1373 LIBISCFG?= ${DESTDIR}/usr/lib/libiscfg.a
1374 LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
1375 LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a
1376 LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a
1377 LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a
1378 LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
1379 LIBL?= ${DESTDIR}/usr/lib/libl.a
1380 LIBLBER?= ${DESTDIR}/usr/lib/liblber.a
1381 LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a
1382 LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a
1383 LIBLUA?= ${DESTDIR}/usr/lib/liblua.a
1384 LIBM?= ${DESTDIR}/usr/lib/libm.a
1385 LIBMAGIC?= ${DESTDIR}/usr/lib/libmagic.a
1386 LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
1387 LIBNETPGPVERIFY?= ${DESTDIR}/usr/lib/libnetpgpverify.a
1388 LIBNS?= ${DESTDIR}/usr/lib/libns.a
1389 LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a
1390 LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a
1391 LIBPAM?= ${DESTDIR}/usr/lib/libpam.a
1392 LIBPANEL?= ${DESTDIR}/usr/lib/libpanel.a
1393 LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
1394 LIBPCI?= ${DESTDIR}/usr/lib/libpci.a
1395 LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
1396 LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a
1397 LIBPUFFS?= ${DESTDIR}/usr/lib/libpuffs.a
1398 LIBQUOTA?= ${DESTDIR}/usr/lib/libquota.a
1399 LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a
1400 LIBREFUSE?= ${DESTDIR}/usr/lib/librefuse.a
1401 LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
1402 LIBRMT?= ${DESTDIR}/usr/lib/librmt.a
1403 LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a
1404 LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
1405 LIBRT?= ${DESTDIR}/usr/lib/librt.a
1406 LIBRUMP?= ${DESTDIR}/usr/lib/librump.a
1407 LIBRUMPFS_CD9660?= ${DESTDIR}/usr/lib/librumpfs_cd9660.a
1408 LIBRUMPFS_EFS?= ${DESTDIR}/usr/lib/librumpfs_efs.a
1409 LIBRUMPFS_EXT2FS?= ${DESTDIR}/usr/lib/librumpfs_ext2fs.a
1410 LIBRUMPFS_FFS?= ${DESTDIR}/usr/lib/librumpfs_ffs.a
1411 LIBRUMPFS_HFS?= ${DESTDIR}/usr/lib/librumpfs_hfs.a
1412 LIBRUMPFS_LFS?= ${DESTDIR}/usr/lib/librumpfs_lfs.a
1413 LIBRUMPFS_MSDOS?= ${DESTDIR}/usr/lib/librumpfs_msdos.a
1414 LIBRUMPFS_NFS?= ${DESTDIR}/usr/lib/librumpfs_nfs.a
1415 LIBRUMPFS_NTFS?= ${DESTDIR}/usr/lib/librumpfs_ntfs.a
1416 LIBRUMPFS_SYSPUFFS?= ${DESTDIR}/usr/lib/librumpfs_syspuffs.a
1417 LIBRUMPFS_TMPFS?= ${DESTDIR}/usr/lib/librumpfs_tmpfs.a
1418 LIBRUMPFS_UDF?= ${DESTDIR}/usr/lib/librumpfs_udf.a
1419 LIBRUMPUSER?= ${DESTDIR}/usr/lib/librumpuser.a
1420 LIBSASLC?= ${DESTDIR}/usr/lib/libsaslc.a
1421 LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
1422 LIBSL?= ${DESTDIR}/usr/lib/libsl.a
1423 LIBSQLITE3?= ${DESTDIR}/usr/lib/libsqlite3.a
1424 LIBSSH?= ${DESTDIR}/usr/lib/libssh.a
1425 LIBSSL?= ${DESTDIR}/usr/lib/libssl.a
1426 LIBSTDCXX?= ${DESTDIR}/usr/lib/libstdc++.a
1427 LIBSUPCXX?= ${DESTDIR}/usr/lib/libsupc++.a
1428 LIBTERMINFO?= ${DESTDIR}/usr/lib/libterminfo.a
1429 LIBTRE?= ${DESTDIR}/usr/lib/libtre.a
1430 LIBUNBOUND?= ${DESTDIR}/usr/lib/libunbound.a
1431 LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a
1432 LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
1433 LIBWIND?= ${DESTDIR}/usr/lib/libwind.a
1434 LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
1435 LIBY?= ${DESTDIR}/usr/lib/liby.a
1436 LIBZ?= ${DESTDIR}/usr/lib/libz.a
1437
1438 The following c startup files.
1439
1440 LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
1441 LIBCRTI?= ${DESTDIR}/usr/lib/crti.o
1442 LIBCRTBEGIN?= ${DESTDIR}/usr/lib/crti.o
1443 LIBCRTEND?= ${DESTDIR}/usr/lib/crtn.o
1444
1445 The following X-Windows libraries are predefined for DPADD:
1446
1447 LIBDPS?= ${DESTDIR}/usr/X11R7/lib/libdps.a
1448 LIBEGL?= ${DESTDIR}/usr/X11R7/lib/libEGL.a
1449 LIBFNTSTUBS?= ${DESTDIR}/usr/X11R7/lib/libfntstubs.a
1450 LIBFONTCACHE?= ${DESTDIR}/usr/X11R7/lib/libfontcache.a
1451 LIBFONTCONFIG?= ${DESTDIR}/usr/X11R7/lib/libfontconfig.a
1452 LIBFONTENC?= ${DESTDIR}/usr/X11R7/lib/libfontenc.a
1453 LIBFREETYPE?= ${DESTDIR}/usr/X11R7/lib/libfreetype.a
1454 LIBFS?= ${DESTDIR}/usr/X11R7/lib/libFS.a
1455 LIBGL?= ${DESTDIR}/usr/X11R7/lib/libGL.a
1456 LIBGLU?= ${DESTDIR}/usr/X11R7/lib/libGLU.a
1457 LIBGLW?= ${DESTDIR}/usr/X11R7/lib/libGLw.a
1458 LIBI810XVMC 4{DESTDIR}/usr/X11R7/lib/libI810XvMC.a
1459 LIBICE?= ${DESTDIR}/usr/X11R7/lib/libICE.a
1460 LIBINTELXVMC ${DESTDIR}/usr/X11R7/lib/libIntelXvMC.a
1461 LIBLBXUTIL?= ${DESTDIR}/usr/X11R7/lib/liblbxutil.a
1462 LIBSM?= ${DESTDIR}/usr/X11R7/lib/libSM.a
1463 LIBX11_XCB?= ${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
1464 LIBX11?= ${DESTDIR}/usr/X11R7/lib/libX11.a
1465 LIBXRES?= ${DESTDIR}/usr/X11R7/lib/libXres.a
1466 LIBXAU?= ${DESTDIR}/usr/X11R7/lib/libXau.a
1467 LIBXAU7?= ${DESTDIR}/usr/X11R7/lib/libXau7.a
1468 LIBXAW?= ${DESTDIR}/usr/X11R7/lib/libXaw.a
1469 LIBXCB?= ${DESTDIR}/usr/X11R7/lib/libxcb.a
1470 LIBXCOMPOSITE?= ${DESTDIR}/usr/X11R7/lib/libXcomposite.a
1471 LIBXCURSOR?= ${DESTDIR}/usr/X11R7/lib/libXcursor.a
1472 LIBXCVT?= ${DESTDIR}/usr/X11R7/lib/libxcvt.a
1473 LIBXDAMAGE?= ${DESTDIR}/usr/X11R7/lib/libXdamage.a
1474 LIBXDMCP?= ${DESTDIR}/usr/X11R7/lib/libXdmcp.a
1475 LIBXEXT?= ${DESTDIR}/usr/X11R7/lib/libXext.a
1476 LIBXFIXES?= ${DESTDIR}/usr/X11R7/lib/libXfixes.a
1477 LIBXFONT2?= ${DESTDIR}/usr/X11R7/lib/libXfont2.a
1478 LIBXFONT?= ${DESTDIR}/usr/X11R7/lib/libXfont.a
1479 LIBXFT?= ${DESTDIR}/usr/X11R7/lib/libXft.a
1480 LIBXI?= ${DESTDIR}/usr/X11R7/lib/libXi.a
1481 LIBXINERAMA?= ${DESTDIR}/usr/X11R7/lib/libXinerama.a
1482 LIBXKBFILE?= ${DESTDIR}/usr/X11R7/lib/libxkbfile.a
1483 LIBXMU?= ${DESTDIR}/usr/X11R7/lib/libXmu.a
1484 LIBXMUU?= ${DESTDIR}/usr/X11R7/lib/libXmuu.a
1485 LIBXPM?= ${DESTDIR}/usr/X11R7/lib/libXpm.a
1486 LIBXRANDR?= ${DESTDIR}/usr/X11R7/lib/libXrandr.a
1487 LIBXRENDER?= ${DESTDIR}/usr/X11R7/lib/libXrender.a
1488 LIBXSS?= ${DESTDIR}/usr/X11R7/lib/libXss.a
1489 LIBXT?= ${DESTDIR}/usr/X11R7/lib/libXt.a
1490 LIBXTRAP?= ${DESTDIR}/usr/X11R7/lib/libXTrap.a
1491 LIBXTST?= ${DESTDIR}/usr/X11R7/lib/libXtst.a
1492 LIBXV?= ${DESTDIR}/usr/X11R7/lib/libXv.a
1493 LIBXXF86DGA?= ${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
1494 LIBXXF86MISC?= ${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
1495 LIBXXF86VM?= ${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
1496
1497STRIPFLAG The option passed to the install program to cause the binary
1498 to be stripped.
1499
1500SUBDIR A list of subdirectories that should be built as well.
1501 Each of the targets will execute the same target in the
1502 subdirectories.
1503
1504SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1505 These are installed exactly like programs.
1506
1507SCRIPTSDIR The location to install the scripts. Each script can be
1508 installed to a separate path by setting SCRIPTSDIR_<script>.
1509
1510SCRIPTSNAME The name that the above program will be installed as, if
1511 different from ${SCRIPTS}. These can be further specialized
1512 by setting SCRIPTSNAME_<script>.
1513
1514FILES See description of <bsd.files.mk>.
1515
1516SHLINKDIR Target directory for shared linker. See description of
1517 <bsd.own.mk> for additional information about this variable.
1518
1519The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1520if it exists, as well as the include file <bsd.man.mk>.
1521
1522Some simple examples:
1523
1524To build foo from foo.c with a manual page foo.1, use:
1525
1526 PROG= foo
1527
1528 .include <bsd.prog.mk>
1529
1530To build foo from foo.c with a manual page foo.2, add the line:
1531
1532 MAN= foo.2
1533
1534If foo does not have a manual page at all, add the line
1535before any make(1) .include directives:
1536
1537 NOMAN=
1538
1539If foo has multiple source files, add the line:
1540
1541 SRCS= a.c b.c c.c d.c
1542
1543
1544=-=-=-=-= bsd.rpc.mk =-=-=-=-=
1545
1546The include file <bsd.rpc.mk> contains a makefile fragment used to
1547construct source files built by rpcgen.
1548
1549The following macros may be defined in makefiles which include
1550<bsd.rpc.mk> in order to control which files get built and how they
1551are to be built:
1552
1553RPC_INCS construct .h file from .x file
1554RPC_XDRFILES construct _xdr.c from .x file
1555 (for marshalling/unmarshalling data types)
1556RPC_SVCFILES construct _svc.c from .x file
1557 (server-side stubs)
1558RPC_SVCFLAGS Additional options passed to builds of RPC_SVCFILES.
1559
1560RPC_XDIR Directory containing .x/.h files
1561
1562
1563=-=-=-=-= bsd.shlib.mk =-=-=-=-=
1564
1565The include file <bsd.shlib.mk> computes parameters for shared library
1566installation and use. It defines no targets. <bsd.own.mk> MUST be
1567included before <bsd.shlib.mk>.
1568
1569<bsd.own.mk> sets the following variables, if they are not already defined
1570(defaults are in brackets):
1571
1572SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1573 instead of ${LIBDIR} as the base path for shared library
1574 installation. [/lib]
1575
1576SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building
1577 a program. [/lib for programs in /bin and /sbin, /usr/lib
1578 for all others.]
1579
1580_LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1581 otherwise set to ${LIBDIR}
1582
1583SHLINKINSTALLDIR Base path for shared linker. [/libexec]
1584
1585SHLINKDIR Path to use for shared linker when building a program.
1586 [/libexec for programs in /bin and /sbin, /usr/libexec for
1587 all others.]
1588
1589
1590=-=-=-=-= bsd.subdir.mk =-=-=-=-=
1591
1592The include file <bsd.subdir.mk> contains the default targets for building
1593subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
1594clean, cleandir, depend, includes, install, lint, and tags. It uses the
1595following variables:
1596
1597NOSUBDIR If this variable is defined, then the SUBDIR variable
1598 will be ignored and subdirectories will not be processed.
1599
1600SUBDIR For all of the directories listed in ${SUBDIR}, the
1601 specified directory will be visited and the target made.
1602
1603 As a special case, the use of a token .WAIT as an
1604 entry in SUBDIR acts as a synchronization barrier
1605 when multiple make jobs are run; subdirs before the
1606 .WAIT must complete before any subdirs after .WAIT are
1607 started. See make(1) for some caveats on use of .WAIT
1608 and other special sources.
1609
1610
1611=-=-=-=-= bsd.x11.mk =-=-=-=-=
1612
1613The include file <bsd.x11.mk> contains parameters and targets for
1614cross-building X11 from ${X11SRCDIR.<package>}. It should be included
1615after the general Makefile contents but before the include files such as
1616<bsd.prog.mk> and <bsd.lib.mk>.
1617
1618It provides the following targets:
1619 .man.1 .man.3 .man.4 .man.5 .man.7 .man.8:
1620 If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1621 these rules convert from X11's manual page source
1622 into an mdoc.old source file.
1623
1624It sets the following variables:
1625
1626BINDIR Set to ${X11BINDIR}.
1627 To override, define after including <bsd.x11.mk>
1628
1629LIBDIR Set to ${X11USRLIBDIR}.
1630 To override, define after including <bsd.x11.mk>
1631
1632MANDIR Set to ${X11MANDIR}.
1633 To override, define after including <bsd.x11.mk>
1634
1635CPPFLAGS Appended with definitions to include from
1636 ${DESTDIR}${X11INCDIR}
1637
1638LDFLAGS Appended with definitions to link from
1639 ${DESTDIR}${X11USRLIBDIR}
1640
1641X11FLAGS.CONNECTION Equivalent to X11's CONNECTION_FLAGS.
1642
1643X11FLAGS.EXTENSION Equivalent to X11's EXT_DEFINES.
1644
1645X11FLAGS.LOADABLE Equivalent to X11's LOADABLE.
1646
1647X11FLAGS.OS_DEFINES Equivalent to X11's OS_DEFINES.
1648
1649X11FLAGS.SERVER Equivalent to X11's ServerDefines.
1650
1651X11FLAGS.THREADLIB Equivalent to X11's THREADS_DEFINES for libraries.
1652
1653X11FLAGS.THREADS Equivalent to X11's THREADS_DEFINES.
1654
1655X11FLAGS.VERSION cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1656
1657X11FLAGS.DIX Equivalent to X11's DIX_DEFINES.
1658
1659X11TOOL_UNXCOMM Command line to convert `XCOMM' comments to `#'
1660
1661It uses the following variables:
1662
1663APPDEFS List of app-default files to install.
1664
1665CPPSCRIPTS List of files/scripts to run through cpp(1)
1666 and then ${X11TOOL_UNXCOMM}. The source files
1667 have a `.cpp' suffix, the generated files do not.
1668
1669CPPSCRIPTFLAGS Additional options to cpp(1) when building CPPSCRIPTS.
1670
1671CPPSCRIPTFLAGS_<fn> Additional options to cpp(1) when building CPPSCRIPT <fn>.
1672
1673
1674=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1675
1676The following files are described here for completion, but they are not
1677supposed to be included directly from other Makefiles; they are used
1678internally by other system files.
1679
1680=-=-=-=-= bsd.sys.mk =-=-=-=-=
1681
1682The include file <bsd.sys.mk> is used by other system mk files and
1683it is not intended to be included standalone. It contains rules and
1684system build variables. It requires bsd.own.mk to be included first.
1685It contains overrides that are used when building the NetBSD source tree.
1686
1687The following variables control how various files are compiled/built.
1688(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1689
1690AR Create, modify, and extract from archives. [ar]
1691
1692ARFLAGS Options to ${AR}. [rl]
1693
1694ARM_ELF2AOUT Convert ELF-format executable to a.out. [elf2aout]
1695
1696AS Assembler. [as]
1697
1698AFLAGS Options to ${CC} when compiling or linking .s or .S
1699 assembly source files. []
1700
1701BUILDSEED g++(1) uses random numbers when compiling C++ code. This
1702 variable seeds the g++(1) random number generator using
1703 -frandom-seed with this value. By default, it is set to
1704 "NetBSD-(majorversion)". Using a fixed value causes C++
1705 binaries to be the same when built from the same sources,
1706 resulting in identical (reproducible) builds. Additional
1707 information is available in the g++(1) documentation of
1708 -frandom-seed.
1709
1710 Default: Unset.
1711
1712CC C compiler. [cc]
1713
1714CFLAGS Options to ${CC}. [Usually -O or -O2]
1715 Note: CFLAGS should never be set in mk.conf(5).
1716
1717CPP C Pre-Processor. [cpp]
1718
1719CPPFLAGS Options to ${CPP}. []
1720
1721CPUFLAGS Optimization options for ${CC}. []
1722
1723CXX C++ compiler. [c++]
1724
1725CXXFLAGS Options to ${CXX}. [${CFLAGS}]
1726
1727M68K_ELF2AOUT Convert ELF-format executable to a.out. [elf2aout]
1728
1729MIPS_ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff]
1730
1731FC Fortran compiler. [f77]
1732
1733FFLAGS Options to {$FC}. [-O]
1734
1735HOST_SH Shell. This must be an absolute path, because it may be
1736 substituted into "#!" lines in scripts. [/bin/sh]
1737
1738INSTALL install(1) command. [install]
1739
1740LEX Lexical analyzer. [lex]
1741
1742LFLAGS Options to ${LEX}. []
1743
1744LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1745
1746LD Linker. [ld]
1747
1748LDFLAGS Options to ${CC} during the link process. []
1749
1750LINT C program verifier. [lint]
1751
1752LINTFLAGS Options to ${LINT}. [-chapbrxzgFS]
1753
1754LORDER List dependencies for object files. [lorder]
1755
1756MAKE make(1). [make]
1757
1758MKDEP Construct Makefile dependency list. [mkdep]
1759
1760MKDEPCXX Construct Makefile dependency list for C++ files. [mkdep]
1761
1762NM List symbols from object files. [nm]
1763
1764PC Pascal compiler. [pc] (Not present)
1765
1766PFLAGS Options to ${PC}. []
1767
1768OBJC Objective C compiler. [${CC}]
1769
1770OBJCFLAGS Options to ${OBJC}. [${CFLAGS}]
1771
1772OBJCOPY Copy and translate object files. [objcopy]
1773
1774OBJCOPYLIBFLAGS Options to pass to objcopy when library objects are
1775 being built. [${.TARGET} =~ "*.po" ? -X : -x]
1776
1777OBJDUMP Display information from object files. [objdump]
1778
1779RANLIB Generate index to archive. [ranlib]
1780
1781READELF Display information from ELF object files. [readelf]
1782
1783SIZE List section sizes and total size. [size]
1784
1785STRINGS Display printable character sequences in files. [strings]
1786
1787STRIP Discard symbols from object files. [strip]
1788
1789TSORT Topological sort of a directed graph. [tsort -q]
1790
1791YACC LALR(1) parser generator. [yacc]
1792
1793YFLAGS Options to ${YACC}. []
1794
1795YHEADER If defined, add "-d" to YFLAGS, and add dependencies
1796 from <file>.y to <file>.h and <file>.c, and add
1797 <foo>.h to CLEANFILES.
1798
1799YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS.
1800
1801
1802Other variables of note (incomplete list):
1803
1804NOCLANGERROR If defined and clang is used as C compiler, -Werror is not
1805 passed to it.
1806
1807NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC
1808 that cause warnings to be fatal, such as:
1809 -Werror -Wa,--fatal-warnings
1810 (The latter being for as(1).)
1811
1812WARNS Crank up compiler warning options; the distinct levels are:
1813 WARNS=1
1814 WARNS=2
1815 WARNS=3
1816 WARNS=4
1817 WARNS=5
1818 WARNS=6
1819
1820=-=-=-=-= bsd.host.mk =-=-=-=-=
1821
1822This file is automatically included from bsd.own.mk. It contains settings
1823for all the HOST_* variables that are used in host programs and libraries.
1824
1825HOST_AR The host archive processing command
1826
1827HOST_CC The host c compiler
1828
1829HOST_CFLAGS The host c compiler options
1830
1831HOST_COMPILE.c The host c compiler line with options
1832
1833HOST_COMPILE.cc The host c++ compiler line with options
1834
1835HOST_CPP The host c pre-processor
1836
1837HOST_CPPFLAGS The host c pre-processor options
1838
1839HOST_CXX The host c++ compiler
1840
1841HOST_CXXFLAGS The host c++ compiler options
1842
1843HOST_INSTALL_DIR The host command to install a directory
1844
1845HOST_INSTALL_FILE The host command to install a file
1846
1847HOST_INSTALL_SYMLINK The host command to install a symlink
1848
1849HOST_LD The host linker command
1850
1851HOST_LDFLAGS The host linker options
1852
1853HOST_LINK.c The host c linker line with options
1854
1855HOST_LINK.cc The host c++ linker line with options
1856
1857HOST_LN The host command to link two files
1858
1859HOST_MKDEP The host command to create dependencies for c programs
1860
1861HOST_MKDEPCXX The host command to create dependencies for c++ programs
1862
1863HOST_OSTYPE The host OSNAME-RELEASE-ARCH tupple
1864
1865HOST_RANLIB The host command to create random access archives
1866
1867HOST_SH The host Bourne shell interpreter name (absolute path)
1868
1869=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1870