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