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