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