Annotation of src/share/mk/bsd.README, Revision 1.212
1.212 ! lukem 1: # $NetBSD: bsd.README,v 1.211 2008/07/21 12:12:57 lukem Exp $
1.24 mikel 2: # @(#)bsd.README 8.2 (Berkeley) 4/2/94
1.1 cgd 3:
1.195 rillig 4: This is the README file for the new (as of 1993) make "include" files
5: for the BSD source tree. The files are installed in /usr/share/mk, and
6: are, by convention, named with the suffix ".mk".
1.1 cgd 7:
8: Note, this file is not intended to replace reading through the .mk
9: files for anything tricky.
10:
11: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12:
13: RANDOM THINGS WORTH KNOWING:
14:
15: The files are simply C-style #include files, and pretty much behave like
16: you'd expect. The syntax is slightly different in that a single '.' is
17: used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
18:
19: One difference that will save you lots of debugging time is that inclusion
20: of the file is normally done at the *end* of the Makefile. The reason for
21: this is because .mk files often modify variables and behavior based on the
22: values of variables set in the Makefile. To make this work, remember that
23: the 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:
30: the command "make a" will echo "a". To make things confusing, the SECOND
31: variable 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:
39: the command "make b" will echo "bar". This is for compatibility with the
40: way the V7 make behaved.
41:
42: It's fairly difficult to make the BSD .mk files work when you're building
1.75 agc 43: multiple programs in a single directory. It's a lot easier to split up the
1.1 cgd 44: programs than to deal with the problem. Most of the agony comes from making
1.36 ross 45: the "obj" directory stuff work right, not because we switched to a new version
1.1 cgd 46: of make. So, don't get mad at us, figure out a better way to handle multiple
47: architectures so we can quit using the symbolic link stuff. (Imake doesn't
48: count.)
49:
50: The file .depend in the source directory is expected to contain dependencies
51: for the source files. This file is read automatically by make after reading
52: the Makefile.
53:
54: The variable DESTDIR works as before. It's not set anywhere but will change
55: the tree where the file gets installed.
56:
57: The profiled libraries are no longer built in a different directory than
58: the regular libraries. A new suffix, ".po", is used to denote a profiled
1.21 christos 59: object, and ".so" denotes a shared (position-independent) object.
1.97 itojun 60:
1.142 lukem 61: There are various make variables used during the build.
62:
63: Many variables support a (case sensitive) value of "no" or "yes",
64: and are tested with ${VAR} == "no" and ${VAR} != "no" .
65:
66:
1.172 hubertf 67: The basic rule for the variable naming scheme is as follows:
68:
69: MKxxx Can be set to "no" to disable functionality, or
70: "yes" to enable it.
71: Usually defaults to "yes", although some variables
72: default to "no".
73: Due to make(1) implementation issues, if a temporary
74: command-line override of a mk.conf or <bsd.own.mk>
75: setting is required whilst still honouring a particular
76: Makefile's setting of MKxxx, use
77: env MKxxx=value make
78: instead of
79: make MKxxx=value
80:
81: NOxxx If defined, disables a feature.
82: Not intended for users.
83: This is to allow Makefiles to disable functionality
84: that they don't support (such as missing man pages).
85: NOxxx variables must be defined before <bsd.own.mk>
86: is included.
87:
88: The following variables that control how things are made/installed that
89: are not set by default. These should not be set by Makefiles; they're for
90: the user to define in MAKECONF (see <bsd.own.mk>, below) or on the make(1)
91: command line:
92:
93: BUILD If defined, 'make install' checks that the targets in the
94: source directories are up-to-date and remakes them if they
95: are out of date, instead of blindly trying to install
96: out of date or non-existent targets.
97:
98: MAKEVERBOSE Control how "verbose" the standard make(1) rules are.
99: Default: 2
100: Supported values:
101: 0 Minimal output ("quiet")
102: 1 Describe what is occurring
103: 2 Describe what is occurring and echo the actual command
104:
105:
1.210 gmcgarry 106: MKATF If "no", don't build libatf-c, libatf-c++ libraries associated
107: with the Automated Testing Framework (ATF).
108: Default: yes
109:
1.172 hubertf 110: MKBFD If "no", don't build libbfd, libiberty, or any of the things
111: that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
112: Default: yes
113:
114: MKCATPAGES If "no", don't build or install the catman pages.
115: Default: yes
116:
1.210 gmcgarry 117: MKCOMPLEX If "no", don't build libm support for <complex.h>
118: Default: yes
119:
1.172 hubertf 120: MKCRYPTO If "no", no cryptography support will be built into the system,
1.174 christos 121: and also acts as "MKKERBEROS=no".
1.172 hubertf 122: Default: yes
123:
124: MKCRYPTO_IDEA If not "no", IDEA support will be built into libcrypto_idea.a.
125: Default: no
126:
127: MKCRYPTO_MDC2 If not "no", MDC2 support will be built into libcrypto_mdc2.a
128: Default: no
129:
130: MKCRYPTO_RC5 If not "no", RC5 support will be built into libcrypto_rc5.a.
131: Default: no
132:
133: MKCVS If "no", don't build or install cvs(1).
134: Default: yes
135:
1.184 lukem 136: MKDEBUG If "no", don't build and install separate debugging symbols
137: into /usr/libdata/debug.
138: Default: no
139:
1.183 lukem 140: MKDEBUGLIB Build debugging libraries.
1.176 christos 141: Default: no
142:
1.172 hubertf 143: MKDOC If "no", don't build or install the documentation.
144: Default: yes
145:
146: MKDYNAMICROOT If "no", build programs in /bin and /sbin statically,
147: don't install certain libraries in /lib, and don't
148: install the shared linker into /libexec.
149: Default: yes
150:
1.201 lukem 151: MKGCC If "no", don't build gcc(1) or any of the GCC-related
1.186 mrg 152: libraries (libgcc, libobjc, libstdc++).
1.172 hubertf 153: Default: yes
154:
1.201 lukem 155: MKGCCCMDS If "no", don't build gcc(1), but do build the GCC-related
156: libraries (libgcc, libobjc, libstdc++).
1.172 hubertf 157: Default: yes
158:
159: MKGDB If "no", don't build gdb(1).
160: Default: yes
161:
162: MKHESIOD If "no", disables building of Hesiod infrastructure
163: (libraries and support programs).
164: Default: yes
165:
166: MKHOSTOBJ If not "no", for programs intended to be run on the compile
167: host, the name, release, and architecture of the host
168: operating system will be suffixed to the name of the object
169: directory created by "make obj".
170: Default: no
171:
172: MKHTML If "no", don't build or install the html man pages.
173: Default: no
174:
175: MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance.
176: Has no effect on most platforms.
177: Default: yes
178:
179: MKINET6 If "no", disables building of INET6 (IPv6) infrastructure
180: (libraries and support programs).
181: Default: yes
182:
183: MKINFO If "no", don't build or install Info documentation from
184: Texinfo source files.
185: Default: yes
186:
187: MKIPFILTER If "no", don't build or install the IP Filter programs and LKM.
188: Default: yes
189:
1.208 lukem 190: MKISCSI If "no", don't build or install iSCSI library or applications
1.181 mrg 191: (depends on libpthread.)
192: Default: yes
193:
1.172 hubertf 194: MKKERBEROS If "no", disables building of Kerberos v5
195: infrastructure (libraries and support programs).
196: Default: yes
197:
1.208 lukem 198: MKLDAP If "no", disables building of LDAP infrastructure
199: (libraries and support programs).
200: Default: yes
201:
1.206 lukem 202: MKLINKLIB If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no".
1.172 hubertf 203: Also:
204: - don't install the .a libraries
205: - don't install _pic.a libraries on PIC systems
206: - don't build .a libraries on PIC systems
207: - don't install the .so symlink on ELF systems
208: I.e, only install the shared library (and the .so.major
209: symlink on ELF).
210: Default: yes
211:
212: MKLINT If "no", don't build or install the lint libraries.
213: Default: yes
214:
215: MKMAN If "no", don't build or install the man or catman pages,
216: and also acts as "MKCATPAGES=no MKHTML=no".
217: Default: yes
218:
219: MKMANZ If not "no", compress manual pages at installation time.
220: Default: no
221:
1.200 jmmv 222: MKMODULAR If "no", don't build the versions of modload(8), modstat(8)
223: and modunload(8) that use the new modules framework present
224: in the kernel (enabled separately using 'options MODULAR'
225: int the configuration file). Also don't build any other
226: stuff that may rely on this support, such as tests or kernel
227: modules.
228: Note: This flag will disappear when the new modules framework
229: is complete enough to replace the old LKM, effectively
230: switching it to "yes" by default.
231: Default: no
232:
1.172 hubertf 233: MKNLS If "no", don't build or install the NLS files and locale
234: definition files.
235: Default: yes
236:
237: MKOBJ If "no", don't enable the rule which creates objdirs,
238: and also acts as "MKOBJDIRS=no".
239: Default: yes
240:
241: MKOBJDIRS If "no", don't create objdirs during a "make build".
242: Default: no
243:
244: MKPAM If "no", disables building of PAM authentication
245: infrastructure (libraries and support programs).
1.182 peter 246: Default: yes
1.172 hubertf 247:
1.210 gmcgarry 248: MKPCC If "no", don't build pcc(1) or any of the PCC-related
249: libraries (libpcc, libpccsoftfloat).
250: Default: no
251:
252: MKPCCCMDS If "no", don't build pcc(1), but do build the PCC-related
253: libraries (libpcc, libpccsoftfloat).
254: Default: no
255:
1.172 hubertf 256: MKPF If "no", don't build or install the pf programs and LKM.
257: Default: yes
258:
259: MKPIC If "no", don't build or install shared libraries, and
260: also acts as "MKPICLIB=no"
261: Default: yes (for MACHINE_ARCHs that support it)
262:
263: MKPICINSTALL If "no", don't install the *_pic.a libraries.
264: Default: yes
265:
266: MKPICLIB If "no", don't build *_pic.a libraries, and build the
267: shared object libraries from the .a libraries.
268: A symlink is installed in ${DESTDIR}/usr/lib for the
269: _pic.a library pointing to the .a library.
270: Default: yes
271:
1.198 christos 272: MKPIE If "no", create regular executables. Otherwise create
273: PIE (Position Independent Executables).
274: Default: no
275:
1.172 hubertf 276: MKPOSTFIX If "no", don't build or install postfix(1).
277: Default: yes
278:
279: MKPROFILE If "no", don't build or install the profiling (*_p.a) libraries.
280: Default: yes
281:
1.194 pooka 282: MKPUFFS If "no", don't build librefuse (lib/librefuse) or
283: puffs applications (usr.sbin/puffs). NOTE: libpuffs
284: is always built due to historic reasons. This flag will
285: disappear once puffs is no longer considered experimental,
286: i.e. it will effectively default to "yes".
1.190 pooka 287: Default: no
288:
1.172 hubertf 289: MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
290: MKMAN=no MKNLS=no".
291: I.e, don't build catman pages, documentation, Info
292: documentation, man pages, NLS files, ...
293: Default: yes
294:
295: MKSKEY If "no", disables building of S/key authentication
296: infrastructure (libraries and support programs).
297: Default: yes
298:
299: MKSOFTFLOAT If not "no", build with options to enable the compiler to
300: generate output containing library calls for floating
301: point and possibly soft-float library support.
302: Default: no
303:
304: MKSTATICLIB If "no", don't build or install the normal static (*.a)
305: libraries.
306: Default: yes
307:
308: MKUNPRIVED If not "no", don't set the owner/group/mode when installing
309: files or directories, and keep a metadata log of what
310: the owner/group/mode should be. This allows a
311: non-root "make install".
312: Default: no
313:
314: MKUPDATE If not "no", 'make install' only installs targets that are
315: more recently modified in the source directories that their
316: installed counterparts.
317: Default: no
318:
319: MKX11 If not "no", 'make build' also descends into src/x11
320: to cross build X11R6 and automatically enables creation
321: of X sets.
322: Default: no
323:
324: MKYP If "no", disables building of YP (NIS)
325: infrastructure (libraries and support programs).
326: Default: yes
327:
328: USE_HESIOD If "no", disables building Hesiod support into
329: various system utilities/libraries that support it.
330: If ${MKHESIOD} is "no", USE_HESIOD will also be
331: forced to "no".
332:
333: USE_INET6 If "no", disables building INET6 (IPv6) support into
334: various system utilities/libraries that support it.
335: If ${MKINET6} is "no", USE_INET6 will also be
336: forced to "no".
337:
1.197 ad 338: USE_JEMALLOC If "no", disables building the "jemalloc" allocator
339: designed for improved performance with threaded
340: applications. The "phkmalloc" allocator as used up
341: before NetBSD-5.0 will be substituted.
342:
1.175 christos 343: USE_KERBEROS If "no", disables building Kerberos v5
1.172 hubertf 344: support into various system utilities/libraries that
345: support it. If ${MKKERBEROS} is "no", USE_KERBEROS
346: will also be forced to "no".
347:
1.208 lukem 348: USE_LDAP If "no", disables building LDAP support into various
349: system utilities/libraries that support it.
350: If ${MKLDAP} is "no", USE_LDAP will also be forced to "no".
351:
1.172 hubertf 352: USE_PAM If "no", disables building PAM authentication support
353: into various system utilities/libraries that support it.
354: If ${MKPAM} is "no", USE_PAM will also be forced to "no".
355:
356: USE_SKEY If "no", disables building S/key authentication
357: support into various system utilities/libraries that
358: support it. If ${MKSKEY} is "no", USE_SKEY will
359: also be forced to "no".
1.204 lukem 360: Default: no
1.172 hubertf 361:
1.201 lukem 362: USE_SSP If "no", disables GCC stack protection code, which
1.191 rumble 363: detects stack overflows and aborts the program. This
364: imposes some performance penalty.
365: Default: no
1.187 christos 366:
1.172 hubertf 367: USE_YP If "no", disables building YP (NIS) support into
368: various system utilities/libraries that support it.
369: If ${MKYP} is "no", USE_YP will also be forced to "no".
370:
371: COPTS.lib<lib>
1.177 mrg 372: OBJCOPTS.lib<lib>
1.172 hubertf 373: LDADD.lib<lib>
374: CPPFLAGS.lib<lib>
375: CXXFLAGS.lib<lib>
376: COPTS.<prog>
1.177 mrg 377: OBJCCOPTS.<prog>
1.172 hubertf 378: LDADD.<prog>
379: CPPFLAGS.<prog>
380: CXXFLAGS.<prog> These provide a way to specify additions to the associated
381: variables in a way that applies only to a particular library
382: or program. <lib> corresponds to the LIB variable set in
383: the library's makefile. <prog> corresponds to either PROG
384: or PROG_CXX (if set). For example, if COPTS.libcrypto is
385: set to "-g", "-g" will be added to COPTS only when compiling
386: the crypto library.
1.118 lukem 387:
388: =-=-=-=-= sys.mk =-=-=-=-=
1.1 cgd 389:
390: The include file <sys.mk> has the default rules for all makes, in the BSD
391: environment or otherwise. You probably don't want to touch this file.
392:
1.118 lukem 393: =-=-=-=-= bsd.own.mk =-=-=-=-=
1.1 cgd 394:
1.17 thorpej 395: The include file <bsd.own.mk> contains source tree configuration parameters,
396: such as the owners, groups, etc. for both manual pages and binaries, and
397: a few global "feature configuration" parameters.
1.1 cgd 398:
399: It has no targets.
400:
1.134 lukem 401: To get system-specific configuration parameters, <bsd.own.mk> will try to
1.29 cjs 402: include the file specified by the "MAKECONF" variable. If MAKECONF is not
403: set, or no such file exists, the system make configuration file, /etc/mk.conf
404: is included. These files may define any of the variables described below.
1.17 thorpej 405:
1.134 lukem 406: <bsd.own.mk> sets the following variables, if they are not already defined
1.17 thorpej 407: (defaults are in brackets):
1.15 cgd 408:
1.98 lukem 409: NETBSDSRCDIR Top of the NetBSD source tree.
410: If _SRC_TOP_ != "", that will be used as the default,
411: otherwise BSDSRCDIR will be used as the default.
412: Various makefiles within the NetBSD source tree will
413: use this to reference the top level of the source tree.
414:
1.95 lukem 415: _SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
1.98 lukem 416: based on the presence of tools/ and build.sh. This variable
417: is "internal" to <bsd.own.mk>, although its value is only
418: determined once and then propagated to all sub-makes.
1.95 lukem 419:
1.15 cgd 420: BSDSRCDIR The real path to the system sources, so that 'make obj'
1.116 lukem 421: will work correctly. [/usr/src]
1.15 cgd 422:
423: BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
1.116 lukem 424: will work correctly. [/usr/obj]
1.15 cgd 425:
1.116 lukem 426: BINGRP Binary group. [wheel]
1.15 cgd 427:
1.116 lukem 428: BINOWN Binary owner. [root]
1.15 cgd 429:
1.116 lukem 430: BINMODE Binary mode. [555]
1.15 cgd 431:
1.116 lukem 432: NONBINMODE Mode for non-executable files. [444]
1.15 cgd 433:
1.116 lukem 434: MANDIR Base path for manual installation. [/usr/share/man/cat]
1.15 cgd 435:
1.116 lukem 436: MANGRP Manual group. [wheel]
1.15 cgd 437:
1.116 lukem 438: MANOWN Manual owner. [root]
1.15 cgd 439:
1.116 lukem 440: MANMODE Manual mode. [${NONBINMODE}]
1.15 cgd 441:
1.21 christos 442: MANINSTALL Manual installation type: maninstall, catinstall, or both
1.155 jmc 443: [maninstall catinstall]
1.76 fair 444:
445: LDSTATIC Control program linking; if set blank, link everything
1.129 lukem 446: dynamically. If set to "-static", link everything statically.
1.76 fair 447: If not set, programs link according to their makefile.
1.21 christos 448:
1.116 lukem 449: LIBDIR Base path for library installation. [/usr/lib]
1.15 cgd 450:
1.116 lukem 451: LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
1.15 cgd 452:
1.116 lukem 453: LIBGRP Library group. [${BINGRP}]
1.15 cgd 454:
1.116 lukem 455: LIBOWN Library owner. [${BINOWN}]
1.15 cgd 456:
1.116 lukem 457: LIBMODE Library mode. [${NONBINMODE}]
1.15 cgd 458:
459: DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
1.116 lukem 460: installation. [/usr/share/doc]
1.62 simonb 461:
462: HTMLDOCDIR Base path for html system documentation installation.
463: [/usr/share/doc/html]
1.15 cgd 464:
1.116 lukem 465: DOCGRP Documentation group. [wheel]
1.15 cgd 466:
1.116 lukem 467: DOCOWN Documentation owner. [root]
1.15 cgd 468:
1.116 lukem 469: DOCMODE Documentation mode. [${NONBINMODE}]
1.15 cgd 470:
1.84 kleink 471: NLSDIR Base path for Native Language Support files installation.
1.15 cgd 472: [/usr/share/nls]
1.1 cgd 473:
1.116 lukem 474: NLSGRP Native Language Support files group. [wheel]
1.1 cgd 475:
1.116 lukem 476: NLSOWN Native Language Support files owner. [root]
1.1 cgd 477:
1.116 lukem 478: NLSMODE Native Language Support files mode. [${NONBINMODE}]
1.1 cgd 479:
1.144 lukem 480: X11SRCDIR The path to the xsrc tree. [/usr/xsrc]
481:
482: X11SRCDIR.xc The path to the X11R6 xc src tree. [${X11SRCDIR}/xfree/xc]
483:
484: X11SRCDIR.local The path to the local X11R6 src tree. [${X11SRCDIR}/local]
485:
486: X11ROOTDIR Root directory of the X11 installation. [/usr/X11R6]
487:
488: X11BINDIR X11 bin directory. [${X11ROOTDIR}/bin]
489:
490: X11FONTDIR X11 font directory. [${X11ROOTDIR}/lib/X11/fonts]
491:
492: X11INCDIR X11 include directory. [${X11ROOTDIR}/include]
493:
494: X11LIBDIR X11 lib/x11 (config) directory. [${X11ROOTDIR}/lib/X11]
495:
496: X11MANDIR X11 manual directory. [${X11ROOTDIR}/man]
497:
498: X11USRLIBDIR X11 library directory. [${X11ROOTDIR}/lib]
499:
1.32 mikel 500: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 501: to be stripped. This is to be used when building your
502: own install script so that the entire system can be made
1.146 lukem 503: stripped/not-stripped using a single knob. []
1.1 cgd 504:
1.2 cgd 505: COPY The flag passed to the install program to cause the binary
506: to be copied rather than moved. This is to be used when
507: building our own install script so that the entire system
508: can either be installed with copies, or with moves using
1.116 lukem 509: a single knob. [-c]
1.15 cgd 510:
1.150 lukem 511: MAKEDIRTARGET dir target [params]
512: Runs "cd $${dir} && ${MAKE} [params] $${target}",
513: displaying a "pretty" message whilst doing so.
514:
1.152 cl 515: RELEASEMACHINEDIR
516: Subdirectory used below RELEASEDIR when building
517: a release. [${MACHINE}]
518:
519: RELEASEMACHINE Subdirectory or path component used for the following
520: paths:
521: distrib/${RELEASEMACHINE}
522: distrib/notes/${RELEASEMACHINE}
523: etc/etc.${RELEASEMACHINE}
524: Used when building a release. [${MACHINE}]
1.150 lukem 525:
1.134 lukem 526: Additionally, the following variables may be set by <bsd.own.mk> or in a
1.17 thorpej 527: make configuration file to modify the behaviour of the system build
528: process (default values are in brackets along with comments, if set by
1.134 lukem 529: <bsd.own.mk>):
1.33 jonathan 530:
1.172 hubertf 531: USETOOLS Indicates whether the tools specified by ${TOOLDIR} should
532: be used as part of a build in progress.
533: Supported values:
534:
535: yes Use the tools from TOOLDIR.
536: Must be set to this if cross-compiling.
537:
538: no Do not use the tools from TOOLDIR, but refuse to
539: build native compilation tool components that are
540: version-specific for that tool.
541:
542: never Do not use the tools from TOOLDIR, even when
543: building native tool components. This is similar to
544: the traditional NetBSD build method, but does not
545: verify that the compilation tools in use are
546: up-to-date enough in order to build the tree
547: successfully. This may cause build or runtime
548: problems when building the whole NetBSD source tree.
549:
550: Default: "yes" if building all or part of a whole NetBSD
551: source tree (detected automatically); "no" otherwise
552: (to preserve traditional semantics of the <bsd.*.mk>
553: make(1) include files).
1.142 lukem 554:
1.116 lukem 555: OBJECT_FMT Object file format. [set to "ELF" on architectures that
1.199 simonb 556: use ELF -- currently all architectures].
1.33 jonathan 557:
1.103 thorpej 558: TOOLCHAIN_MISSING
1.142 lukem 559: If not "no", this indicates that the platform being built
1.103 thorpej 560: does not have a working in-tree toolchain. If the
1.142 lukem 561: ${MACHINE_ARCH} in question falls into this category,
562: TOOLCHAIN_MISSING is conditionally assigned the value "yes".
1.103 thorpej 563: Otherwise, the variable is unconditionally assigned the
564: value "no".
1.142 lukem 565: If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are
566: unconditionally assigned the value "no".
1.103 thorpej 567:
568: EXTERNAL_TOOLCHAIN
569: This variable is not directly set by <bsd.own.mk>, but
570: including <bsd.own.mk> is the canonical way to gain
571: access to this variable. The variable should be defined
572: either in the user's environment or in the user's mk.conf
573: file. If defined, this variable indicates the root of
574: an external toolchain which will be used to build the
1.142 lukem 575: tree. For example, if a platform is a ${TOOLCHAIN_MISSING}
1.103 thorpej 576: platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
577: cross-compile framework.
578:
1.142 lukem 579: If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally
580: assigned the value "no", since the external version of the
581: compiler may not be able to build the library components of
582: the in-tree compiler.
1.103 thorpej 583:
584: NOTE: This variable is not yet used in as many places as
585: it should be. Expect the exact semantics of this variable
586: to change in the short term as parts of the cross-compile
587: framework continue to be cleaned up.
1.1 cgd 588:
1.134 lukem 589: <bsd.own.mk> is generally useful when building your own Makefiles so that
1.1 cgd 590: they use the same default owners etc. as the rest of the tree.
1.131 lukem 591:
592:
593: =-=-=-=-= bsd.dep.mk =-=-=-=-=
594:
595: The include file <bsd.dep.mk> contains the default targets for building
1.133 lukem 596: .depend files. It creates .d files from entries in SRCS and DPSRCS
597: that are C, C++, or Objective C source files, and builds .depend from the
598: .d files. All other files in SRCS and all of DPSRCS will be used as
599: dependencies for the .d files. In order for this to function correctly,
1.132 lukem 600: it should be .included after all other .mk files and directives that may
601: modify SRCS or DPSRCS. It uses the following variables:
602:
603: SRCS List of source files to build the program.
604:
605: DPSRCS List of source files which are needed for generating
606: dependencies, but are not needed in ${SRCS}.
1.1 cgd 607:
608:
1.118 lukem 609: =-=-=-=-= bsd.files.mk =-=-=-=-=
1.106 thorpej 610:
1.118 lukem 611: The include file <bsd.files.mk> handles the FILES variables and is included
1.134 lukem 612: from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
1.124 lukem 613:
614: FILES The list of files to install.
615:
1.153 lukem 616: CONFIGFILES Similar semantics to FILES, except that the files
617: are installed by the `configinstall' target,
618: not the `install' target.
619: The FILES* variables documented below also apply.
620:
1.124 lukem 621: FILESOWN File owner. [${BINOWN}]
622:
623: FILESGRP File group. [${BINGRP}]
624:
1.203 dholland 625: FILESMODE File mode. [${NONBINMODE}]
1.124 lukem 626:
627: FILESDIR The location to install the files.
628:
629: FILESNAME Optional name to install each file as.
630:
1.153 lukem 631: FILESOWN_<fn> File owner of the specific file <fn>.
632:
633: FILESGRP_<fn> File group of the specific file <fn>.
634:
635: FILESMODE_<fn> File mode of the specific file <fn>.
636:
1.202 uwe 637: FILESDIR_<fn> The location to install the specific file <fn>.
1.153 lukem 638:
639: FILESNAME_<fn> Optional name to install <fn> as.
1.124 lukem 640:
1.135 lukem 641:
1.139 lukem 642: BUILDSYMLINKS List of two word items:
1.135 lukem 643: lnsrc lntgt
644: For each lnsrc item, create a symlink named lntgt.
645: The lntgt symlinks are removed by the cleandir target.
1.106 thorpej 646:
1.148 jmc 647: UUDECODE_FILES List of files which are stored as <file>.uue in the source
648: tree. Each one will be decoded with ${TOOL_UUDECODE}.
649: The source files have a `.uue' suffix, the generated files do
650: not.
1.149 jmc 651:
1.202 uwe 652: UUDECODE_FILES_RENAME_<fn>
653: Rename the output from the decode to the provided name.
1.148 jmc 654:
655: *NOTE: These files are simply decoded, with no install or other
656: rule applying implicitly except being added to the clean
657: target.
1.106 thorpej 658:
1.118 lukem 659: =-=-=-=-= bsd.gcc.mk =-=-=-=-=
1.113 thorpej 660:
661: The include file <bsd.gcc.mk> computes various parameters related to GCC
662: support libraries. It defines no targets. <bsd.own.mk> MUST be included
1.134 lukem 663: before <bsd.gcc.mk>.
1.113 thorpej 664:
1.134 lukem 665: The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
1.113 thorpej 666: of which need to know where to find certain GCC support libraries.
667:
1.134 lukem 668: The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
1.113 thorpej 669: which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then
670: the compiler is asked where to find the support libraries, otherwise the
671: support libraries are found in ${DESTDIR}/usr/lib.
672:
1.134 lukem 673: <bsd.gcc.mk> sets the following variables:
1.113 thorpej 674:
1.118 lukem 675: _GCC_CRTBEGIN The full path name to crtbegin.o.
676:
677: _GCC_CRTBEGINS The full path name to crtbeginS.o.
678:
679: _GCC_CRTEND The full path name to crtend.o.
680:
681: _GCC_CRTENDS The full path name to crtendS.o.
682:
683: _GCC_LIBGCCDIR The directory where libgcc.a is located.
684:
685:
686: =-=-=-=-= bsd.inc.mk =-=-=-=-=
687:
1.134 lukem 688: The include file <bsd.inc.mk> defines the includes target and uses the
1.118 lukem 689: variables:
690:
1.124 lukem 691: INCS The list of include files.
1.118 lukem 692:
693: INCSDIR The location to install the include files.
694:
695: INCSNAME Target name of the include file, if only one; same as
696: FILESNAME, but for include files.
697:
1.134 lukem 698: INCSYMLINKS Similar to SYMLINKS in <bsd.links.mk>, except that these
699: are installed in the 'includes' target and not the
700: (much later) 'install' target.
701:
1.118 lukem 702: INCSNAME_<file> The name file <file> should be installed as, if not <file>,
703: same as FILESNAME_<file>, but for include files.
704:
705:
706: =-=-=-=-= bsd.info.mk =-=-=-=-=
707:
708: The include file <bsd.info.mk> is used to generate and install GNU Info
709: documentation from respective Texinfo source files. It defines three
710: implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
711: following variables:
712:
713: TEXINFO List of Texinfo source files. Info documentation will
714: consist of single files with the extension replaced by
715: .info.
716:
717: INFOFLAGS Flags to pass to makeinfo. []
718:
719:
720: =-=-=-=-= bsd.kernobj.mk =-=-=-=-=
721:
722: The include file <bsd.kernobj.mk> defines variables related to the
723: location of kernel sources and object directories.
724:
725: KERNSRCDIR Is the location of the top of the kernel src.
1.124 lukem 726: [${_SRC_TOP_}/sys]
1.118 lukem 727:
1.124 lukem 728: KERNARCHDIR Is the location of the machine dependent kernel sources.
729: [arch/${MACHINE}]
1.120 lukem 730:
1.124 lukem 731: KERNCONFDIR Is where the configuration files for kernels are found.
732: [${KERNSRCDIR}/${KERNARCHDIR}/conf]
1.118 lukem 733:
734: KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
735: instance will be compiled in ${KERNOBJDIR}/GENERIC.
736: The default value is
737: ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
738: if it exists or the target 'obj' is being made.
739: Otherwise the default is
740: ${KERNSRCDIR}/${KERNARCHDIR}/compile.
741:
742: It is important that Makefiles (such as those under src/distrib) that
1.134 lukem 743: wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
1.118 lukem 744: rather than make assumptions about the location of the compiled kernel.
745:
746:
747: =-=-=-=-= bsd.kinc.mk =-=-=-=-=
748:
749: The include file <bsd.kinc.mk> defines the many targets (includes,
750: subdirectories, etc.), and is used by kernel makefiles to handle
751: include file installation. It is intended to be included alone, by
1.134 lukem 752: kernel Makefiles. It uses similar variables to <bsd.inc.mk>.
753: Please see <bsd.kinc.mk> for more details, and keep the documentation
754: in that file up to date.
1.118 lukem 755:
756:
757: =-=-=-=-= bsd.lib.mk =-=-=-=-=
758:
759: The include file <bsd.lib.mk> has support for building libraries. It has
760: the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
761: includes, install, lint, and tags. Additionally, it has a checkver target
762: which checks for installed shared object libraries whose version is greater
763: that the version of the source. It has a limited number of suffixes,
1.134 lukem 764: consistent with the current needs of the BSD tree. <bsd.lib.mk> includes
1.118 lukem 765: <bsd.shlib.mk> to get shared library parameters.
766:
767: It sets/uses the following variables:
768:
769: LIB The name of the library to build.
770:
771: LIBDIR Target directory for libraries.
772:
773: SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
1.142 lukem 774: is not "no".
1.118 lukem 775:
1.142 lukem 776: USE_SHLIBDIR If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
1.118 lukem 777: as the path to install shared libraries to.
778: USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
1.130 lukem 779: Default: no
1.118 lukem 780:
1.211 lukem 781: LIBISPRIVATE If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no
782: MKPROFILE=no", and don't install the (.a) library.
1.154 lukem 783: This is useful for "build only" helper libraries.
784: Default: no
785:
1.118 lukem 786: LINTLIBDIR Target directory for lint libraries.
787:
788: LIBGRP Library group.
789:
790: LIBOWN Library owner.
791:
792: LIBMODE Library mode.
793:
794: LDADD Additional loader objects.
795:
796: MAN The manual pages to be installed (use a .1 - .9 suffix).
797:
798: NOCHECKVER_<library>
799: NOCHECKVER If set, disables checking for installed shared object
800: libraries with versions greater than the source. A
801: particular library name, without the "lib" prefix, may
802: be appended to the variable name to disable the check for
803: only that library.
804:
805: SRCS List of source files to build the library. Suffix types
806: .s, .c, and .f are supported. Note, .s files are preferred
807: to .c files of the same name. (This is not the default for
808: versions of make.)
809:
1.157 lukem 810: LIBDPLIBS A list of the tuples:
811: libname path-to-srcdir-of-libname
812:
813: For each tuple;
814: * LIBDO.libname contains the .OBJDIR of the library
815: `libname', and if it is not set it is determined
816: from the srcdir and added to MAKEOVERRIDES (the
817: latter is to allow for build time optimization).
818: * LDADD gets -L${LIBDO.libname} -llibname added.
819: * DPADD gets ${LIBDO.libname}/liblibname.so or
820: ${LIBDO.libname}/liblibname.a added.
821:
822: This variable may be used for individual libraries, as
823: well as in parent directories to cache common libraries
824: as a build-time optimization.
825:
1.118 lukem 826: The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
827: if it exists, as well as the include file <bsd.man.mk>.
828:
829: It has rules for building profiled objects; profiled libraries are
830: built by default.
831:
832: Libraries are ranlib'd when made.
833:
834:
835: =-=-=-=-= bsd.links.mk =-=-=-=-=
836:
837: The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
1.134 lukem 838: and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
839:
840: LINKS The list of hard links, consisting of pairs of paths:
841: source-file target-file
842: ${DESTDIR} is prepended to both paths before linking.
843: For example, to link /bin/test and /bin/[, use:
844: LINKS=/bin/test /bin/[
845:
1.153 lukem 846: CONFIGLINKS Similar semantics to LINKS, except that the links
847: are installed by the `configinstall' target,
848: not the `install' target.
849:
1.134 lukem 850: SYMLINKS The list of symbolic links, consisting of pairs of paths:
851: source-file target-file
852: ${DESTDIR} is only prepended to target-file before linking.
853: For example, to symlink /usr/bin/tar to /bin/tar resulting
854: in ${DESTDIR}/usr/bin/tar -> /bin/tar:
855: SYMLINKS=/bin/tar /usr/bin/tar
1.118 lukem 856:
1.153 lukem 857: CONFIGSYMLINKS Similar semantics to SYMLINKS, except that the symbolic links
858: are installed by the `configinstall' target,
859: not the `install' target.
860:
1.118 lukem 861:
862: =-=-=-=-= bsd.man.mk =-=-=-=-=
863:
864: The include file <bsd.man.mk> handles installing manual pages and their
865: links.
866:
867: It has a two targets:
868:
869: maninstall:
870: Install the manual page sources and their links.
871: catinstall:
872: Install the preformatted manual pages and their links.
873:
874: It sets/uses the following variables:
875:
876: MANDIR Base path for manual installation.
877:
878: MANGRP Manual group.
879:
880: MANOWN Manual owner.
881:
882: MANMODE Manual mode.
883:
884: MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
885: or "/tahoe" for machine specific manual pages.
886:
887: MAN The manual pages to be installed (use a .1 - .9 suffix).
888:
889: MLINKS List of manual page links (using a .1 - .9 suffix). The
890: linked-to file must come first, the linked file second,
891: and there may be multiple pairs. The files are soft-linked.
892:
893: The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
894: it exists.
895:
896:
897: =-=-=-=-= bsd.obj.mk =-=-=-=-=
898:
899: The include file <bsd.obj.mk> defines targets related to the creation
900: and use of separated object and source directories.
901:
902: If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
903: ${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
904: it exists. Otherwise make(1) looks for the existence of a
905: subdirectory (or a symlink to a directory) of the source directory
906: into which built targets should be placed. If an environment variable
907: named MAKEOBJDIR is set, make(1) uses its value as the name of the
908: object directory; failing that, make first looks for a subdirectory
909: named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
910:
911: Object directories are not created automatically by make(1) if they
912: don't exist; you need to run a separate "make obj". (This will happen
913: during a top-level build if "MKOBJDIRS" is set to a value other than
914: "no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
915: and this is determined by a simple string prefix comparison -- object
916: directories are created in a separate object directory tree, and a
917: symlink to the object directory in that tree is created in the source
918: directory; otherwise, "make obj" assumes that you're not in the main
919: source tree and that it's not safe to use a separate object tree.
920:
921: Several variables used by <bsd.obj.mk> control exactly what
922: directories and links get created during a "make obj":
923:
924: MAKEOBJDIR If set, this is the component name of the object
925: directory.
926:
927: OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
928: object directories or links named "obj.${MACHINE}";
929: otherwise, just creates ones named "obj".
930:
931: USR_OBJMACHINE If set, and the current directory is a subdirectory of
932: ${BSDSRCDIR}, create object directory in the
933: corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
934: otherwise, create it in the corresponding subdirectory
935: of ${BSDOBJDIR}
1.113 thorpej 936:
1.118 lukem 937: BUILDID If set, the contents of this variable are appended
938: to the object directory name. If OBJMACHINE is also
939: set, ".${BUILDID}" is added after ".${MACHINE}".
1.113 thorpej 940:
1.106 thorpej 941:
1.118 lukem 942: =-=-=-=-= bsd.prog.mk =-=-=-=-=
1.106 thorpej 943:
1.1 cgd 944: The include file <bsd.prog.mk> handles building programs from one or
945: more source files, along with their manual pages. It has a limited number
1.134 lukem 946: of suffixes, consistent with the current needs of the BSD tree.
947: <bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
1.1 cgd 948:
1.16 jtc 949: It has eight targets:
1.1 cgd 950:
951: all:
1.102 thorpej 952: build the program and its manual page. This also
953: creates a GDB initialization file (.gdbinit) in
954: the objdir. The .gdbinit file sets the shared library
955: prefix to ${DESTDIR} to facilitate cross-debugging.
1.1 cgd 956: clean:
957: remove the program, any object files and the files a.out,
1.24 mikel 958: Errs, errs, mklog, and ${PROG}.core.
1.1 cgd 959: cleandir:
960: remove all of the files removed by the target clean, as
961: well as .depend, tags, and any manual pages.
1.42 lukem 962: `distclean' is a synonym for `cleandir'.
1.1 cgd 963: depend:
964: make the dependencies for the source files, and store
965: them in the file .depend.
1.16 jtc 966: includes:
967: install any header files.
1.1 cgd 968: install:
969: install the program and its manual pages; if the Makefile
970: does not itself define the target install, the targets
971: beforeinstall and afterinstall may also be used to cause
972: actions immediately before and after the install target
973: is executed.
974: lint:
975: run lint on the source files
976: tags:
977: create a tags file for the source files.
978:
979: It sets/uses the following variables:
980:
981: BINGRP Binary group.
982:
983: BINOWN Binary owner.
984:
985: BINMODE Binary mode.
986:
987: CLEANFILES Additional files to remove for the clean and cleandir targets.
988:
989: COPTS Additional flags to the compiler when creating C objects.
1.112 thorpej 990:
1.125 lukem 991: COPTS.<fn> Additional flags to the compiler when creating the
992: C objects for <fn>.
993: For <fn>.[ly], "<fn>.c" must be used.
994:
1.112 thorpej 995: CPUFLAGS Additional flags to the compiler/assembler to select
996: CPU instruction set options, CPU tuning options, etc.
1.35 lukem 997:
1.125 lukem 998: CPUFLAGS.<fn> Additional flags to the compiler/assembler for <fn>.
999: For <fn>.[ly], "<fn>.c" must be used.
1000:
1.124 lukem 1001: CPPFLAGS Additional flags to the C pre-processor.
1.125 lukem 1002:
1003: CPPFLAGS.<fn> Additional flags to the C pre-processor for <fn>.
1004: For <fn>.[ly], "<fn>.c" must be used.
1.102 thorpej 1005:
1006: GDBINIT List of GDB initialization files to add to "source"
1007: directives in the .gdbinit file that is created in the
1008: objdir.
1.1 cgd 1009:
1010: LDADD Additional loader objects. Usually used for libraries.
1011: For example, to load with the compatibility and utility
1012: libraries, use:
1013:
1.5 jtc 1014: LDADD+=-lutil -lcompat
1.1 cgd 1015:
1.178 lukem 1016: LDFLAGS Additional linker flags (passed to ${CC} during link).
1.1 cgd 1017:
1.134 lukem 1018: LINKS See <bsd.links.mk>
1019:
1.177 mrg 1020: OBJCOPTS Additional flags to the compiler when creating ObjC objects.
1021:
1022: OBJCOPTS.<fn> Additional flags to the compiler when creating the
1023: ObjC objects for <fn>.
1024: For <fn>.[ly], "<fn>.c" must be used.
1025:
1.134 lukem 1026: SYMLINKS See <bsd.links.mk>
1.1 cgd 1027:
1.15 cgd 1028: MAN Manual pages (should end in .1 - .9). If no MAN variable is
1.8 cgd 1029: defined, "MAN=${PROG}.1" is assumed.
1.1 cgd 1030:
1.212 ! lukem 1031: PAXCTL_FLAGS If defined, run paxctl(1) on the program binarry after link
! 1032: time, with the value of this variable as args to paxctl(1).
1.193 perry 1033:
1034: PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1035:
1.1 cgd 1036: PROG The name of the program to build. If not supplied, nothing
1037: is built.
1038:
1.88 thorpej 1039: PROG_CXX If defined, the name of the program to build. Also
1040: causes <bsd.prog.mk> to link the program with the C++
1041: compiler rather than the C compiler. PROG_CXX overrides
1042: the value of PROG if PROG is also set.
1.87 thorpej 1043:
1.21 christos 1044: PROGNAME The name that the above program will be installed as, if
1045: different from ${PROG}.
1046:
1.37 tv 1047: SRCS List of source files to build the program. If SRCS is not
1.1 cgd 1048: defined, it's assumed to be ${PROG}.c.
1.108 jwise 1049:
1050: DPSRCS List of source files which are needed for generating
1051: dependencies, but are not needed in ${SRCS}.
1.1 cgd 1052:
1053: DPADD Additional dependencies for the program. Usually used for
1054: libraries. For example, to depend on the compatibility and
1055: utility libraries use:
1056:
1.5 jtc 1057: DPADD+=${LIBCOMPAT} ${LIBUTIL}
1.1 cgd 1058:
1059: The following libraries are predefined for DPADD:
1060:
1.21 christos 1061: LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
1.196 joerg 1062: LIBARCHIVE?= ${DESTDIR}/usr/lib/libarchive.a
1.159 lukem 1063: LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a
1.180 gdamore 1064: LIBBLUETOOTH?= ${DESTDIR}/usr/lib/libbluetooth.a
1.159 lukem 1065: LIBBSDMALLOC?= ${DESTDIR}/usr/lib/libbsdmalloc.a
1.99 itojun 1066: LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a
1.21 christos 1067: LIBC?= ${DESTDIR}/usr/lib/libc.a
1068: LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
1.99 itojun 1069: LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a
1.21 christos 1070: LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
1071: LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
1.99 itojun 1072: LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a
1073: LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1.105 itojun 1074: LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1.99 itojun 1075: LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
1.21 christos 1076: LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
1077: LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
1078: LIBDES?= ${DESTDIR}/usr/lib/libdes.a
1079: LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1.114 provos 1080: LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
1.73 blymn 1081: LIBFORM?= ${DESTDIR}/usr/lib/libform.a
1.21 christos 1082: LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
1083: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.99 itojun 1084: LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a
1085: LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a
1.70 itojun 1086: LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
1.49 itojun 1087: LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
1.99 itojun 1088: LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
1089: LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a
1090: LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a
1091: LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a
1.21 christos 1092: LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
1093: LIBL?= ${DESTDIR}/usr/lib/libl.a
1.208 lukem 1094: LIBLBER?= ${DESTDIR}/usr/lib/liblber.a
1095: LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a
1.209 lukem 1096: LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a
1.21 christos 1097: LIBM?= ${DESTDIR}/usr/lib/libm.a
1.53 blymn 1098: LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
1.99 itojun 1099: LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a
1100: LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a
1.159 lukem 1101: LIBPAM?= ${DESTDIR}/usr/lib/libpam.a
1.21 christos 1102: LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
1.99 itojun 1103: LIBPCI?= ${DESTDIR}/usr/lib/libpci.a
1.100 thorpej 1104: LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a
1.26 kleink 1105: LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
1.110 thorpej 1106: LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a
1107: LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1.163 christos 1108: LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a
1.21 christos 1109: LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
1.99 itojun 1110: LIBRMT?= ${DESTDIR}/usr/lib/librmt.a
1111: LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a
1.21 christos 1112: LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
1.110 thorpej 1113: LIBRT?= ${DESTDIR}/usr/lib/librt.a
1.180 gdamore 1114: LIBSDP?= ${DESTDIR}/usr/lib/libsdp.a
1.21 christos 1115: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
1.140 lukem 1116: LIBSL?= ${DESTDIR}/usr/lib/libsl.a
1.99 itojun 1117: LIBSS?= ${DESTDIR}/usr/lib/libss.a
1.159 lukem 1118: LIBSSH?= ${DESTDIR}/usr/lib/libssh.a
1.99 itojun 1119: LIBSSL?= ${DESTDIR}/usr/lib/libssl.a
1.187 christos 1120: LIBSSP?= ${DESTDIR}/usr/lib/libssp.a
1.140 lukem 1121: LIBSTDCXX?= ${DESTDIR}/usr/lib/libstdc++.a
1.186 mrg 1122: LIBSUPCXX?= ${DESTDIR}/usr/lib/libsupc++.a
1.21 christos 1123: LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
1.99 itojun 1124: LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a
1.21 christos 1125: LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
1126: LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
1127: LIBY?= ${DESTDIR}/usr/lib/liby.a
1128: LIBZ?= ${DESTDIR}/usr/lib/libz.a
1.1 cgd 1129:
1130: SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
1.12 christos 1131: strings, using xstr(1). Note that this will not work with
1132: parallel makes.
1.1 cgd 1133:
1.59 jlam 1134: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 1135: to be stripped.
1136:
1137: SUBDIR A list of subdirectories that should be built as well.
1138: Each of the targets will execute the same target in the
1139: subdirectories.
1140:
1.21 christos 1141: SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1142: These are installed exactly like programs.
1143:
1.166 rtr 1144: SCRIPTSDIR The location to install the scripts. Each script can be
1145: installed to a separate path by setting SCRIPTSDIR_<script>.
1146:
1.21 christos 1147: SCRIPTSNAME The name that the above program will be installed as, if
1148: different from ${SCRIPTS}. These can be further specialized
1149: by setting SCRIPTSNAME_<script>.
1150:
1.124 lukem 1151: FILES See description of <bsd.files.mk>.
1.21 christos 1152:
1.106 thorpej 1153: SHLINKDIR Target directory for shared linker. See description of
1154: <bsd.own.mk> for additional information about this variable.
1.130 lukem 1155:
1.1 cgd 1156: The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1157: if it exists, as well as the include file <bsd.man.mk>.
1158:
1159: Some simple examples:
1160:
1161: To build foo from foo.c with a manual page foo.1, use:
1162:
1163: PROG= foo
1164:
1165: .include <bsd.prog.mk>
1166:
1167: To build foo from foo.c with a manual page foo.2, add the line:
1168:
1.9 cgd 1169: MAN= foo.2
1.1 cgd 1170:
1171: If foo does not have a manual page at all, add the line:
1172:
1.75 agc 1173: MKMAN= no
1.1 cgd 1174:
1175: If foo has multiple source files, add the line:
1176:
1177: SRCS= a.c b.c c.c d.c
1178:
1179:
1.118 lukem 1180: =-=-=-=-= bsd.rpc.mk =-=-=-=-=
1181:
1182: The include file <bsd.rpc.mk> contains a makefile fragment used to
1183: construct source files built by rpcgen.
1.72 sommerfe 1184:
1.118 lukem 1185: The following macros may be defined in makefiles which include
1186: <bsd.rpc.mk> in order to control which files get built and how they
1187: are to be built:
1.21 christos 1188:
1.118 lukem 1189: RPC_INCS: construct .h file from .x file
1.120 lukem 1190: RPC_XDRFILES: construct _xdr.c from .x file
1.118 lukem 1191: (for marshalling/unmarshalling data types)
1192: RPC_SVCFILES: construct _svc.c from .x file
1193: (server-side stubs)
1194: RPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES.
1.21 christos 1195:
1.118 lukem 1196: RPC_XDIR: Directory containing .x/.h files
1.23 christos 1197:
1198:
1.118 lukem 1199: =-=-=-=-= bsd.shlib.mk =-=-=-=-=
1.21 christos 1200:
1.118 lukem 1201: The include file <bsd.shlib.mk> computes parameters for shared library
1202: installation and use. It defines no targets. <bsd.own.mk> MUST be
1.134 lukem 1203: included before <bsd.shlib.mk>.
1.21 christos 1204:
1.134 lukem 1205: <bsd.own.mk> sets the following variables, if they are not already defined
1.118 lukem 1206: (defaults are in brackets):
1.21 christos 1207:
1.142 lukem 1208: SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1209: instead of ${LIBDIR} as the base path for shared library
1210: installation. [/lib]
1.21 christos 1211:
1.118 lukem 1212: SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building
1213: a program. [/lib for programs in /bin and /sbin, /usr/lib
1214: for all others.]
1.81 wiz 1215:
1.142 lukem 1216: _LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1.118 lukem 1217: otherwise set to ${LIBDIR}
1.81 wiz 1218:
1.118 lukem 1219: SHLINKINSTALLDIR Base path for shared linker. [/libexec]
1.39 cgd 1220:
1.118 lukem 1221: SHLINKDIR Path to use for shared linker when building a program.
1222: [/libexec for programs in /bin and /sbin, /usr/libexec for
1223: all others.]
1.39 cgd 1224:
1.13 christos 1225:
1.118 lukem 1226: =-=-=-=-= bsd.subdir.mk =-=-=-=-=
1.13 christos 1227:
1.118 lukem 1228: The include file <bsd.subdir.mk> contains the default targets for building
1.120 lukem 1229: subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
1.118 lukem 1230: clean, cleandir, depend, includes, install, lint, and tags. For all of
1.142 lukem 1231: the directories listed in ${SUBDIR}, the specified directory will be
1232: visited and the target made. There is also a default target which allows
1233: the command "make subdir" where subdir is any directory listed in ${SUBDIR}.
1.47 tv 1234:
1.118 lukem 1235: As a special case, the use of a token .WAIT as an entry in SUBDIR acts
1236: as a synchronization barrier when multiple make jobs are run; subdirs
1237: before the .WAIT must complete before any subdirs after .WAIT are
1238: started. See make(1) for some caveats on use of .WAIT and other
1239: special sources.
1.47 tv 1240:
1241:
1.118 lukem 1242: =-=-=-=-= bsd.sys.mk =-=-=-=-=
1.47 tv 1243:
1.13 christos 1244: The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1.14 cgd 1245: <bsd.lib.mk>. It contains overrides that are used when building
1.133 lukem 1246: the NetBSD source tree.
1247:
1248: The following variables control how various files are compiled/built.
1.142 lukem 1249: (Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1.133 lukem 1250:
1251: AR Create, modify, and extract from archives. [ar]
1252:
1253: ARFLAGS Options to ${AR}. [rl]
1254:
1.151 lukem 1255: AS Assembler. [as]
1256:
1.211 lukem 1257: AFLAGS Options to ${CC} when compiling or linking .s or .S
1258: assembly source files. []
1.151 lukem 1259:
1.133 lukem 1260: CC C compiler. [cc]
1261:
1262: CFLAGS Options to ${CC}. [Usually -O or -O2]
1263:
1264: CPP C Pre-Processor. [cpp]
1265:
1266: CPPFLAGS Options to ${CPP}. []
1267:
1.151 lukem 1268: CPUFLAGS Optimization flags for ${CC}. []
1.133 lukem 1269:
1270: CXX C++ compiler. [c++]
1271:
1272: CXXFLAGS Options to ${CXX}. [${CFLAGS}]
1273:
1274: ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff]
1275:
1276: FC Fortran compiler. [f77]
1277:
1278: FFLAGS Options to {$FC}. [-O]
1279:
1280: INSTALL install(1) command. [install]
1281:
1282: LEX Lexical analyzer. [lex]
1283:
1284: LFLAGS Options to ${LEX}. []
1285:
1.145 jwise 1286: LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1287:
1.133 lukem 1288: LD Linker. [ld]
1289:
1.178 lukem 1290: LDFLAGS Options to ${CC} during the link process. []
1.133 lukem 1291:
1292: LINT C program verifier. [lint]
1293:
1.173 perry 1294: LINTFLAGS Options to ${LINT}. [-chapbxzFS]
1.133 lukem 1295:
1296: LORDER List dependencies for object files. [lorder]
1297:
1298: MAKE make(1). [make]
1299:
1300: MKDEP Construct Makefile dependency list. [mkdep]
1301:
1302: NM List symbols from object files. [nm]
1303:
1304: PC Pascal compiler. [pc] (Not present)
1305:
1306: PFLAGS Options to ${PC}. []
1307:
1308: OBJC Objective C compiler. [${CC}]
1309:
1310: OBJCFLAGS Options to ${OBJC}. [${CFLAGS}]
1311:
1312: OBJCOPY Copy and translate object files. [objcopy]
1313:
1.168 riz 1314: OBJDUMP Display information from object files. [objdump]
1315:
1.133 lukem 1316: RANLIB Generate index to archive. [ranlib]
1317:
1318: SHELL Shell. [sh]
1319:
1320: SIZE List section sizes and total size. [size]
1321:
1322: STRIP Discard symbols from object files. [strip]
1323:
1324: TSORT Topological sort of a directed graph. [tsort -q]
1325:
1326: YACC LALR(1) parser generator. [yacc]
1327:
1328: YFLAGS Options to ${YACC}. []
1329:
1330: YHEADER If defined, add "-d" to YFLAGS, and add dependencies
1331: from <file>.y to <file>.h and <file>.c, and add
1332: <foo>.h to CLEANFILES.
1333:
1334: YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS.
1335:
1.116 lukem 1336:
1337: The following variables are defined to commands to perform the
1338: appropriate operation, with the default in [brackets].
1.142 lukem 1339: (Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"):
1.116 lukem 1340:
1341: TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile]
1342:
1343: TOOL_CAP_MKDB Create capability database. [cap_mkdb]
1344:
1345: TOOL_CAT Concatenate and print files. [cat]
1346:
1347: TOOL_CKSUM Display file checksums. [cksum]
1348:
1349: TOOL_COMPILE_ET Error table compiler. [compile_et]
1350:
1351: TOOL_CONFIG Build kernel compilation directories. [config]
1352:
1353: TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen]
1354:
1355: TOOL_CTAGS Create a tags file. [ctags]
1356:
1357: TOOL_DB Manipulate db(3) databases. [db]
1358:
1359: TOOL_EQN Format equations for groff. [eqn]
1360:
1361: TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen]
1362:
1.169 thorpej 1363: TOOL_GENASSYM Generate constants for assembly files. [genassym]
1364:
1.116 lukem 1365: TOOL_GENCAT Generate NLS message catalogs. [gencat]
1366:
1367: TOOL_GROFF Front end for groff document formatting system. [groff]
1368:
1369: TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump]
1370:
1371: TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib]
1372:
1373: TOOL_INSTALLBOOT Install disk bootstrap software. [installboot]
1374:
1375: TOOL_INSTALL_INFO Update info/dir entries. [install-info]
1376:
1.192 apb 1377: TOOL_JOIN Relational database operator. [join]
1378:
1.116 lukem 1379: TOOL_M4 M4 macro language processor. [m4]
1380:
1381: TOOL_MAKEFS Create file system image from directory tree. [makefs]
1382:
1383: TOOL_MAKEINFO Translate Texinfo documents. [makeinfo]
1384:
1385: TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis]
1386:
1387: TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage]
1388:
1389: TOOL_MENUC Menu compiler. [menuc]
1390:
1391: TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper]
1392:
1393: TOOL_MKESDB Make encoding scheme database. [mkesdb]
1394:
1395: TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale]
1396:
1397: TOOL_MKMAGIC Create database for file(1). [file]
1398:
1399: TOOL_MKTEMP Make (unique) temporary file name. [mktemp]
1400:
1401: TOOL_MSGC Simple message list compiler. [msgc]
1402:
1403: TOOL_MTREE Map a directory hierarchy. [mtree]
1404:
1405: TOOL_PAX Manipulate file archives and copy directories. [pax]
1406:
1407: TOOL_PIC Compile pictures for groff. [pic]
1408:
1.205 garbled 1409: TOOL_POWERPCMKBOOTIMAGE powerpc-mkbootimage (XXXBUILDSH). [powerpc-mkbootimage]
1.116 lukem 1410:
1411: TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb]
1412:
1413: TOOL_REFER Preprocess bibliographic references for groff. [refer]
1414:
1415: TOOL_ROFF_ASCII Generate ASCII groff output. [nroff]
1416:
1417: TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi]
1418:
1419: TOOL_ROFF_HTML Generate HTML groff output.
1.119 lukem 1420: [${TOOL_GROFF} -Tlatin1 -mdoc2html]
1.116 lukem 1421:
1422: TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps]
1423:
1424: TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z]
1425:
1426: TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen]
1427:
1428: TOOL_SOELIM Eliminate .so's from groff input. [soelim]
1.123 lukem 1429:
1430: TOOL_STAT Display file status. [stat]
1.116 lukem 1431:
1432: TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel]
1433:
1434: TOOL_TBL Format tables for groff. [tbl]
1435:
1436: TOOL_UUDECODE Uudecode a binary file. [uudecode]
1437:
1438: TOOL_VGRIND Grind nice listings of programs. [vgrind -f]
1439:
1440: TOOL_ZIC Time zone compiler. [zic]
1441:
1.69 sommerfe 1442:
1443: Other variables of note (incomplete list):
1444:
1.212 ! lukem 1445: NOGCCERROR If defined, prevents passing -Werror to GCC via ${CFLAGS}.
! 1446:
! 1447: WARNS Crank up GCC warning options; the distinct levels are:
1.82 lukem 1448: WARNS=1
1449: WARNS=2
1450: WARNS=3
1.164 matt 1451: WARNS=4
1.69 sommerfe 1452:
1.144 lukem 1453: =-=-=-=-= bsd.x11.mk =-=-=-=-=
1454:
1455: The include file <bsd.x11.mk> contains parameters and targets for
1456: cross-building X11R6 from ${X11SRCDIR.xc}.
1457: It should be included after the general Makefile contents but before
1458: the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1459:
1460: It provides the following targets:
1461: .man.1 .man.3 .man.4 .man.5 .man.7:
1462: If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1463: these rules convert from X11R6's manual page source
1464: into an mdoc.old source file.
1465: cleanx11man:
1466: Clean up the mdoc.old files generated by the above.
1467:
1468: It sets the following variables:
1469:
1470: BINDIR Set to ${X11BINDIR}.
1471: To override, define after including <bsd.x11.mk>
1472:
1473: LIBDIR Set to ${X11USRLIBDIR}.
1474: To override, define after including <bsd.x11.mk>
1475:
1476: MANDIR Set to ${X11MANDIR}.
1477: To override, define after including <bsd.x11.mk>
1478:
1479: CPPFLAGS Appended with definitions to include from
1480: ${DESTDIR}${X11INCDIR}
1481:
1482: LDFLAGS Appended with definitions to link from
1483: ${DESTDIR}${X11USRLIBDIR}
1484:
1485: X11FLAGS.CONNECTION Equivalent to X11R6's CONNECTION_FLAGS.
1486:
1487: X11FLAGS.EXTENSION Equivalent to X11R6's EXT_DEFINES.
1488:
1489: X11FLAGS.LOADABLE Equivalent to X11R6's LOADABLE.
1490:
1491: X11FLAGS.OS_DEFINES Equivalent to X11R6's OS_DEFINES.
1492:
1493: X11FLAGS.SERVER Equivalent to X11R6's ServerDefines.
1494:
1495: X11FLAGS.THREADLIB Equivalent to X11R6's THREADS_DEFINES for libraries.
1496:
1497: X11FLAGS.THREADS Equivalent to X11R6's THREADS_DEFINES.
1498:
1499: X11FLAGS.VERSION cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1500:
1501: X11TOOL_UNXCOMM Commandline to convert `XCOMM' comments to `#'
1502:
1503: It uses the following variables:
1504:
1505: APPDEFS List of app-default files to install.
1506:
1507: CPPSCRIPTS List of files/scripts to run through cpp(1)
1508: and then ${X11TOOL_UNXCOMM}. The source files
1509: have a `.cpp' suffix, the generated files do not.
1510:
1511: CPPSCRIPTFLAGS Additional flags to cpp(1) when building CPPSCRIPTS.
1512:
1513: CPPSCRIPTFLAGS_<fn> Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1514:
1515:
1.30 agc 1516: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CVSweb <webmaster@jp.NetBSD.org>