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