Annotation of src/share/mk/bsd.README, Revision 1.119
1.119 ! lukem 1: # $NetBSD: bsd.README,v 1.118 2003/07/18 00:33:18 lukem Exp $
1.24 mikel 2: # @(#)bsd.README 8.2 (Berkeley) 4/2/94
1.1 cgd 3:
4: This is the README file for the new make "include" files for the BSD
5: source tree. The files are installed in /usr/share/mk, and are, by
1.11 jtc 6: 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:
61: There are various make variables used during the build. Basic rule for
62: the variable naming scheme is as follows:
63:
64: MKxxx Can be set to `no' by a user to disable functionality.
65: Defaults to `yes' (or usually does)
66:
1.116 lukem 67: NOxxx If defined, disables a feature.
68: Not intended for users.
69: This is to allow Makefiles to disable functionality
70: that they don't support (such as missing man pages).
1.101 lukem 71: NOxxx variables must be defined before <bsd.own.mk>
72: is included.
1.21 christos 73:
1.45 lukem 74: The following variables that control how things are made/installed that
1.47 tv 75: are not set by default. These should not be set by Makefiles; they're for
76: the user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
77: command line:
1.21 christos 78:
1.45 lukem 79: BUILD If defined, 'make install' checks that the targets in the
80: source directories are up-to-date and remakes them if they
1.21 christos 81: are out of date, instead of blindly trying to install
1.79 wiz 82: out of date or non-existent targets.
1.21 christos 83:
1.45 lukem 84: UPDATE If defined, 'make install' only installs targets that are
85: more recently modified in the source directories that their
86: installed counterparts.
1.52 simonb 87:
1.83 perry 88: UNPRIVED If defined, don't set the owner/group/mode when installing
89: files or directories, and keep a metadata log of what
90: the owner/group/mode should be. This allows a
91: non-root "make install".
1.45 lukem 92:
1.86 thorpej 93: MKBFD If "no", don't build libbfd, libiberty, or any of
94: the things that depend on them (binutils/gas/ld,
1.103 thorpej 95: gdb, dbsym, mdsetimage).
1.86 thorpej 96:
1.45 lukem 97: MKCATPAGES If "no", don't build or install the catman pages.
98:
99: MKDOC If "no", don't build or install the documentation.
1.86 thorpej 100:
1.104 lukem 101: MKDYNAMICROOT If "no", build programs in /bin and /sbin statically,
102: don't install certain libraries in /lib, and don't
103: install the shared linker into /libexec.
104:
1.103 thorpej 105: MKGDB If "no", don't build gdb.
1.86 thorpej 106:
107: MKGCC If "no", don't build gcc or any of the gcc-related
108: libraries (libg2c, libgcc, libobjc, libstdc++).
1.92 ross 109:
110: MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance.
111: Has no effect on most platforms.
1.45 lukem 112:
1.47 tv 113: MKINFO If "no", don't build or install Info documentation from
114: Texinfo source files.
1.45 lukem 115:
116: MKLINT If "no", don't build or install the lint libraries.
117:
118: MKMAN If "no", don't build or install the man or catman pages.
1.46 lukem 119: Also acts as "MKCATPAGES=no"
1.45 lukem 120:
1.119 ! lukem 121: MKMANZ If not "no", compress manual pages at installation time.
! 122: "no" by default.
! 123:
1.74 itojun 124: MKNLS If "no", don't build or install the NLS files and locale
125: definition files.
1.45 lukem 126:
1.55 sommerfe 127: MKOBJ If "no", don't enable the rule which creates objdirs.
128: "yes" by default.
129:
130: MKOBJDIRS If "no", don't create objdirs during a "make build".
131: "no" by default.
1.45 lukem 132:
133: MKPIC If "no", don't build or install shared libraries.
134:
135: MKPICINSTALL If "no", don't install the *_pic.a libraries.
136:
137: MKPROFILE If "no", don't build or install the profiling libraries.
138:
1.48 lukem 139: MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
140: MKNLS=no". I.e, don't build catman pages, documentation,
141: Info documentation, man pages, NLS files, ...
1.1 cgd 142:
1.118 lukem 143:
144: =-=-=-=-= sys.mk =-=-=-=-=
1.1 cgd 145:
146: The include file <sys.mk> has the default rules for all makes, in the BSD
147: environment or otherwise. You probably don't want to touch this file.
1.71 itojun 148: If you intend to run a cross build, you will need to supply the following
149: host tools, and configure the following variables properly:
150:
151: OBJCOPY objcopy - copy and translate object files
152:
153: STRIP strip - Discard symbols from object files
154:
1.1 cgd 155:
1.118 lukem 156: =-=-=-=-= bsd.own.mk =-=-=-=-=
1.1 cgd 157:
1.17 thorpej 158: The include file <bsd.own.mk> contains source tree configuration parameters,
159: such as the owners, groups, etc. for both manual pages and binaries, and
160: a few global "feature configuration" parameters.
1.1 cgd 161:
162: It has no targets.
163:
1.29 cjs 164: To get system-specific configuration parameters, bsd.own.mk will try to
165: include the file specified by the "MAKECONF" variable. If MAKECONF is not
166: set, or no such file exists, the system make configuration file, /etc/mk.conf
167: is included. These files may define any of the variables described below.
1.17 thorpej 168:
169: bsd.own.mk sets the following variables, if they are not already defined
170: (defaults are in brackets):
1.15 cgd 171:
1.98 lukem 172: NETBSDSRCDIR Top of the NetBSD source tree.
173: If _SRC_TOP_ != "", that will be used as the default,
174: otherwise BSDSRCDIR will be used as the default.
175: Various makefiles within the NetBSD source tree will
176: use this to reference the top level of the source tree.
177:
1.95 lukem 178: _SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
1.98 lukem 179: based on the presence of tools/ and build.sh. This variable
180: is "internal" to <bsd.own.mk>, although its value is only
181: determined once and then propagated to all sub-makes.
1.95 lukem 182:
1.15 cgd 183: BSDSRCDIR The real path to the system sources, so that 'make obj'
1.116 lukem 184: will work correctly. [/usr/src]
1.15 cgd 185:
186: BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
1.116 lukem 187: will work correctly. [/usr/obj]
1.15 cgd 188:
1.116 lukem 189: BINGRP Binary group. [wheel]
1.15 cgd 190:
1.116 lukem 191: BINOWN Binary owner. [root]
1.15 cgd 192:
1.116 lukem 193: BINMODE Binary mode. [555]
1.15 cgd 194:
1.116 lukem 195: NONBINMODE Mode for non-executable files. [444]
1.15 cgd 196:
1.116 lukem 197: MANDIR Base path for manual installation. [/usr/share/man/cat]
1.15 cgd 198:
1.116 lukem 199: MANGRP Manual group. [wheel]
1.15 cgd 200:
1.116 lukem 201: MANOWN Manual owner. [root]
1.15 cgd 202:
1.116 lukem 203: MANMODE Manual mode. [${NONBINMODE}]
1.15 cgd 204:
1.21 christos 205: MANINSTALL Manual installation type: maninstall, catinstall, or both
1.76 fair 206:
207: LDSTATIC Control program linking; if set blank, link everything
208: dynamically. If set to "-static", link everything statically.
209: If not set, programs link according to their makefile.
1.21 christos 210:
1.116 lukem 211: LIBDIR Base path for library installation. [/usr/lib]
1.15 cgd 212:
1.116 lukem 213: LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
1.15 cgd 214:
1.116 lukem 215: LIBGRP Library group. [${BINGRP}]
1.15 cgd 216:
1.116 lukem 217: LIBOWN Library owner. [${BINOWN}]
1.15 cgd 218:
1.116 lukem 219: LIBMODE Library mode. [${NONBINMODE}]
1.15 cgd 220:
221: DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
1.116 lukem 222: installation. [/usr/share/doc]
1.62 simonb 223:
224: HTMLDOCDIR Base path for html system documentation installation.
225: [/usr/share/doc/html]
1.15 cgd 226:
1.116 lukem 227: DOCGRP Documentation group. [wheel]
1.15 cgd 228:
1.116 lukem 229: DOCOWN Documentation owner. [root]
1.15 cgd 230:
1.116 lukem 231: DOCMODE Documentation mode. [${NONBINMODE}]
1.15 cgd 232:
1.84 kleink 233: NLSDIR Base path for Native Language Support files installation.
1.15 cgd 234: [/usr/share/nls]
1.1 cgd 235:
1.116 lukem 236: NLSGRP Native Language Support files group. [wheel]
1.1 cgd 237:
1.116 lukem 238: NLSOWN Native Language Support files owner. [root]
1.1 cgd 239:
1.116 lukem 240: NLSMODE Native Language Support files mode. [${NONBINMODE}]
1.1 cgd 241:
1.32 mikel 242: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 243: to be stripped. This is to be used when building your
244: own install script so that the entire system can be made
1.116 lukem 245: stripped/not-stripped using a single knob. [-s]
1.1 cgd 246:
1.2 cgd 247: COPY The flag passed to the install program to cause the binary
248: to be copied rather than moved. This is to be used when
249: building our own install script so that the entire system
250: can either be installed with copies, or with moves using
1.116 lukem 251: a single knob. [-c]
1.15 cgd 252:
1.17 thorpej 253: Additionally, the following variables may be set by bsd.own.mk or in a
254: make configuration file to modify the behaviour of the system build
255: process (default values are in brackets along with comments, if set by
256: bsd.own.mk):
1.111 thorpej 257:
258: MKPICLIB bsd.own.mk provides a default for this variable, which is
259: used by bsd.lib.mk. The default value is provided by
260: bsd.own.mk since non-library Makefiles may need to check
261: its value in order to generate proper dependencies against
262: libraries used only during the build process (which would
263: not be installed into the destination directory).
1.15 cgd 264:
1.64 thorpej 265: MKCRYPTO If set to "no", no cryptography support will be built
266: into the system. Defaults to "yes".
267:
1.66 itojun 268: MKCRYPTO_IDEA If set to "yes", IDEA support will be built into
269: libcrypto_idea.a. Defaults to "no".
1.64 thorpej 270:
1.105 itojun 271: MKCRYPTO_MDC2 If set to "yes", MDC2 support will be built into
272: libcrypto_mdc2.a. Defaults to "no".
273:
1.66 itojun 274: MKCRYPTO_RC5 If set to "yes", RC5 support will be built into
275: libcrypto_rc5.a. Defaults to "no".
1.64 thorpej 276:
1.94 thorpej 277: MKHESIOD If set to "no", disables building of Hesiod infrastructure
278: (libraries and support programs).
1.64 thorpej 279:
1.94 thorpej 280: MKKERBEROS If set to "no", disables building of Kerberos (v4 or v5)
281: infrastructure (libraries and support programs).
1.2 cgd 282:
1.94 thorpej 283: MKSKEY If set to "no", disables building of S/key authentication
284: infrastructure (libraries and support programs).
285:
286: MKYP If set to "no", disables building of YP (NIS)
287: infrastructure (libraries and support programs).
288:
289: USE_HESIOD If set to "no", disables building Hesiod support into
290: various system utilities/libraries that support it.
291: If MKHESIOD is set to "no", USE_HESIOD will also be
292: forced to "no".
293:
294: USE_KERBEROS If set to "no", disables building Kerberos (v4 or v5)
295: support into various system utilities/libraries that
296: support it. If MKKERBEROS is set to "no", USE_KERBEROS
297: will also be forced to "no".
298:
299: USE_SKEY If set to "no", disables building S/key authentication
300: support into various system utilities/libraries that
301: support it. If MKSKEY is set to "no", USE_SKEY will
302: also be forced to "no".
303:
304: USE_YP If set to "no", disables building YP (NIS) support into
305: various system utilities/libraries that support it. If
306: MKYP is set to "no", USE_YP will also be forced to "no".
1.15 cgd 307:
308: NOPROFILE Do not build profiled versions of system libraries
1.1 cgd 309:
1.15 cgd 310: NOPIC Do not build PIC versions of system libraries, and
311: do not build shared libraries. [set if ${MACHINE_ARCH}
1.65 jlam 312: is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
1.1 cgd 313:
1.40 perry 314: NOLINT Do not build lint libraries.
1.33 jonathan 315:
1.116 lukem 316: OBJECT_FMT Object file format. [set to "ELF" on architectures that
1.50 thorpej 317: use ELF -- currently if ${MACHINE_ARCH} is "alpha",
318: "mipsel", "mipseb", "powerpc", "sparc", "sparc64",
1.77 simonb 319: "i386" and some m68k machines, or set to "a.out" on
320: other architectures].
1.33 jonathan 321:
1.78 simonb 322: MKSOFTFLOAT If "yes", build with options to enable the compiler to
323: generate output containing library calls for floating
324: point and possibly soft-float library support. Defaults
325: to "no".
1.103 thorpej 326:
327: TOOLCHAIN_MISSING
328: If "yes", this indicates that the platform being built
329: does not have a working in-tree toolchain. If the
330: MACHINE_ARCH in question falls into this category, the
331: variable is conditionally assigned the value "yes".
332: Otherwise, the variable is unconditionally assigned the
333: value "no".
334:
335: If TOOLCHAIN_MISSING is "yes", the variables MKBFD, MKGCC,
336: and MKGDB are unconditionally assigned the value "no".
337:
338: EXTERNAL_TOOLCHAIN
339: This variable is not directly set by <bsd.own.mk>, but
340: including <bsd.own.mk> is the canonical way to gain
341: access to this variable. The variable should be defined
342: either in the user's environment or in the user's mk.conf
343: file. If defined, this variable indicates the root of
344: an external toolchain which will be used to build the
345: tree. For example, if a platform is a TOOLCHAIN_MISSING
346: platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
347: cross-compile framework.
348:
349: If EXTERNAL_TOOLCHAIN is defined, the variable MKGCC is
350: unconditionally assigned the value "no", since the external
351: version of the compiler may not be able to build the library
352: components of the in-tree compiler.
353:
354: NOTE: This variable is not yet used in as many places as
355: it should be. Expect the exact semantics of this variable
356: to change in the short term as parts of the cross-compile
357: framework continue to be cleaned up.
1.1 cgd 358:
1.17 thorpej 359: bsd.own.mk is generally useful when building your own Makefiles so that
1.1 cgd 360: they use the same default owners etc. as the rest of the tree.
361:
362:
1.118 lukem 363: =-=-=-=-= bsd.files.mk =-=-=-=-=
1.106 thorpej 364:
1.118 lukem 365: The include file <bsd.files.mk> handles the FILES variables and is included
366: from bsd.lib.mk and bsd.prog.mk.
1.106 thorpej 367:
368:
1.118 lukem 369: =-=-=-=-= bsd.gcc.mk =-=-=-=-=
1.113 thorpej 370:
371: The include file <bsd.gcc.mk> computes various parameters related to GCC
372: support libraries. It defines no targets. <bsd.own.mk> MUST be included
373: before bsd.gcc.mk.
374:
375: The primary users of bsd.gcc.mk are <bsd.prog.mk> and <bsd.lib.mk>, each
376: of which need to know where to find certain GCC support libraries.
377:
378: The behavior of bsd.gcc.mk is influenced by the EXTERNAL_TOOLCHAIN variable,
379: which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then
380: the compiler is asked where to find the support libraries, otherwise the
381: support libraries are found in ${DESTDIR}/usr/lib.
382:
383: bsd.gcc.mk sets the following variables:
384:
1.118 lukem 385: _GCC_CRTBEGIN The full path name to crtbegin.o.
386:
387: _GCC_CRTBEGINS The full path name to crtbeginS.o.
388:
389: _GCC_CRTEND The full path name to crtend.o.
390:
391: _GCC_CRTENDS The full path name to crtendS.o.
392:
393: _GCC_LIBGCCDIR The directory where libgcc.a is located.
394:
395:
396: =-=-=-=-= bsd.inc.mk =-=-=-=-=
397:
398: The include file <bsd.inc.mk> defines the includes target and uses two
399: variables:
400:
401: INCS The list of include files
402:
403: INCSDIR The location to install the include files.
404:
405: INCSNAME Target name of the include file, if only one; same as
406: FILESNAME, but for include files.
407:
408: INCSNAME_<file> The name file <file> should be installed as, if not <file>,
409: same as FILESNAME_<file>, but for include files.
410:
411:
412: =-=-=-=-= bsd.info.mk =-=-=-=-=
413:
414: The include file <bsd.info.mk> is used to generate and install GNU Info
415: documentation from respective Texinfo source files. It defines three
416: implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
417: following variables:
418:
419: TEXINFO List of Texinfo source files. Info documentation will
420: consist of single files with the extension replaced by
421: .info.
422:
423: INFOFLAGS Flags to pass to makeinfo. []
424:
425:
426: =-=-=-=-= bsd.kernobj.mk =-=-=-=-=
427:
428: The include file <bsd.kernobj.mk> defines variables related to the
429: location of kernel sources and object directories.
430:
431: KERNSRCDIR Is the location of the top of the kernel src.
432: It defaults to ${_SRC_TOP_}/sys
433:
434: KERNARCHDIR Is the location of the machine dependent kernel
435: sources. It defaults to arch/${MACHINE}
436:
437: KERNCONFDIR Is where the configuration files for kernels are
438: found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
439:
440: KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
441: instance will be compiled in ${KERNOBJDIR}/GENERIC.
442: The default value is
443: ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
444: if it exists or the target 'obj' is being made.
445: Otherwise the default is
446: ${KERNSRCDIR}/${KERNARCHDIR}/compile.
447:
448: It is important that Makefiles (such as those under src/distrib) that
449: wish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
450: rather than make assumptions about the location of the compiled kernel.
451:
452:
453: =-=-=-=-= bsd.kinc.mk =-=-=-=-=
454:
455: The include file <bsd.kinc.mk> defines the many targets (includes,
456: subdirectories, etc.), and is used by kernel makefiles to handle
457: include file installation. It is intended to be included alone, by
458: kernel Makefiles. Please see bsd.kinc.mk for more details, and keep
459: the documentation in that file up to date.
460:
461:
462: =-=-=-=-= bsd.lib.mk =-=-=-=-=
463:
464: The include file <bsd.lib.mk> has support for building libraries. It has
465: the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
466: includes, install, lint, and tags. Additionally, it has a checkver target
467: which checks for installed shared object libraries whose version is greater
468: that the version of the source. It has a limited number of suffixes,
469: consistent with the current needs of the BSD tree. bsd.lib.mk includes
470: <bsd.shlib.mk> to get shared library parameters.
471:
472: It sets/uses the following variables:
473:
474: LIB The name of the library to build.
475:
476: LIBDIR Target directory for libraries.
477:
478: SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
479: is "yes".
480:
481: USE_SHLIBDIR If "yes", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
482: as the path to install shared libraries to.
483: USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
484:
485: LINTLIBDIR Target directory for lint libraries.
486:
487: LIBGRP Library group.
488:
489: LIBOWN Library owner.
490:
491: LIBMODE Library mode.
492:
493: LDADD Additional loader objects.
494:
495: MAN The manual pages to be installed (use a .1 - .9 suffix).
496:
497: MKLINKLIB If "no", act as "MKPICINSTALL=no MKPROFILE=no".
498: Also:
499: - don't install the .a libraries
500: - don't install _pic.a libraries on PIC systems
501: - don't build .a libraries on PIC systems
502: - don't install the .so symlink on ELF systems
503: I.e, only install the shared library (and the .so.major
504: symlink on ELF).
505:
506: MKPICLIB If "no", don't build _pic.a libraries, and build the
507: shared object libraries from the .a libraries. A
508: symlink is installed in ${DESTDIR}/usr/lib for the
509: _pic.a library pointing to the .a library.
510:
511: NOCHECKVER_<library>
512: NOCHECKVER If set, disables checking for installed shared object
513: libraries with versions greater than the source. A
514: particular library name, without the "lib" prefix, may
515: be appended to the variable name to disable the check for
516: only that library.
517:
518: SRCS List of source files to build the library. Suffix types
519: .s, .c, and .f are supported. Note, .s files are preferred
520: to .c files of the same name. (This is not the default for
521: versions of make.)
522:
523: The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
524: if it exists, as well as the include file <bsd.man.mk>.
525:
526: It has rules for building profiled objects; profiled libraries are
527: built by default.
528:
529: Libraries are ranlib'd when made.
530:
531:
532: =-=-=-=-= bsd.links.mk =-=-=-=-=
533:
534: The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
535: and is included from from bsd.lib.mk and bsd.prog.mk.
536:
537:
538: =-=-=-=-= bsd.man.mk =-=-=-=-=
539:
540: The include file <bsd.man.mk> handles installing manual pages and their
541: links.
542:
543: It has a two targets:
544:
545: maninstall:
546: Install the manual page sources and their links.
547: catinstall:
548: Install the preformatted manual pages and their links.
549:
550: It sets/uses the following variables:
551:
552: MANDIR Base path for manual installation.
553:
554: MANGRP Manual group.
555:
556: MANOWN Manual owner.
557:
558: MANMODE Manual mode.
559:
560: MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
561: or "/tahoe" for machine specific manual pages.
562:
563: MAN The manual pages to be installed (use a .1 - .9 suffix).
564:
565: MLINKS List of manual page links (using a .1 - .9 suffix). The
566: linked-to file must come first, the linked file second,
567: and there may be multiple pairs. The files are soft-linked.
568:
569: The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
570: it exists.
571:
572:
573: =-=-=-=-= bsd.obj.mk =-=-=-=-=
574:
575: The include file <bsd.obj.mk> defines targets related to the creation
576: and use of separated object and source directories.
577:
578: If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
579: ${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
580: it exists. Otherwise make(1) looks for the existence of a
581: subdirectory (or a symlink to a directory) of the source directory
582: into which built targets should be placed. If an environment variable
583: named MAKEOBJDIR is set, make(1) uses its value as the name of the
584: object directory; failing that, make first looks for a subdirectory
585: named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
586:
587: Object directories are not created automatically by make(1) if they
588: don't exist; you need to run a separate "make obj". (This will happen
589: during a top-level build if "MKOBJDIRS" is set to a value other than
590: "no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
591: and this is determined by a simple string prefix comparison -- object
592: directories are created in a separate object directory tree, and a
593: symlink to the object directory in that tree is created in the source
594: directory; otherwise, "make obj" assumes that you're not in the main
595: source tree and that it's not safe to use a separate object tree.
596:
597: Several variables used by <bsd.obj.mk> control exactly what
598: directories and links get created during a "make obj":
599:
600: MAKEOBJDIR If set, this is the component name of the object
601: directory.
602:
603: OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
604: object directories or links named "obj.${MACHINE}";
605: otherwise, just creates ones named "obj".
606:
607: USR_OBJMACHINE If set, and the current directory is a subdirectory of
608: ${BSDSRCDIR}, create object directory in the
609: corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
610: otherwise, create it in the corresponding subdirectory
611: of ${BSDOBJDIR}
1.113 thorpej 612:
1.118 lukem 613: BUILDID If set, the contents of this variable are appended
614: to the object directory name. If OBJMACHINE is also
615: set, ".${BUILDID}" is added after ".${MACHINE}".
1.113 thorpej 616:
1.106 thorpej 617:
1.118 lukem 618: =-=-=-=-= bsd.prog.mk =-=-=-=-=
1.106 thorpej 619:
1.1 cgd 620: The include file <bsd.prog.mk> handles building programs from one or
621: more source files, along with their manual pages. It has a limited number
1.106 thorpej 622: of suffixes, consistent with the current needs of the BSD tree. bsd.prog.mk
623: includes <bsd.shlib.mk> to get shared library parameters.
1.1 cgd 624:
1.16 jtc 625: It has eight targets:
1.1 cgd 626:
627: all:
1.102 thorpej 628: build the program and its manual page. This also
629: creates a GDB initialization file (.gdbinit) in
630: the objdir. The .gdbinit file sets the shared library
631: prefix to ${DESTDIR} to facilitate cross-debugging.
1.1 cgd 632: clean:
633: remove the program, any object files and the files a.out,
1.24 mikel 634: Errs, errs, mklog, and ${PROG}.core.
1.1 cgd 635: cleandir:
636: remove all of the files removed by the target clean, as
637: well as .depend, tags, and any manual pages.
1.42 lukem 638: `distclean' is a synonym for `cleandir'.
1.1 cgd 639: depend:
640: make the dependencies for the source files, and store
641: them in the file .depend.
1.16 jtc 642: includes:
643: install any header files.
1.1 cgd 644: install:
645: install the program and its manual pages; if the Makefile
646: does not itself define the target install, the targets
647: beforeinstall and afterinstall may also be used to cause
648: actions immediately before and after the install target
649: is executed.
650: lint:
651: run lint on the source files
652: tags:
653: create a tags file for the source files.
654:
655: It sets/uses the following variables:
656:
657: BINGRP Binary group.
658:
659: BINOWN Binary owner.
660:
661: BINMODE Binary mode.
662:
663: CLEANFILES Additional files to remove for the clean and cleandir targets.
664:
665: COPTS Additional flags to the compiler when creating C objects.
1.112 thorpej 666:
667: CPUFLAGS Additional flags to the compiler/assembler to select
668: CPU instruction set options, CPU tuning options, etc.
1.35 lukem 669:
670: CPPFLAGS Additional flags to the C pre-processor
1.102 thorpej 671:
672: GDBINIT List of GDB initialization files to add to "source"
673: directives in the .gdbinit file that is created in the
674: objdir.
1.1 cgd 675:
676: LDADD Additional loader objects. Usually used for libraries.
677: For example, to load with the compatibility and utility
678: libraries, use:
679:
1.5 jtc 680: LDADD+=-lutil -lcompat
1.1 cgd 681:
682: LDFLAGS Additional loader flags.
683:
684: LINKS The list of binary links; should be full pathnames, the
685: linked-to file coming first, followed by the linked
686: file. The files are hard-linked. For example, to link
687: /bin/test and /bin/[, use:
688:
689: LINKS= ${DESTDIR}/bin/test ${DESTDIR}/bin/[
1.19 perry 690:
691: SYMLINKS The list of symbolic links; should be full pathnames.
1.20 perry 692: Syntax is identical to LINKS. Note that DESTDIR is not
693: automatically included in the link.
1.1 cgd 694:
1.15 cgd 695: MAN Manual pages (should end in .1 - .9). If no MAN variable is
1.8 cgd 696: defined, "MAN=${PROG}.1" is assumed.
1.1 cgd 697:
698: PROG The name of the program to build. If not supplied, nothing
699: is built.
700:
1.88 thorpej 701: PROG_CXX If defined, the name of the program to build. Also
702: causes <bsd.prog.mk> to link the program with the C++
703: compiler rather than the C compiler. PROG_CXX overrides
704: the value of PROG if PROG is also set.
1.87 thorpej 705:
1.21 christos 706: PROGNAME The name that the above program will be installed as, if
707: different from ${PROG}.
708:
1.37 tv 709: SRCS List of source files to build the program. If SRCS is not
1.1 cgd 710: defined, it's assumed to be ${PROG}.c.
1.108 jwise 711:
712: DPSRCS List of source files which are needed for generating
713: dependencies, but are not needed in ${SRCS}.
1.1 cgd 714:
715: DPADD Additional dependencies for the program. Usually used for
716: libraries. For example, to depend on the compatibility and
717: utility libraries use:
718:
1.5 jtc 719: DPADD+=${LIBCOMPAT} ${LIBUTIL}
1.1 cgd 720:
721: The following libraries are predefined for DPADD:
722:
1.21 christos 723: LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
1.99 itojun 724: LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a
1.21 christos 725: LIBC?= ${DESTDIR}/usr/lib/libc.a
726: LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
1.99 itojun 727: LIBCDK?= ${DESTDIR}/usr/lib/libcdk.a
728: LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a
1.21 christos 729: LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
730: LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
1.99 itojun 731: LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a
732: LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1.105 itojun 733: LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1.99 itojun 734: LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
1.21 christos 735: LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
736: LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
737: LIBDES?= ${DESTDIR}/usr/lib/libdes.a
738: LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1.114 provos 739: LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
1.73 blymn 740: LIBFORM?= ${DESTDIR}/usr/lib/libform.a
1.21 christos 741: LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
742: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.99 itojun 743: LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a
744: LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a
1.70 itojun 745: LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
1.49 itojun 746: LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
1.99 itojun 747: LIBKADM?= ${DESTDIR}/usr/lib/libkadm.a
748: LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
749: LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a
750: LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a
1.21 christos 751: LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
752: LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
1.99 itojun 753: LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a
754: LIBKSTREAM?= ${DESTDIR}/usr/lib/libkstream.a
1.21 christos 755: LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
756: LIBL?= ${DESTDIR}/usr/lib/libl.a
757: LIBM?= ${DESTDIR}/usr/lib/libm.a
1.53 blymn 758: LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
1.21 christos 759: LIBMP?= ${DESTDIR}/usr/lib/libmp.a
1.25 christos 760: LIBNTP?= ${DESTDIR}/usr/lib/libntp.a
1.99 itojun 761: LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a
762: LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a
1.21 christos 763: LIBPC?= ${DESTDIR}/usr/lib/libpc.a
764: LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
1.99 itojun 765: LIBPCI?= ${DESTDIR}/usr/lib/libpci.a
1.21 christos 766: LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a
1.100 thorpej 767: LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a
1.26 kleink 768: LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
1.110 thorpej 769: LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a
770: LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1.21 christos 771: LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
1.99 itojun 772: LIBRMT?= ${DESTDIR}/usr/lib/librmt.a
773: LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a
1.21 christos 774: LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
1.110 thorpej 775: LIBRT?= ${DESTDIR}/usr/lib/librt.a
1.21 christos 776: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
1.99 itojun 777: LIBSS?= ${DESTDIR}/usr/lib/libss.a
778: LIBSSL?= ${DESTDIR}/usr/lib/libssl.a
779: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
780: LIBSL?= ${DESTDIR}/usr/lib/libsl.a
1.21 christos 781: LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
1.99 itojun 782: LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a
1.21 christos 783: LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
784: LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
785: LIBY?= ${DESTDIR}/usr/lib/liby.a
786: LIBZ?= ${DESTDIR}/usr/lib/libz.a
1.1 cgd 787:
788: SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
1.12 christos 789: strings, using xstr(1). Note that this will not work with
790: parallel makes.
1.1 cgd 791:
1.59 jlam 792: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 793: to be stripped.
794:
795: SUBDIR A list of subdirectories that should be built as well.
796: Each of the targets will execute the same target in the
797: subdirectories.
798:
1.21 christos 799: SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
800: These are installed exactly like programs.
801:
802: SCRIPTSNAME The name that the above program will be installed as, if
803: different from ${SCRIPTS}. These can be further specialized
804: by setting SCRIPTSNAME_<script>.
805:
806: FILES A list of files to install. The installation is controlled
807: by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
808: variables that can be further specialized by FILES<VAR>_<file>
809:
1.106 thorpej 810: SHLINKDIR Target directory for shared linker. See description of
811: <bsd.own.mk> for additional information about this variable.
1.85 lukem 812:
1.1 cgd 813: The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
814: if it exists, as well as the include file <bsd.man.mk>.
815:
816: Some simple examples:
817:
818: To build foo from foo.c with a manual page foo.1, use:
819:
820: PROG= foo
821:
822: .include <bsd.prog.mk>
823:
824: To build foo from foo.c with a manual page foo.2, add the line:
825:
1.9 cgd 826: MAN= foo.2
1.1 cgd 827:
828: If foo does not have a manual page at all, add the line:
829:
1.75 agc 830: MKMAN= no
1.1 cgd 831:
832: If foo has multiple source files, add the line:
833:
834: SRCS= a.c b.c c.c d.c
835:
836:
1.118 lukem 837: =-=-=-=-= bsd.rpc.mk =-=-=-=-=
838:
839: The include file <bsd.rpc.mk> contains a makefile fragment used to
840: construct source files built by rpcgen.
1.72 sommerfe 841:
1.118 lukem 842: The following macros may be defined in makefiles which include
843: <bsd.rpc.mk> in order to control which files get built and how they
844: are to be built:
1.21 christos 845:
1.118 lukem 846: RPC_INCS: construct .h file from .x file
847: RPC_XDRFILES: construct _xdr.c from .x file
848: (for marshalling/unmarshalling data types)
849: RPC_SVCFILES: construct _svc.c from .x file
850: (server-side stubs)
851: RPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES.
1.21 christos 852:
1.118 lukem 853: RPC_XDIR: Directory containing .x/.h files
1.23 christos 854:
855:
1.118 lukem 856: =-=-=-=-= bsd.shlib.mk =-=-=-=-=
1.21 christos 857:
1.118 lukem 858: The include file <bsd.shlib.mk> computes parameters for shared library
859: installation and use. It defines no targets. <bsd.own.mk> MUST be
860: included before bsd.shlib.mk.
1.21 christos 861:
1.118 lukem 862: bsd.own.mk sets the following variables, if they are not already defined
863: (defaults are in brackets):
1.21 christos 864:
1.118 lukem 865: SHLIBINSTALLDIR If ${USE_SHLIBDIR} is "yes", use ${SHLIBINSTALLDIR} instead of
866: ${LIBDIR} as the base path for shared library installation.
867: [/lib]
1.21 christos 868:
1.118 lukem 869: SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building
870: a program. [/lib for programs in /bin and /sbin, /usr/lib
871: for all others.]
1.81 wiz 872:
1.118 lukem 873: _LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is "yes",
874: otherwise set to ${LIBDIR}
1.81 wiz 875:
1.118 lukem 876: SHLINKINSTALLDIR Base path for shared linker. [/libexec]
1.39 cgd 877:
1.118 lukem 878: SHLINKDIR Path to use for shared linker when building a program.
879: [/libexec for programs in /bin and /sbin, /usr/libexec for
880: all others.]
1.39 cgd 881:
1.13 christos 882:
1.118 lukem 883: =-=-=-=-= bsd.subdir.mk =-=-=-=-=
1.13 christos 884:
1.118 lukem 885: The include file <bsd.subdir.mk> contains the default targets for building
886: subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
887: clean, cleandir, depend, includes, install, lint, and tags. For all of
888: the directories listed in the variable SUBDIR, the specified directory
889: will be visited and the target made. There is also a default target which
890: allows the command "make subdir" where subdir is any directory listed in
891: the variable SUBDIR.
1.47 tv 892:
1.118 lukem 893: As a special case, the use of a token .WAIT as an entry in SUBDIR acts
894: as a synchronization barrier when multiple make jobs are run; subdirs
895: before the .WAIT must complete before any subdirs after .WAIT are
896: started. See make(1) for some caveats on use of .WAIT and other
897: special sources.
1.47 tv 898:
899:
1.118 lukem 900: =-=-=-=-= bsd.sys.mk =-=-=-=-=
1.47 tv 901:
1.13 christos 902: The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1.14 cgd 903: <bsd.lib.mk>. It contains overrides that are used when building
904: the NetBSD source tree. For instance, if "PARALLEL" is defined by
905: the program/library Makefile, it includes a set of rules for lex and
906: yacc that allow multiple lex and yacc targets to be built in parallel.
1.116 lukem 907:
908: The following variables are defined to commands to perform the
909: appropriate operation, with the default in [brackets].
910: (Note that these are overridden in <bsd.own.mk> if USETOOLS=yes):
911:
912: TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile]
913:
914: TOOL_CAP_MKDB Create capability database. [cap_mkdb]
915:
916: TOOL_CAT Concatenate and print files. [cat]
917:
918: TOOL_CKSUM Display file checksums. [cksum]
919:
920: TOOL_COMPILE_ET Error table compiler. [compile_et]
921:
922: TOOL_CONFIG Build kernel compilation directories. [config]
923:
924: TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen]
925:
926: TOOL_CTAGS Create a tags file. [ctags]
927:
928: TOOL_DB Manipulate db(3) databases. [db]
929:
930: TOOL_EQN Format equations for groff. [eqn]
931:
932: TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen]
933:
934: TOOL_GENCAT Generate NLS message catalogs. [gencat]
935:
936: TOOL_GROFF Front end for groff document formatting system. [groff]
937:
938: TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump]
939:
940: TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib]
941:
942: TOOL_INSTALLBOOT Install disk bootstrap software. [installboot]
943:
944: TOOL_INSTALL_INFO Update info/dir entries. [install-info]
945:
946: TOOL_M4 M4 macro language processor. [m4]
947:
948: TOOL_MAKEFS Create file system image from directory tree. [makefs]
949:
950: TOOL_MAKEINFO Translate Texinfo documents. [makeinfo]
951:
952: TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis]
953:
954: TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage]
955:
956: TOOL_MENUC Menu compiler. [menuc]
957:
958: TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper]
959:
960: TOOL_MKESDB Make encoding scheme database. [mkesdb]
961:
962: TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale]
963:
964: TOOL_MKMAGIC Create database for file(1). [file]
965:
966: TOOL_MKTEMP Make (unique) temporary file name. [mktemp]
967:
968: TOOL_MSGC Simple message list compiler. [msgc]
969:
970: TOOL_MTREE Map a directory hierarchy. [mtree]
971:
972: TOOL_PAX Manipulate file archives and copy directories. [pax]
973:
974: TOOL_PIC Compile pictures for groff. [pic]
975:
976: TOOL_PREPMKBOOTIMAGE prep-mkbootimage (XXXBUILDSH). [prep-mkbootimage]
977:
978: TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb]
979:
980: TOOL_REFER Preprocess bibliographic references for groff. [refer]
981:
982: TOOL_ROFF_ASCII Generate ASCII groff output. [nroff]
983:
984: TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi]
985:
986: TOOL_ROFF_HTML Generate HTML groff output.
1.119 ! lukem 987: [${TOOL_GROFF} -Tlatin1 -mdoc2html]
1.116 lukem 988:
989: TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps]
990:
991: TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z]
992:
993: TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen]
994:
995: TOOL_SOELIM Eliminate .so's from groff input. [soelim]
996:
997: TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel]
998:
999: TOOL_TBL Format tables for groff. [tbl]
1000:
1001: TOOL_UUDECODE Uudecode a binary file. [uudecode]
1002:
1003: TOOL_VGRIND Grind nice listings of programs. [vgrind -f]
1004:
1005: TOOL_ZIC Time zone compiler. [zic]
1006:
1.69 sommerfe 1007:
1008: Other variables of note (incomplete list):
1009:
1.82 lukem 1010: WARNS Crank up gcc warning options; the distinct levels are:
1011: WARNS=1
1012: WARNS=2
1013: WARNS=3
1.69 sommerfe 1014:
1015: FORMAT_AUDIT If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
1016: WFORMAT -Wnetbsd-format-audit for extra-stringent format checking.
1.75 agc 1017: WFORMAT belongs in individual makefiles and/or
1018: Makefile.inc files. (set WFORMAT=1 in individual
1019: makefiles if a program is not security critical and is
1020: doing bizarre things with format strings which would
1021: be even uglier if rewritten) FORMAT_AUDIT should go in
1022: mk.conf if you're doing format-string auditing.
1.69 sommerfe 1023: FORMAT_AUDIT may go away in time.
1.30 agc 1024:
1025: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CVSweb <webmaster@jp.NetBSD.org>