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