bsd.README revision 1.272
1# $NetBSD: bsd.README,v 1.272 2010/06/19 03:50:30 mrg 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 that 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 116MKATF If "no", don't build libatf-c, libatf-c++ libraries associated 117 with the Automated Testing Framework (ATF). 118 Default: yes 119 120MKBFD Obsolete, use MKBINUTILS 121 122MKBINUTILS If "no", don't build binutils (gas, ld, etc and libbfd, 123 libopcodes) 124 Default: yes 125 126MKBSDTAR If "yes", use the libarchive based cpio and tar instead of 127 the pax frontends. 128 Default: no 129 130MKCATPAGES If "no", don't build or install the catman pages. 131 Default: yes 132 133MKCOMPAT If "no", don't build or install the src/compat. 134 Default: yes on amd64/sparc64, no elsewhere. 135 136MKCOMPLEX If "no", don't build libm support for <complex.h> 137 Default: yes 138 139MKCRYPTO If "no", no cryptography support will be built into the system, 140 and also acts as "MKKERBEROS=no". 141 Default: yes 142 143MKCRYPTO_IDEA If not "no", IDEA support will be built into libcrypto_idea.a. 144 Default: no 145 146MKCRYPTO_MDC2 If not "no", MDC2 support will be built into libcrypto_mdc2.a 147 Default: no 148 149MKCRYPTO_RC5 If not "no", RC5 support will be built into libcrypto_rc5.a. 150 Default: no 151 152MKCVS If "no", don't build or install cvs(1). 153 Default: yes 154 155MKDEBUG If "no", don't build and install separate debugging symbols 156 into /usr/libdata/debug. 157 Default: no 158 159MKDEBUGLIB Build *_g.a debugging libraries, which are compiled 160 with -DDEBUG. 161 Default: no 162 163MKDOC If "no", don't build or install the documentation. 164 Default: yes 165 166MKDYNAMICROOT If "no", build programs in /bin and /sbin statically, 167 don't install certain libraries in /lib, and don't 168 install the shared linker into /libexec. 169 Default: yes 170 171MKEXTSRC If not "no", 'make build' also descends into either src/extsrc 172 to cross-build programs and libraries externally added by 173 users, and automatically enables creation of those sets. 174 Default: no 175 176MKGCC If "no", don't build gcc(1) or any of the GCC-related 177 libraries (libgcc, libobjc, libstdc++). 178 Default: yes 179 180MKGCCCMDS If "no", don't build gcc(1), but do build the GCC-related 181 libraries (libgcc, libobjc, libstdc++). 182 Default: yes 183 184MKGDB If "no", don't build gdb(1). 185 Default: yes 186 187MKHESIOD If "no", disables building of Hesiod infrastructure 188 (libraries and support programs). 189 Default: yes 190 191MKHOSTOBJ If not "no", for programs intended to be run on the compile 192 host, the name, release, and architecture of the host 193 operating system will be suffixed to the name of the object 194 directory created by "make obj". 195 Default: no 196 197MKHTML If "no", don't build or install the HTML man pages. 198 Default: yes 199 200MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance. 201 Has no effect on most platforms. 202 Default: yes 203 204MKSTRIPIDENT Strip the RCS IDs from program binaries and shared libraries. 205 Default: no 206 207MKINET6 If "no", disables building of INET6 (IPv6) infrastructure 208 (libraries and support programs). 209 Default: yes 210 211MKINFO If "no", don't build or install Info documentation from 212 Texinfo source files. 213 Default: yes 214 215MKIPFILTER If "no", don't build or install the IP Filter programs and LKM. 216 Default: yes 217 218MKISCSI If "no", don't build or install iSCSI library or applications 219 (depends on libpthread.) 220 Default: yes 221 222MKKERBEROS If "no", disables building of Kerberos v5 223 infrastructure (libraries and support programs). 224 Default: yes 225 226MKLDAP If "no", disables building of LDAP infrastructure 227 (libraries and support programs). 228 Default: yes 229 230MKLINKLIB If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no". 231 Also: 232 - don't install the .a libraries 233 - don't install _pic.a libraries on PIC systems 234 - don't build .a libraries on PIC systems 235 - don't install the .so symlink on ELF systems 236 I.e, only install the shared library (and the .so.major 237 symlink on ELF). 238 Default: yes 239 240MKLINT If "no", don't build or install the lint libraries. 241 Default: yes 242 243MKLVM If "no", don't build or install the logical volume manager 244 and device mapper tools and libraries 245 Default: yes 246 247MKMAN If "no", don't build or install the man or catman pages, 248 and also acts as "MKCATPAGES=no MKHTML=no". 249 Default: yes 250 251MKMANDOC If "yes", mandoc is built as tool and used to compile 252 catman or html pages. A directory can be exempted by 253 defining NOMANDOC. Individual man pages are exempted 254 if USETBL is set or NOMANDOC.${target} is set to "yes". 255 Default: no 256 257MKMANZ If not "no", compress manual pages at installation time. 258 Default: no 259 260MKMDNS If "no", disables building of mDNS infrastructure 261 (libraries and support programs). 262 Default: yes 263 264MKNLS If "no", don't build or install the NLS files and locale 265 definition files. 266 Default: yes 267 268MKOBJ If "no", don't enable the rule which creates objdirs, 269 and also acts as "MKOBJDIRS=no". 270 Default: yes 271 272MKOBJDIRS If "no", don't create objdirs during a "make build". 273 Default: no 274 275MKPAM If "no", disables building of PAM authentication 276 infrastructure (libraries and support programs). 277 Default: yes 278 279MKPCC If "no", don't build pcc(1) or any of the PCC-related 280 libraries (libpcc, libpccsoftfloat). 281 Default: no 282 283MKPCCCMDS If "no", don't build pcc(1), but do build the PCC-related 284 libraries (libpcc, libpccsoftfloat). 285 Default: no 286 287MKPF If "no", don't build or install the pf programs and LKM. 288 Default: yes 289 290MKPIC If "no", don't build or install shared libraries, and 291 also acts as "MKPICLIB=no" 292 Default: yes (for MACHINE_ARCHs that support it) 293 294MKPICINSTALL If "no", don't install the *_pic.a libraries. 295 Default: yes 296 297MKPICLIB If "no", don't build *_pic.a libraries, and build the 298 shared object libraries from the .a libraries. 299 A symlink is installed in ${DESTDIR}/usr/lib for the 300 _pic.a library pointing to the .a library. 301 Default: yes 302 303MKPIE If "no", create regular executables. Otherwise create 304 PIE (Position Independent Executables). 305 Default: no 306 307MKPIGZGZIP If "no", only install pigz as pigz, not gzip. 308 Default: no 309 310MKPOSTFIX If "no", don't build or install postfix(1). 311 Default: yes 312 313MKPROFILE If "no", don't build or install the profiling (*_p.a) libraries. 314 Default: yes 315 316MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no 317 MKMAN=no MKNLS=no". 318 I.e, don't build catman pages, documentation, Info 319 documentation, man pages, NLS files, ... 320 Default: yes 321 322MKSKEY If "no", disables building of S/key authentication 323 infrastructure (libraries and support programs). 324 Default: yes 325 326MKSOFTFLOAT If not "no", build with options to enable the compiler to 327 generate output containing library calls for floating 328 point and possibly soft-float library support. 329 Default: no 330 331MKSTATICLIB If "no", don't build or install the normal static (*.a) 332 libraries. 333 Default: yes 334 335MKUNPRIVED If not "no", don't set the owner/group/mode when installing 336 files or directories, and keep a metadata log of what 337 the owner/group/mode should be. This allows a 338 non-root "make install". 339 Default: no 340 341MKUPDATE If not "no", 'make install' only installs targets that are 342 more recently modified in the source directories that their 343 installed counterparts. 344 Default: no 345 346MKX11 If not "no", depending on the value of ${X11FLAVOUR}, 347 'make build' also descends into either src/x11 (XFree86) or 348 src/external/mit/xorg (modular Xorg) to cross-build X11 and 349 automatically enables creation of X sets. 350 Default: no 351 352MKX11FONTS If not "no", if ${X11FLAVOUR} is "Xorg", do not build or 353 install the X fonts. The xfont set is still created but 354 will be empty. 355 Default: yes 356 357MKYP If "no", disables building of YP (NIS) 358 infrastructure (libraries and support programs). 359 Default: yes 360 361MKZFS If "no", do not build and install utilities and libraries 362 used to manage ZFS file system. Do not build zfs and solaris 363 compatibility kernel modules. 364 Default: yes on i386/amd64, no elsewhere. 365 366USE_HESIOD If "no", disables building Hesiod support into 367 various system utilities/libraries that support it. 368 If ${MKHESIOD} is "no", USE_HESIOD will also be 369 forced to "no". 370 371USE_INET6 If "no", disables building INET6 (IPv6) support into 372 various system utilities/libraries that support it. 373 If ${MKINET6} is "no", USE_INET6 will also be 374 forced to "no". 375 376USE_JEMALLOC If "no", disables building the "jemalloc" allocator 377 designed for improved performance with threaded 378 applications. The "phkmalloc" allocator as used up 379 before NetBSD-5.0 will be substituted. 380 381USE_KERBEROS If "no", disables building Kerberos v5 382 support into various system utilities/libraries that 383 support it. If ${MKKERBEROS} is "no", USE_KERBEROS 384 will also be forced to "no". 385 386USE_LDAP If "no", disables building LDAP support into various 387 system utilities/libraries that support it. 388 If ${MKLDAP} is "no", USE_LDAP will also be forced to "no". 389 390USE_PAM If "no", disables building PAM authentication support 391 into various system utilities/libraries that support it. 392 If ${MKPAM} is "no", USE_PAM will also be forced to "no". 393 394USE_SKEY If "no", disables building S/key authentication 395 support into various system utilities/libraries that 396 support it. If ${MKSKEY} is "no", USE_SKEY will 397 also be forced to "no". 398 Default: no 399 400USE_SSP If "no", disables GCC stack protection code, which 401 detects stack overflows and aborts the program. The 402 stack protection code imposes a performance penalty 403 of about 5%. 404 Default: "no", unless "USE_FORT" is set to "yes" 405 406USE_FORT If "yes" turns on substitute wrappers for commonly used 407 functions that do not do bounds checking regularly, but 408 they could in some cases by using the gcc 409 __builtin_object_size() function to determine the buffer 410 size where it is known and detect buffer overflows. 411 These substitute functions are in /usr/include/ssp. 412 Default: depends on the part of the source tree 413 414USE_YP If "no", disables building YP (NIS) support into 415 various system utilities/libraries that support it. 416 If ${MKYP} is "no", USE_YP will also be forced to "no". 417 418X11FLAVOUR Set to "Xorg" or "XFree86", depending on whether to build 419 XFree86 or modular Xorg. Only matters if MKX11!=no. 420 Default: "Xorg" on amd64, i386, macppc, shark and sparc64, 421 "XFree86" on everything else. 422 423COPTS.lib<lib> 424OBJCOPTS.lib<lib> 425LDADD.lib<lib> 426CPPFLAGS.lib<lib> 427CXXFLAGS.lib<lib> 428COPTS.<prog> 429OBJCCOPTS.<prog> 430LDADD.<prog> 431CPPFLAGS.<prog> 432CXXFLAGS.<prog> These provide a way to specify additions to the associated 433 variables in a way that applies only to a particular library 434 or program. <lib> corresponds to the LIB variable set in 435 the library's makefile. <prog> corresponds to either PROG 436 or PROG_CXX (if set). For example, if COPTS.libcrypto is 437 set to "-g", "-g" will be added to COPTS only when compiling 438 the crypto library. 439 440=-=-=-=-= sys.mk =-=-=-=-= 441 442The include file <sys.mk> has the default rules for all makes, in the BSD 443environment or otherwise. You probably don't want to touch this file. 444 445=-=-=-=-= bsd.own.mk =-=-=-=-= 446 447The include file <bsd.own.mk> contains source tree configuration parameters, 448such as the owners, groups, etc. for both manual pages and binaries, and 449a few global "feature configuration" parameters. 450 451It has no targets. 452 453To get system-specific configuration parameters, <bsd.own.mk> will try to 454include the file specified by the "MAKECONF" variable. If MAKECONF is not 455set, or no such file exists, the system make configuration file, /etc/mk.conf 456is included. These files may define any of the variables described below. 457 458<bsd.own.mk> sets the following variables, if they are not already defined 459(defaults are in brackets): 460 461NETBSDSRCDIR Top of the NetBSD source tree. 462 If _SRC_TOP_ != "", that will be used as the default, 463 otherwise BSDSRCDIR will be used as the default. 464 Various makefiles within the NetBSD source tree will 465 use this to reference the top level of the source tree. 466 467_SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk> 468 based on the presence of tools/ and build.sh. This variable 469 is "internal" to <bsd.own.mk>, although its value is only 470 determined once and then propagated to all sub-makes. 471 472BSDSRCDIR The real path to the system sources, so that 'make obj' 473 will work correctly. [/usr/src] 474 475BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' 476 will work correctly. [/usr/obj] 477 478BINGRP Binary group. [wheel] 479 480BINOWN Binary owner. [root] 481 482BINMODE Binary mode. [555] 483 484NONBINMODE Mode for non-executable files. [444] 485 486MANDIR Base path for manual installation. [/usr/share/man/cat] 487 488MANGRP Manual group. [wheel] 489 490MANOWN Manual owner. [root] 491 492MANMODE Manual mode. [${NONBINMODE}] 493 494MANINSTALL Manual installation type. Space separated list: 495 catinstall, htmlinstall, maninstall 496 [catinstall maninstall htmlinstall] 497 498LDSTATIC Control program linking; if set blank, link everything 499 dynamically. If set to "-static", link everything statically. 500 If not set, programs link according to their makefile. 501 502LIBDIR Base path for library installation. [/usr/lib] 503 504LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint] 505 506LIBGRP Library group. [${BINGRP}] 507 508LIBOWN Library owner. [${BINOWN}] 509 510LIBMODE Library mode. [${NONBINMODE}] 511 512DOCDIR Base path for system documentation (e.g. PSD, USD, etc.) 513 installation. [/usr/share/doc] 514 515HTMLDOCDIR Base path for html system documentation installation. 516 [/usr/share/doc/html] 517 518DOCGRP Documentation group. [wheel] 519 520DOCOWN Documentation owner. [root] 521 522DOCMODE Documentation mode. [${NONBINMODE}] 523 524NLSDIR Base path for Native Language Support files installation. 525 [/usr/share/nls] 526 527NLSGRP Native Language Support files group. [wheel] 528 529NLSOWN Native Language Support files owner. [root] 530 531NLSMODE Native Language Support files mode. [${NONBINMODE}] 532 533X11SRCDIR The path to the xsrc tree. [${NETBSDSRCDIR}/../xsrc, 534 if that exists; otherwise /usr/xsrc] 535 536X11SRCDIR.xc The path to the (old) X11 xc src tree. [${X11SRCDIR}/xfree/xc] 537 538X11SRCDIR.local The path to the local X11 src tree. [${X11SRCDIR}/local] 539 540X11SRCDIR.lib<package> 541X11SRCDIR.<package> 542 The path to the xorg src tree for the specificed package>. 543 [${X11SRCDIR}/external/mit/xorg/<package>/dist] 544 545X11ROOTDIR Root directory of the X11 installation. [/usr/X11R6 or 546 [/usr/X11R7] 547 548X11BINDIR X11 bin directory. [${X11ROOTDIR}/bin] 549 550X11FONTDIR X11 font directory. [${X11ROOTDIR}/lib/X11/fonts] 551 552X11INCDIR X11 include directory. [${X11ROOTDIR}/include] 553 554X11LIBDIR X11 lib/x11 (config) directory. [${X11ROOTDIR}/lib/X11] 555 556X11MANDIR X11 manual directory. [${X11ROOTDIR}/man] 557 558X11USRLIBDIR X11 library directory. [${X11ROOTDIR}/lib] 559 560STRIPFLAG The flag passed to the install program to cause the binary 561 to be stripped. This is to be used when building your 562 own install script so that the entire system can be made 563 stripped/not-stripped using a single knob. [] 564 565COPY The flag passed to the install program to cause the binary 566 to be copied rather than moved. This is to be used when 567 building our own install script so that the entire system 568 can either be installed with copies, or with moves using 569 a single knob. [-c] 570 571MAKEDIRTARGET dir target [params] 572 Runs "cd $${dir} && ${MAKE} [params] $${target}", 573 displaying a "pretty" message whilst doing so. 574 575RELEASEMACHINEDIR 576 Subdirectory used below RELEASEDIR when building 577 a release. [${MACHINE}] 578 579RELEASEMACHINE Subdirectory or path component used for the following 580 paths: 581 distrib/${RELEASEMACHINE} 582 distrib/notes/${RELEASEMACHINE} 583 etc/etc.${RELEASEMACHINE} 584 Used when building a release. [${MACHINE}] 585 586Additionally, the following variables may be set by <bsd.own.mk> or in a 587make configuration file to modify the behavior of the system build 588process (default values are in brackets along with comments, if set by 589<bsd.own.mk>): 590 591USETOOLS Indicates whether the tools specified by ${TOOLDIR} should 592 be used as part of a build in progress. 593 Supported values: 594 595 yes Use the tools from TOOLDIR. 596 Must be set to this if cross-compiling. 597 598 no Do not use the tools from TOOLDIR, but refuse to 599 build native compilation tool components that are 600 version-specific for that tool. 601 602 never Do not use the tools from TOOLDIR, even when 603 building native tool components. This is similar to 604 the traditional NetBSD build method, but does not 605 verify that the compilation tools in use are 606 up-to-date enough in order to build the tree 607 successfully. This may cause build or runtime 608 problems when building the whole NetBSD source tree. 609 610 Default: "yes" if building all or part of a whole NetBSD 611 source tree (detected automatically); "no" otherwise 612 (to preserve traditional semantics of the <bsd.*.mk> 613 make(1) include files). 614 615OBJECT_FMT Object file format. [set to "ELF" on architectures that 616 use ELF -- currently all architectures]. 617 618TOOLCHAIN_MISSING 619 If not "no", this indicates that the platform being built 620 does not have a working in-tree toolchain. If the 621 ${MACHINE_ARCH} in question falls into this category, 622 TOOLCHAIN_MISSING is conditionally assigned the value "yes". 623 Otherwise, the variable is unconditionally assigned the 624 value "no". 625 If not "no", ${MKBINUTILS}, ${MKGCC}, and ${MKGDB} are 626 unconditionally assigned the value "no". 627 628EXTERNAL_TOOLCHAIN 629 This variable is not directly set by <bsd.own.mk>, but 630 including <bsd.own.mk> is the canonical way to gain 631 access to this variable. The variable should be defined 632 either in the user's environment or in the user's mk.conf 633 file. If defined, this variable indicates the root of 634 an external toolchain which will be used to build the 635 tree. For example, if a platform is a ${TOOLCHAIN_MISSING} 636 platform, EXTERNAL_TOOLCHAIN can be used to re-enable the 637 cross-compile framework. 638 639 If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally 640 assigned the value "no", since the external version of the 641 compiler may not be able to build the library components of 642 the in-tree compiler. 643 644 NOTE: This variable is not yet used in as many places as 645 it should be. Expect the exact semantics of this variable 646 to change in the short term as parts of the cross-compile 647 framework continue to be cleaned up. 648 649The following variables are defined to commands to perform the 650appropriate operation, with the default in [brackets]. Note that 651the defaults change if USETOOLS == "yes": 652 653TOOL_AMIGAAOUT2BB aout to Amiga bootblock converter. [amiga-aout2bb] 654 655TOOL_AMIGAELF2BB ELF to Amiga bootblock converter. [amiga-elf2bb] 656 657TOOL_AMIGATXLT Amige assembly language format translator. [amiga-txlt] 658 659TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile] 660 661TOOL_AWK Pattern-directed scanning/processing language. [awk] 662 663TOOL_CAP_MKDB Create capability database. [cap_mkdb] 664 665TOOL_CAT Concatenate and print files. [cat] 666 667TOOL_CKSUM Display file checksums. [cksum] 668 669TOOL_COMPILE_ET Error table compiler. [compile_et] 670 671TOOL_CONFIG Build kernel compilation directories. [config] 672 673TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen] 674 675TOOL_CTAGS Create a tags file. [ctags] 676 677TOOL_DB Manipulate db(3) databases. [db] 678 679TOOL_DISKLABEL Read and write disk pack label. [disklabel] 680 681TOOL_EQN Format equations for groff. [eqn] 682 683TOOL_FDISK MS-DOS partition maintenance program. [fdisk] 684 685TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen] 686 687TOOL_GENASSYM Generate constants for assembly files. [genassym] 688 689TOOL_GENCAT Generate NLS message catalogs. [gencat] 690 691TOOL_GMAKE GNU make utility. [gmake] 692 693TOOL_GREP Print lines matching a pattern. [grep] 694 695TOOL_GROFF Front end for groff document formatting system. [groff] 696 697TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump] 698 699TOOL_HP300MKBOOT Make bootable image for hp300. [hp300-mkboot] 700 701TOOL_HP700MKBOOT Make bootable image for hp700. [hp700-mkboot] 702 703TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib] 704 705TOOL_INSTALLBOOT Install disk bootstrap software. [installboot] 706 707TOOL_INSTALL_INFO Update info/dir entries. [install-info] 708 709TOOL_JOIN Relational database operator. [join] 710 711TOOL_M4 M4 macro language processor. [m4] 712 713TOOL_MACPPCFIXCOFF Fix up xcoff headers for macppc. [macppc-fixcoff] 714 715TOOL_MAKEFS Create file system image from directory tree. [makefs] 716 717TOOL_MAKEINFO Translate Texinfo documents. [makeinfo] 718 719TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis] 720 721TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage] 722 723TOOL_MENUC Menu compiler. [menuc] 724 725TOOL_MIPSELF2ECOFF Convert ELF-format executable to ECOFF for mips. 726 [mips-elf2ecoff] 727 728TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper] 729 730TOOL_MKESDB Make encoding scheme database. [mkesdb] 731 732TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale] 733 734TOOL_MKMAGIC Create database for file(1). [file] 735 736TOOL_MKTEMP Make (unique) temporary file name. [mktemp] 737 738TOOL_MSGC Simple message list compiler. [msgc] 739 740TOOL_MTREE Map a directory hierarchy. [mtree] 741 742TOOL_PAX Manipulate file archives and copy directories. [pax] 743 744TOOL_PIC Compile pictures for groff. [pic] 745 746TOOL_POWERPCMKBOOTIMAGE Make bootable image for powerpc. [powerpc-mkbootimage] 747 748TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb] 749 750TOOL_REFER Preprocess bibliographic references for groff. [refer] 751 752TOOL_ROFF_ASCII Generate ASCII groff output. [nroff] 753 754TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi] 755 756TOOL_ROFF_HTML Generate HTML groff output. 757 [${TOOL_GROFF} -Tlatin1 -mdoc2html] 758 759TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps] 760 761TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z] 762 763TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen] 764 765TOOL_SED Stream editor. [sed] 766 767TOOL_SOELIM Eliminate .so's from groff input. [soelim] 768 769TOOL_SPARKCRC Generate a crc suitable for use in a sparkive file. 770 [sparkcrc] 771 772TOOL_STAT Display file status. [stat] 773 774TOOL_STRFILE Create a random access file for storing strings. 775 [strfile] 776 777TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel] 778 779TOOL_TBL Format tables for groff. [tbl] 780 781TOOL_UUDECODE Uudecode a binary file. [uudecode] 782 783TOOL_VGRIND Grind nice listings of programs. [vgrind -f] 784 785TOOL_ZIC Time zone compiler. [zic] 786 787<bsd.own.mk> is generally useful when building your own Makefiles so that 788they use the same default owners etc. as the rest of the tree. 789 790 791=-=-=-=-= bsd.dep.mk =-=-=-=-= 792 793The include file <bsd.dep.mk> contains the default targets for building 794.depend files. It creates .d files from entries in SRCS and DPSRCS 795that are C, C++, or Objective C source files, and builds .depend from the 796.d files. All other files in SRCS and all of DPSRCS will be used as 797dependencies for the .d files. In order for this to function correctly, 798it should be .included after all other .mk files and directives that may 799modify SRCS or DPSRCS. It uses the following variables: 800 801SRCS List of source files to build the program. 802 803DPSRCS List of source files which are needed for generating 804 dependencies, but are not needed in ${SRCS}. 805 806 807=-=-=-=-= bsd.files.mk =-=-=-=-= 808 809The include file <bsd.files.mk> handles the FILES variables and is included 810from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables: 811 812FILES The list of files to install. 813 814CONFIGFILES Similar semantics to FILES, except that the files 815 are installed by the `configinstall' target, 816 not the `install' target. 817 The FILES* variables documented below also apply. 818 819FILESOWN File owner. [${BINOWN}] 820 821FILESGRP File group. [${BINGRP}] 822 823FILESMODE File mode. [${NONBINMODE}] 824 825FILESDIR The location to install the files. 826 827FILESNAME Optional name to install each file as. 828 829FILESOWN_<fn> File owner of the specific file <fn>. 830 831FILESGRP_<fn> File group of the specific file <fn>. 832 833FILESMODE_<fn> File mode of the specific file <fn>. 834 835FILESDIR_<fn> The location to install the specific file <fn>. 836 837FILESNAME_<fn> Optional name to install <fn> as. 838 839FILESBUILD_<fn> A value different from "no" will add the file to the list of 840 targets to be built by `realall'. Users of that variable 841 should provide a target to build the file. 842 843 844BUILDSYMLINKS List of two word items: 845 lnsrc lntgt 846 For each lnsrc item, create a symlink named lntgt. 847 The lntgt symlinks are removed by the cleandir target. 848 849UUDECODE_FILES List of files which are stored as <file>.uue in the source 850 tree. Each one will be decoded with ${TOOL_UUDECODE}. 851 The source files have a `.uue' suffix, the generated files do 852 not. 853 854UUDECODE_FILES_RENAME_<fn> 855 Rename the output from the decode to the provided name. 856 857 *NOTE: These files are simply decoded, with no install or other 858 rule applying implicitly except being added to the clean 859 target. 860 861=-=-=-=-= bsd.gcc.mk =-=-=-=-= 862 863The include file <bsd.gcc.mk> computes various parameters related to GCC 864support libraries. It defines no targets. <bsd.own.mk> MUST be included 865before <bsd.gcc.mk>. 866 867The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each 868of which need to know where to find certain GCC support libraries. 869 870The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable, 871which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then 872the compiler is asked where to find the support libraries, otherwise the 873support libraries are found in ${DESTDIR}/usr/lib. 874 875<bsd.gcc.mk> sets the following variables: 876 877_GCC_CRTBEGIN The full path name to crtbegin.o. 878 879_GCC_CRTBEGINS The full path name to crtbeginS.o. 880 881_GCC_CRTEND The full path name to crtend.o. 882 883_GCC_CRTENDS The full path name to crtendS.o. 884 885_GCC_LIBGCCDIR The directory where libgcc.a is located. 886 887 888=-=-=-=-= bsd.inc.mk =-=-=-=-= 889 890The include file <bsd.inc.mk> defines the includes target and uses the 891variables: 892 893INCS The list of include files. 894 895INCSDIR The location to install the include files. 896 897INCSNAME Target name of the include file, if only one; same as 898 FILESNAME, but for include files. 899 900INCSYMLINKS Similar to SYMLINKS in <bsd.links.mk>, except that these 901 are installed in the 'includes' target and not the 902 (much later) 'install' target. 903 904INCSNAME_<file> The name file <file> should be installed as, if not <file>, 905 same as FILESNAME_<file>, but for include files. 906 907 908=-=-=-=-= bsd.info.mk =-=-=-=-= 909 910The include file <bsd.info.mk> is used to generate and install GNU Info 911documentation from respective Texinfo source files. It defines three 912implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the 913following variables: 914 915TEXINFO List of Texinfo source files. Info documentation will 916 consist of single files with the extension replaced by 917 .info. 918 919INFOFLAGS Flags to pass to makeinfo. [] 920 921 922=-=-=-=-= bsd.kernobj.mk =-=-=-=-= 923 924The include file <bsd.kernobj.mk> defines variables related to the 925location of kernel sources and object directories. 926 927KERNSRCDIR Is the location of the top of the kernel src. 928 [${_SRC_TOP_}/sys] 929 930KERNARCHDIR Is the location of the machine dependent kernel sources. 931 [arch/${MACHINE}] 932 933KERNCONFDIR Is where the configuration files for kernels are found. 934 [${KERNSRCDIR}/${KERNARCHDIR}/conf] 935 936KERNOBJDIR Is the kernel build directory. The kernel GENERIC for 937 instance will be compiled in ${KERNOBJDIR}/GENERIC. 938 The default value is 939 ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile 940 if it exists or the target 'obj' is being made. 941 Otherwise the default is 942 ${KERNSRCDIR}/${KERNARCHDIR}/compile. 943 944It is important that Makefiles (such as those under src/distrib) that 945wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR} 946rather than make assumptions about the location of the compiled kernel. 947 948 949=-=-=-=-= bsd.kinc.mk =-=-=-=-= 950 951The include file <bsd.kinc.mk> defines the many targets (includes, 952subdirectories, etc.), and is used by kernel makefiles to handle 953include file installation. It is intended to be included alone, by 954kernel Makefiles. It uses similar variables to <bsd.inc.mk>. 955Please see <bsd.kinc.mk> for more details, and keep the documentation 956in that file up to date. 957 958 959=-=-=-=-= bsd.lib.mk =-=-=-=-= 960 961The include file <bsd.lib.mk> has support for building libraries. It has 962the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend, 963includes, install, lint, and tags. Additionally, it has a checkver target 964which checks for installed shared object libraries whose version is greater 965that the version of the source. It has a limited number of suffixes, 966consistent with the current needs of the BSD tree. <bsd.lib.mk> includes 967<bsd.shlib.mk> to get shared library parameters. 968 969It sets/uses the following variables: 970 971LIB The name of the library to build. 972 973LIBDIR Target directory for libraries. 974 975MKARZERO Normally, ar(1) sets the timestamps, uid, gid and 976 permissions in files inside its archives to those of 977 the file it was fed. This leads to non-reproduceable 978 builds. If MKARZERO is set to "yes" (default is "no") 979 then the "D" flag is passed to ar, causing the 980 timestamp, uid and gid to be zeroed and the file 981 permissions to be set to 644. This allows .a files 982 from different builds to be bit identical. 983 984SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR} 985 is not "no". 986 987SHLIB_MAJOR 988SHLIB_MINOR 989SHLIB_TEENY Major, minor, and teeny version numbers of shared library 990 991USE_SHLIBDIR If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR} 992 as the path to install shared libraries to. 993 USE_SHLIBDIR must be defined before <bsd.own.mk> is included. 994 Default: no 995 996LIBISMODULE If not "no", install as ${LIB}.so (without the "lib" prefix), 997 and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no 998 MKPROFILE=no MKSTATICLIB=no". 999 Default: no 1000 1001LIBISPRIVATE If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no 1002 MKPROFILE=no", and don't install the (.a) library. 1003 This is useful for "build only" helper libraries. 1004 Default: no 1005 1006LIBISCXX If not "no", Use ${CXX} instead of ${CC} to link 1007 shared libraries. 1008 This is useful for C++ libraries. 1009 Default: no 1010 1011LINTLIBDIR Target directory for lint libraries. 1012 1013LIBGRP Library group. 1014 1015LIBOWN Library owner. 1016 1017LIBMODE Library mode. 1018 1019LDADD Additional loader objects. 1020 1021MAN The manual pages to be installed (use a .1 - .9 suffix). 1022 1023NOCHECKVER_<library> 1024NOCHECKVER If set, disables checking for installed shared object 1025 libraries with versions greater than the source. A 1026 particular library name, without the "lib" prefix, may 1027 be appended to the variable name to disable the check for 1028 only that library. 1029 1030SRCS List of source files to build the library. Suffix types 1031 .s, .c, and .f are supported. Note, .s files are preferred 1032 to .c files of the same name. (This is not the default for 1033 versions of make.) 1034 1035LIBDPLIBS A list of the tuples: 1036 libname path-to-srcdir-of-libname 1037 1038 For each tuple; 1039 * LIBDO.libname contains the .OBJDIR of the library 1040 `libname', and if it is not set it is determined 1041 from the srcdir and added to MAKEOVERRIDES (the 1042 latter is to allow for build time optimization). 1043 * LDADD gets -L${LIBDO.libname} -llibname added. 1044 * DPADD gets ${LIBDO.libname}/liblibname.so or 1045 ${LIBDO.libname}/liblibname.a added. 1046 1047 This variable may be used for individual libraries, as 1048 well as in parent directories to cache common libraries 1049 as a build-time optimization. 1050 1051The include file <bsd.lib.mk> includes the file named "../Makefile.inc" 1052if it exists, as well as the include file <bsd.man.mk>. 1053 1054It has rules for building profiled objects; profiled libraries are 1055built by default. 1056 1057Libraries are ranlib'd when made. 1058 1059 1060=-=-=-=-= bsd.links.mk =-=-=-=-= 1061 1062The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables 1063and is included from from <bsd.lib.mk> and <bsd.prog.mk>. 1064 1065LINKSOWN, LINKSGRP, and LINKSMODE, are relevant only if a metadata log 1066is used. The defaults may be modified by other bsd.*.mk files which 1067include bsd.links.mk. In the future, these variables may be replaced 1068by a method for explicitly recording hard links in a metadata log. 1069 1070LINKS The list of hard links, consisting of pairs of paths: 1071 source-file target-file 1072 ${DESTDIR} is prepended to both paths before linking. 1073 For example, to link /bin/test and /bin/[, use: 1074 LINKS=/bin/test /bin/[ 1075 1076CONFIGLINKS Similar semantics to LINKS, except that the links 1077 are installed by the `configinstall' target, 1078 not the `install' target. 1079 1080SYMLINKS The list of symbolic links, consisting of pairs of paths: 1081 source-file target-file 1082 ${DESTDIR} is only prepended to target-file before linking. 1083 For example, to symlink /usr/bin/tar to /bin/tar resulting 1084 in ${DESTDIR}/usr/bin/tar -> /bin/tar: 1085 SYMLINKS=/bin/tar /usr/bin/tar 1086 1087CONFIGSYMLINKS Similar semantics to SYMLINKS, except that the symbolic links 1088 are installed by the `configinstall' target, 1089 not the `install' target. 1090 1091LINKSOWN Link owner. [${BINOWN}] 1092 1093LINKSGRP Link group. [${BINGRP}] 1094 1095LINKSMODE Link mode. [${NONBINMODE}] 1096 1097LINKSOWN_<fn> Link owner of the specific file <fn>. 1098 1099LINKSGRP_<fn> Link group of the specific file <fn>. 1100 1101LINKSMODE_<fn> Link mode of the specific file <fn>. 1102 1103 1104=-=-=-=-= bsd.man.mk =-=-=-=-= 1105 1106The include file <bsd.man.mk> handles installing manual pages and their 1107links. 1108 1109It has a three targets: 1110 1111 catinstall: 1112 Install the preformatted manual pages and their links. 1113 htmlinstall: 1114 Install the HTML manual pages and their links. 1115 maninstall: 1116 Install the manual page sources and their links. 1117 1118It sets/uses the following variables: 1119 1120MANDIR Base path for manual installation. 1121 1122MANGRP Manual group. 1123 1124MANOWN Manual owner. 1125 1126MANMODE Manual mode. 1127 1128MANSUBDIR Subdirectory under the manual page section, i.e. "/vax" 1129 or "/tahoe" for machine specific manual pages. 1130 1131MAN The manual pages to be installed (use a .1 - .9 suffix). 1132 1133MLINKS List of manual page links (using a .1 - .9 suffix). The 1134 linked-to file must come first, the linked file second, 1135 and there may be multiple pairs. The files are soft-linked. 1136 1137The include file <bsd.man.mk> includes a file named "../Makefile.inc" if 1138it exists. 1139 1140 1141=-=-=-=-= bsd.obj.mk =-=-=-=-= 1142 1143The include file <bsd.obj.mk> defines targets related to the creation 1144and use of separated object and source directories. 1145 1146If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses 1147${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if 1148it exists. Otherwise make(1) looks for the existence of a 1149subdirectory (or a symlink to a directory) of the source directory 1150into which built targets should be placed. If an environment variable 1151named MAKEOBJDIR is set, make(1) uses its value as the name of the 1152object directory; failing that, make first looks for a subdirectory 1153named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj". 1154 1155Object directories are not created automatically by make(1) if they 1156don't exist; you need to run a separate "make obj". (This will happen 1157during a top-level build if "MKOBJDIRS" is set to a value other than 1158"no"). When the source directory is a subdirectory of ${BSDSRCDIR} -- 1159and this is determined by a simple string prefix comparison -- object 1160directories are created in a separate object directory tree, and a 1161symlink to the object directory in that tree is created in the source 1162directory; otherwise, "make obj" assumes that you're not in the main 1163source tree and that it's not safe to use a separate object tree. 1164 1165Several variables used by <bsd.obj.mk> control exactly what 1166directories and links get created during a "make obj": 1167 1168MAKEOBJDIR If set, this is the component name of the object 1169 directory. 1170 1171OBJMACHINE If this is set but MAKEOBJDIR is not set, creates 1172 object directories or links named "obj.${MACHINE}"; 1173 otherwise, just creates ones named "obj". 1174 1175USR_OBJMACHINE If set, and the current directory is a subdirectory of 1176 ${BSDSRCDIR}, create object directory in the 1177 corresponding subdirectory of ${BSDOBJDIR}.${MACHINE}; 1178 otherwise, create it in the corresponding subdirectory 1179 of ${BSDOBJDIR} 1180 1181BUILDID If set, the contents of this variable are appended 1182 to the object directory name. If OBJMACHINE is also 1183 set, ".${BUILDID}" is added after ".${MACHINE}". 1184 1185 1186=-=-=-=-= bsd.prog.mk =-=-=-=-= 1187 1188The include file <bsd.prog.mk> handles building programs from one or 1189more source files, along with their manual pages. It has a limited number 1190of suffixes, consistent with the current needs of the BSD tree. 1191<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters. 1192 1193It has eight targets: 1194 1195 all: 1196 build the program and its manual page. This also 1197 creates a GDB initialization file (.gdbinit) in 1198 the objdir. The .gdbinit file sets the shared library 1199 prefix to ${DESTDIR} to facilitate cross-debugging. 1200 clean: 1201 remove the program, any object files and the files a.out, 1202 Errs, errs, mklog, and ${PROG}.core. 1203 cleandir: 1204 remove all of the files removed by the target clean, as 1205 well as .depend, tags, and any manual pages. 1206 `distclean' is a synonym for `cleandir'. 1207 depend: 1208 make the dependencies for the source files, and store 1209 them in the file .depend. 1210 includes: 1211 install any header files. 1212 install: 1213 install the program and its manual pages; if the Makefile 1214 does not itself define the target install, the targets 1215 beforeinstall and afterinstall may also be used to cause 1216 actions immediately before and after the install target 1217 is executed. 1218 lint: 1219 run lint on the source files 1220 tags: 1221 create a tags file for the source files. 1222 1223It sets/uses the following variables: 1224 1225BINGRP Binary group. 1226 1227BINOWN Binary owner. 1228 1229BINMODE Binary mode. 1230 1231CLEANFILES Additional files to remove for the clean and cleandir targets. 1232 1233COPTS Additional flags to the compiler when creating C objects. 1234 1235COPTS.<fn> Additional flags to the compiler when creating the 1236 C objects for <fn>. 1237 For <fn>.[ly], "<fn>.c" must be used. 1238 1239CPUFLAGS Additional flags to the compiler/assembler to select 1240 CPU instruction set options, CPU tuning options, etc. 1241 1242CPUFLAGS.<fn> Additional flags to the compiler/assembler for <fn>. 1243 For <fn>.[ly], "<fn>.c" must be used. 1244 1245CPPFLAGS Additional flags to the C pre-processor. 1246 1247CPPFLAGS.<fn> Additional flags to the C pre-processor for <fn>. 1248 For <fn>.[ly], "<fn>.c" must be used. 1249 1250GDBINIT List of GDB initialization files to add to "source" 1251 directives in the .gdbinit file that is created in the 1252 objdir. 1253 1254LDADD Additional loader objects. Usually used for libraries. 1255 For example, to load with the compatibility and utility 1256 libraries, use: 1257 1258 LDADD+=-lutil -lcompat 1259 1260LDFLAGS Additional linker flags (passed to ${CC} during link). 1261 1262LINKS See <bsd.links.mk> 1263 1264OBJCOPTS Additional flags to the compiler when creating ObjC objects. 1265 1266OBJCOPTS.<fn> Additional flags to the compiler when creating the 1267 ObjC objects for <fn>. 1268 For <fn>.[ly], "<fn>.c" must be used. 1269 1270SYMLINKS See <bsd.links.mk> 1271 1272MAN Manual pages (should end in .1 - .9). If no MAN variable is 1273 defined, "MAN=${PROG}.1" is assumed. 1274 1275PAXCTL_FLAGS If defined, run paxctl(1) on the program binary after link 1276 time, with the value of this variable as args to paxctl(1). 1277 1278PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS. 1279 1280PROG The name of the program to build. If not supplied, nothing 1281 is built. 1282 1283PROG_CXX If defined, the name of the program to build. Also 1284 causes <bsd.prog.mk> to link the program with the C++ 1285 compiler rather than the C compiler. PROG_CXX overrides 1286 the value of PROG if PROG is also set. 1287 1288PROGNAME The name that the above program will be installed as, if 1289 different from ${PROG}. 1290 1291SRCS List of source files to build the program. If SRCS is not 1292 defined, it's assumed to be ${PROG}.c. 1293 1294DPSRCS List of source files which are needed for generating 1295 dependencies, but are not needed in ${SRCS}. 1296 1297DPADD Additional dependencies for the program. Usually used for 1298 libraries. For example, to depend on the compatibility and 1299 utility libraries use: 1300 1301 DPADD+=${LIBCOMPAT} ${LIBUTIL} 1302 1303 The following libraries are predefined for DPADD: 1304 1305 LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o 1306 LIBARCHIVE?= ${DESTDIR}/usr/lib/libarchive.a 1307 LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a 1308 LIBBLUETOOTH?= ${DESTDIR}/usr/lib/libbluetooth.a 1309 LIBBSDMALLOC?= ${DESTDIR}/usr/lib/libbsdmalloc.a 1310 LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a 1311 LIBC?= ${DESTDIR}/usr/lib/libc.a 1312 LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a 1313 LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a 1314 LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a 1315 LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a 1316 LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a 1317 LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a 1318 LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a 1319 LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a 1320 LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a 1321 LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a 1322 LIBDES?= ${DESTDIR}/usr/lib/libdes.a 1323 LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a 1324 LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a 1325 LIBFETCH?= ${DESTDIR}/usr/lib/libfetch.a 1326 LIBFORM?= ${DESTDIR}/usr/lib/libform.a 1327 LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a 1328 LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a 1329 LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a 1330 LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a 1331 LIBINTL?= ${DESTDIR}/usr/lib/libintl.a 1332 LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a 1333 LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a 1334 LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a 1335 LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a 1336 LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a 1337 LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a 1338 LIBL?= ${DESTDIR}/usr/lib/libl.a 1339 LIBLBER?= ${DESTDIR}/usr/lib/liblber.a 1340 LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a 1341 LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a 1342 LIBM?= ${DESTDIR}/usr/lib/libm.a 1343 LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a 1344 LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a 1345 LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a 1346 LIBPAM?= ${DESTDIR}/usr/lib/libpam.a 1347 LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a 1348 LIBPCI?= ${DESTDIR}/usr/lib/libpci.a 1349 LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a 1350 LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a 1351 LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a 1352 LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a 1353 LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a 1354 LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a 1355 LIBRMT?= ${DESTDIR}/usr/lib/librmt.a 1356 LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a 1357 LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a 1358 LIBRT?= ${DESTDIR}/usr/lib/librt.a 1359 LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a 1360 LIBSL?= ${DESTDIR}/usr/lib/libsl.a 1361 LIBSS?= ${DESTDIR}/usr/lib/libss.a 1362 LIBSSH?= ${DESTDIR}/usr/lib/libssh.a 1363 LIBSSL?= ${DESTDIR}/usr/lib/libssl.a 1364 LIBSSP?= ${DESTDIR}/usr/lib/libssp.a 1365 LIBSTDCXX?= ${DESTDIR}/usr/lib/libstdc++.a 1366 LIBSUPCXX?= ${DESTDIR}/usr/lib/libsupc++.a 1367 LIBTERMINFO?= ${DESTDIR}/usr/lib/libterminfo.a 1368 LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a 1369 LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a 1370 LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a 1371 LIBY?= ${DESTDIR}/usr/lib/liby.a 1372 LIBZ?= ${DESTDIR}/usr/lib/libz.a 1373 1374SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared 1375 strings, using xstr(1). Note that this will not work with 1376 parallel makes. 1377 1378STRIPFLAG The flag passed to the install program to cause the binary 1379 to be stripped. 1380 1381SUBDIR A list of subdirectories that should be built as well. 1382 Each of the targets will execute the same target in the 1383 subdirectories. 1384 1385SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}]. 1386 These are installed exactly like programs. 1387 1388SCRIPTSDIR The location to install the scripts. Each script can be 1389 installed to a separate path by setting SCRIPTSDIR_<script>. 1390 1391SCRIPTSNAME The name that the above program will be installed as, if 1392 different from ${SCRIPTS}. These can be further specialized 1393 by setting SCRIPTSNAME_<script>. 1394 1395FILES See description of <bsd.files.mk>. 1396 1397SHLINKDIR Target directory for shared linker. See description of 1398 <bsd.own.mk> for additional information about this variable. 1399 1400The include file <bsd.prog.mk> includes the file named "../Makefile.inc" 1401if it exists, as well as the include file <bsd.man.mk>. 1402 1403Some simple examples: 1404 1405To build foo from foo.c with a manual page foo.1, use: 1406 1407 PROG= foo 1408 1409 .include <bsd.prog.mk> 1410 1411To build foo from foo.c with a manual page foo.2, add the line: 1412 1413 MAN= foo.2 1414 1415If foo does not have a manual page at all, add the line: 1416 1417 MKMAN= no 1418 1419If foo has multiple source files, add the line: 1420 1421 SRCS= a.c b.c c.c d.c 1422 1423 1424=-=-=-=-= bsd.rpc.mk =-=-=-=-= 1425 1426The include file <bsd.rpc.mk> contains a makefile fragment used to 1427construct source files built by rpcgen. 1428 1429The following macros may be defined in makefiles which include 1430<bsd.rpc.mk> in order to control which files get built and how they 1431are to be built: 1432 1433RPC_INCS: construct .h file from .x file 1434RPC_XDRFILES: construct _xdr.c from .x file 1435 (for marshalling/unmarshalling data types) 1436RPC_SVCFILES: construct _svc.c from .x file 1437 (server-side stubs) 1438RPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES. 1439 1440RPC_XDIR: Directory containing .x/.h files 1441 1442 1443=-=-=-=-= bsd.shlib.mk =-=-=-=-= 1444 1445The include file <bsd.shlib.mk> computes parameters for shared library 1446installation and use. It defines no targets. <bsd.own.mk> MUST be 1447included before <bsd.shlib.mk>. 1448 1449<bsd.own.mk> sets the following variables, if they are not already defined 1450(defaults are in brackets): 1451 1452SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR} 1453 instead of ${LIBDIR} as the base path for shared library 1454 installation. [/lib] 1455 1456SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building 1457 a program. [/lib for programs in /bin and /sbin, /usr/lib 1458 for all others.] 1459 1460_LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no", 1461 otherwise set to ${LIBDIR} 1462 1463SHLINKINSTALLDIR Base path for shared linker. [/libexec] 1464 1465SHLINKDIR Path to use for shared linker when building a program. 1466 [/libexec for programs in /bin and /sbin, /usr/libexec for 1467 all others.] 1468 1469 1470=-=-=-=-= bsd.subdir.mk =-=-=-=-= 1471 1472The include file <bsd.subdir.mk> contains the default targets for building 1473subdirectories. It has the same eight targets as <bsd.prog.mk>: all, 1474clean, cleandir, depend, includes, install, lint, and tags. It uses the 1475following variables: 1476 1477NOSUBDIR If this variable is defined, then the SUBDIR variable 1478 will be ignored and subdirectories will not be processed. 1479 1480SUBDIR For all of the directories listed in ${SUBDIR}, the 1481 specified directory will be visited and the target made. 1482 1483 As a special case, the use of a token .WAIT as an 1484 entry in SUBDIR acts as a synchronization barrier 1485 when multiple make jobs are run; subdirs before the 1486 .WAIT must complete before any subdirs after .WAIT are 1487 started. See make(1) for some caveats on use of .WAIT 1488 and other special sources. 1489 1490 1491=-=-=-=-= bsd.sys.mk =-=-=-=-= 1492 1493The include file <bsd.sys.mk> is used by <bsd.prog.mk> and 1494<bsd.lib.mk>. It contains overrides that are used when building 1495the NetBSD source tree. 1496 1497The following variables control how various files are compiled/built. 1498(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"): 1499 1500AR Create, modify, and extract from archives. [ar] 1501 1502ARFLAGS Options to ${AR}. [rl] 1503 1504AS Assembler. [as] 1505 1506AFLAGS Options to ${CC} when compiling or linking .s or .S 1507 assembly source files. [] 1508 1509BUILDSEED GCC uses random numbers when compiling C++ code. 1510 If this option is present, seed the random number 1511 generator based on the value, source file names and 1512 the output file name to make builds more deterministic. 1513 Additional information is available in the GCC 1514 documentation of -frandom-seed. 1515 1516CC C compiler. [cc] 1517 1518CFLAGS Options to ${CC}. [Usually -O or -O2] 1519 1520CPP C Pre-Processor. [cpp] 1521 1522CPPFLAGS Options to ${CPP}. [] 1523 1524CPUFLAGS Optimization flags for ${CC}. [] 1525 1526CXX C++ compiler. [c++] 1527 1528CXXFLAGS Options to ${CXX}. [${CFLAGS}] 1529 1530ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff] 1531 1532FC Fortran compiler. [f77] 1533 1534FFLAGS Options to {$FC}. [-O] 1535 1536HOST_SH Shell. This must be an absolute path, because it may be 1537 substituted into "#!" lines in scripts. [/bin/sh] 1538 1539INSTALL install(1) command. [install] 1540 1541LEX Lexical analyzer. [lex] 1542 1543LFLAGS Options to ${LEX}. [] 1544 1545LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy] 1546 1547LD Linker. [ld] 1548 1549LDFLAGS Options to ${CC} during the link process. [] 1550 1551LINT C program verifier. [lint] 1552 1553LINTFLAGS Options to ${LINT}. [-chapbxzFS] 1554 1555LORDER List dependencies for object files. [lorder] 1556 1557MAKE make(1). [make] 1558 1559MKDEP Construct Makefile dependency list. [mkdep] 1560 1561NM List symbols from object files. [nm] 1562 1563PC Pascal compiler. [pc] (Not present) 1564 1565PFLAGS Options to ${PC}. [] 1566 1567OBJC Objective C compiler. [${CC}] 1568 1569OBJCFLAGS Options to ${OBJC}. [${CFLAGS}] 1570 1571OBJCOPY Copy and translate object files. [objcopy] 1572 1573OBJDUMP Display information from object files. [objdump] 1574 1575RANLIB Generate index to archive. [ranlib] 1576 1577SIZE List section sizes and total size. [size] 1578 1579STRIP Discard symbols from object files. [strip] 1580 1581TSORT Topological sort of a directed graph. [tsort -q] 1582 1583YACC LALR(1) parser generator. [yacc] 1584 1585YFLAGS Options to ${YACC}. [] 1586 1587YHEADER If defined, add "-d" to YFLAGS, and add dependencies 1588 from <file>.y to <file>.h and <file>.c, and add 1589 <foo>.h to CLEANFILES. 1590 1591YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS. 1592 1593 1594Other variables of note (incomplete list): 1595 1596NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC 1597 that cause warnings to be fatal, such as: 1598 -Werror -Wa,--fatal-warnings 1599 (The latter being for as(1).) 1600 1601WARNS Crank up GCC warning options; the distinct levels are: 1602 WARNS=1 1603 WARNS=2 1604 WARNS=3 1605 WARNS=4 1606 1607=-=-=-=-= bsd.x11.mk =-=-=-=-= 1608 1609The include file <bsd.x11.mk> contains parameters and targets for 1610cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}. 1611It should be included after the general Makefile contents but before 1612the include files such as <bsd.prog.mk> and <bsd.lib.mk>. 1613 1614It provides the following targets: 1615 .man.1 .man.3 .man.4 .man.5 .man.7: 1616 If ${MAN} or ${PROG} is set and ${MKMAN} != "no", 1617 these rules convert from X11's manual page source 1618 into an mdoc.old source file. 1619 cleanx11man: 1620 Clean up the mdoc.old files generated by the above. 1621 1622It sets the following variables: 1623 1624BINDIR Set to ${X11BINDIR}. 1625 To override, define after including <bsd.x11.mk> 1626 1627LIBDIR Set to ${X11USRLIBDIR}. 1628 To override, define after including <bsd.x11.mk> 1629 1630MANDIR Set to ${X11MANDIR}. 1631 To override, define after including <bsd.x11.mk> 1632 1633CPPFLAGS Appended with definitions to include from 1634 ${DESTDIR}${X11INCDIR} 1635 1636LDFLAGS Appended with definitions to link from 1637 ${DESTDIR}${X11USRLIBDIR} 1638 1639X11FLAGS.CONNECTION Equivalent to X11's CONNECTION_FLAGS. 1640 1641X11FLAGS.EXTENSION Equivalent to X11's EXT_DEFINES. 1642 1643X11FLAGS.LOADABLE Equivalent to X11's LOADABLE. 1644 1645X11FLAGS.OS_DEFINES Equivalent to X11's OS_DEFINES. 1646 1647X11FLAGS.SERVER Equivalent to X11's ServerDefines. 1648 1649X11FLAGS.THREADLIB Equivalent to X11's THREADS_DEFINES for libraries. 1650 1651X11FLAGS.THREADS Equivalent to X11's THREADS_DEFINES. 1652 1653X11FLAGS.VERSION cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION. 1654 1655X11FLAGS.DIX Equivalent to X11's DIX_DEFINES. 1656 1657X11TOOL_UNXCOMM Commandline to convert `XCOMM' comments to `#' 1658 1659It uses the following variables: 1660 1661APPDEFS List of app-default files to install. 1662 1663CPPSCRIPTS List of files/scripts to run through cpp(1) 1664 and then ${X11TOOL_UNXCOMM}. The source files 1665 have a `.cpp' suffix, the generated files do not. 1666 1667CPPSCRIPTFLAGS Additional flags to cpp(1) when building CPPSCRIPTS. 1668 1669CPPSCRIPTFLAGS_<fn> Additional flags to cpp(1) when building CPPSCRIPT <fn>. 1670 1671 1672=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 1673