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