Annotation of src/share/mk/bsd.README, Revision 1.96
1.96 ! itojun 1: # $NetBSD: bsd.README,v 1.95 2002/04/10 15:05:45 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.
60:
1.45 lukem 61: The following variables that control how things are made/installed that
1.47 tv 62: are not set by default. These should not be set by Makefiles; they're for
63: the user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
64: command line:
1.21 christos 65:
1.45 lukem 66: BUILD If defined, 'make install' checks that the targets in the
67: source directories are up-to-date and remakes them if they
1.21 christos 68: are out of date, instead of blindly trying to install
1.79 wiz 69: out of date or non-existent targets.
1.21 christos 70:
1.45 lukem 71: UPDATE If defined, 'make install' only installs targets that are
72: more recently modified in the source directories that their
73: installed counterparts.
1.52 simonb 74:
1.83 perry 75: UNPRIVED If defined, don't set the owner/group/mode when installing
76: files or directories, and keep a metadata log of what
77: the owner/group/mode should be. This allows a
78: non-root "make install".
1.45 lukem 79:
1.86 thorpej 80: MKBFD If "no", don't build libbfd, libiberty, or any of
81: the things that depend on them (binutils/gas/ld,
82: gdb, dbsym, mdsetimage). Only meaningful if
83: USE_NEW_TOOLCHAIN is set.
84:
1.45 lukem 85: MKCATPAGES If "no", don't build or install the catman pages.
86:
87: MKDOC If "no", don't build or install the documentation.
1.86 thorpej 88:
89: MKGDB If "no", don't build gdb. Only meaningful if
90: USE_NEW_TOOLCHAIN is set.
91:
92: MKGCC If "no", don't build gcc or any of the gcc-related
93: libraries (libg2c, libgcc, libobjc, libstdc++).
94: Only meaningful if USE_NEW_TOOLCHAIN is set.
1.92 ross 95:
96: MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance.
97: Has no effect on most platforms.
1.45 lukem 98:
1.47 tv 99: MKINFO If "no", don't build or install Info documentation from
100: Texinfo source files.
1.45 lukem 101:
102: MKLINT If "no", don't build or install the lint libraries.
103:
104: MKMAN If "no", don't build or install the man or catman pages.
1.46 lukem 105: Also acts as "MKCATPAGES=no"
1.45 lukem 106:
1.74 itojun 107: MKNLS If "no", don't build or install the NLS files and locale
108: definition files.
1.45 lukem 109:
1.55 sommerfe 110: MKOBJ If "no", don't enable the rule which creates objdirs.
111: "yes" by default.
112:
113: MKOBJDIRS If "no", don't create objdirs during a "make build".
114: "no" by default.
1.45 lukem 115:
116: MKPIC If "no", don't build or install shared libraries.
117:
118: MKPICINSTALL If "no", don't install the *_pic.a libraries.
119:
120: MKPROFILE If "no", don't build or install the profiling libraries.
121:
1.48 lukem 122: MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
123: MKNLS=no". I.e, don't build catman pages, documentation,
124: Info documentation, man pages, NLS files, ...
1.1 cgd 125:
126: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
127:
128: The include file <sys.mk> has the default rules for all makes, in the BSD
129: environment or otherwise. You probably don't want to touch this file.
1.71 itojun 130: If you intend to run a cross build, you will need to supply the following
131: host tools, and configure the following variables properly:
132:
133: OBJCOPY objcopy - copy and translate object files
134:
135: STRIP strip - Discard symbols from object files
136:
137: CONFIG config - build kernel compilation directories
138:
139: RPCGEN rpcgen - Remote Procedure Call (RPC) protocol compiler
140:
141: MKLOCALE mklocale - make LC_CTYPE locale files
1.80 jmc 142:
143: MTREE mtree - build directory tree from a spec file
1.1 cgd 144:
145: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
146:
147: The include file <bsd.man.mk> handles installing manual pages and their
148: links.
149:
1.21 christos 150: It has a two targets:
1.1 cgd 151:
152: maninstall:
1.21 christos 153: Install the manual page sources and their links.
154: catinstall:
155: Install the preformatted manual pages and their links.
1.1 cgd 156:
157: It sets/uses the following variables:
158:
159: MANDIR Base path for manual installation.
160:
161: MANGRP Manual group.
162:
163: MANOWN Manual owner.
164:
165: MANMODE Manual mode.
166:
167: MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
168: or "/tahoe" for machine specific manual pages.
169:
1.15 cgd 170: MAN The manual pages to be installed (use a .1 - .9 suffix).
1.1 cgd 171:
1.15 cgd 172: MLINKS List of manual page links (using a .1 - .9 suffix). The
1.1 cgd 173: linked-to file must come first, the linked file second,
174: and there may be multiple pairs. The files are soft-linked.
175:
176: The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
177: it exists.
178:
179: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
180:
1.17 thorpej 181: The include file <bsd.own.mk> contains source tree configuration parameters,
182: such as the owners, groups, etc. for both manual pages and binaries, and
183: a few global "feature configuration" parameters.
1.1 cgd 184:
185: It has no targets.
186:
1.29 cjs 187: To get system-specific configuration parameters, bsd.own.mk will try to
188: include the file specified by the "MAKECONF" variable. If MAKECONF is not
189: set, or no such file exists, the system make configuration file, /etc/mk.conf
190: is included. These files may define any of the variables described below.
1.17 thorpej 191:
192: bsd.own.mk sets the following variables, if they are not already defined
193: (defaults are in brackets):
1.15 cgd 194:
1.95 lukem 195: _SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
196: based on the presence of build.sh and tools/ .
197:
1.15 cgd 198: BSDSRCDIR The real path to the system sources, so that 'make obj'
199: will work correctly. [/usr/src]
200:
201: BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
202: will work correctly. [/usr/obj]
203:
1.34 lukem 204: BINGRP Binary group. [wheel]
1.15 cgd 205:
1.34 lukem 206: BINOWN Binary owner. [root]
1.15 cgd 207:
208: BINMODE Binary mode. [555]
209:
210: NONBINMODE Mode for non-executable files. [444]
211:
212: MANDIR Base path for manual installation. [/usr/share/man/cat]
213:
1.34 lukem 214: MANGRP Manual group. [wheel]
1.15 cgd 215:
1.34 lukem 216: MANOWN Manual owner. [root]
1.15 cgd 217:
218: MANMODE Manual mode. [${NONBINMODE}]
219:
1.21 christos 220: MANINSTALL Manual installation type: maninstall, catinstall, or both
1.76 fair 221:
222: LDSTATIC Control program linking; if set blank, link everything
223: dynamically. If set to "-static", link everything statically.
224: If not set, programs link according to their makefile.
1.21 christos 225:
1.15 cgd 226: LIBDIR Base path for library installation. [/usr/lib]
227:
1.85 lukem 228: SHLIBDIR If ${USE_SHLIBDIR} is "yes", use ${SHLIBDIR} instead of
229: ${LIBDIR} as the base path for shared library installation.
230: [/usr/lib]
231:
232: _LIBSODIR Set to ${SHLIBDIR} if ${USE_SHLIBDIR} is "yes",
233: otherwise set to ${LIBDIR}
234:
235: SHLINKDIR Base path for shared linker. [/usr/libexec]
236:
1.15 cgd 237: LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
238:
239: LIBGRP Library group. [${BINGRP}]
240:
241: LIBOWN Library owner. [${BINOWN}]
242:
243: LIBMODE Library mode. [${NONBINMODE}]
244:
245: DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
246: installation. [/usr/share/doc]
1.62 simonb 247:
248: HTMLDOCDIR Base path for html system documentation installation.
249: [/usr/share/doc/html]
1.15 cgd 250:
1.34 lukem 251: DOCGRP Documentation group. [wheel]
1.15 cgd 252:
1.34 lukem 253: DOCOWN Documentation owner. [root]
1.15 cgd 254:
255: DOCMODE Documentation mode. [${NONBINMODE}]
256:
1.84 kleink 257: NLSDIR Base path for Native Language Support files installation.
1.15 cgd 258: [/usr/share/nls]
1.1 cgd 259:
1.84 kleink 260: NLSGRP Native Language Support files group. [wheel]
1.1 cgd 261:
1.84 kleink 262: NLSOWN Native Language Support files owner. [root]
1.1 cgd 263:
1.84 kleink 264: NLSMODE Native Language Support files mode. [${NONBINMODE}]
1.1 cgd 265:
1.32 mikel 266: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 267: to be stripped. This is to be used when building your
268: own install script so that the entire system can be made
1.15 cgd 269: stripped/not-stripped using a single knob. [-s]
1.1 cgd 270:
1.2 cgd 271: COPY The flag passed to the install program to cause the binary
272: to be copied rather than moved. This is to be used when
273: building our own install script so that the entire system
274: can either be installed with copies, or with moves using
1.15 cgd 275: a single knob. [-c]
276:
1.17 thorpej 277: Additionally, the following variables may be set by bsd.own.mk or in a
278: make configuration file to modify the behaviour of the system build
279: process (default values are in brackets along with comments, if set by
280: bsd.own.mk):
1.15 cgd 281:
1.64 thorpej 282: MKCRYPTO If set to "no", no cryptography support will be built
283: into the system. Defaults to "yes".
284:
1.66 itojun 285: MKCRYPTO_IDEA If set to "yes", IDEA support will be built into
286: libcrypto_idea.a. Defaults to "no".
1.64 thorpej 287:
1.66 itojun 288: MKCRYPTO_RC5 If set to "yes", RC5 support will be built into
289: libcrypto_rc5.a. Defaults to "no".
1.64 thorpej 290:
1.94 thorpej 291: MKHESIOD If set to "no", disables building of Hesiod infrastructure
292: (libraries and support programs).
1.64 thorpej 293:
1.94 thorpej 294: MKKERBEROS If set to "no", disables building of Kerberos (v4 or v5)
295: infrastructure (libraries and support programs).
1.2 cgd 296:
1.94 thorpej 297: MKSKEY If set to "no", disables building of S/key authentication
298: infrastructure (libraries and support programs).
299:
300: MKYP If set to "no", disables building of YP (NIS)
301: infrastructure (libraries and support programs).
302:
303: USE_HESIOD If set to "no", disables building Hesiod support into
304: various system utilities/libraries that support it.
305: If MKHESIOD is set to "no", USE_HESIOD will also be
306: forced to "no".
307:
308: USE_KERBEROS If set to "no", disables building Kerberos (v4 or v5)
309: support into various system utilities/libraries that
310: support it. If MKKERBEROS is set to "no", USE_KERBEROS
311: will also be forced to "no".
312:
313: USE_SKEY If set to "no", disables building S/key authentication
314: support into various system utilities/libraries that
315: support it. If MKSKEY is set to "no", USE_SKEY will
316: also be forced to "no".
317:
318: USE_YP If set to "no", disables building YP (NIS) support into
319: various system utilities/libraries that support it. If
320: MKYP is set to "no", USE_YP will also be forced to "no".
1.15 cgd 321:
322: MANZ Compress manual pages at installation time.
323:
324: SYS_INCLUDE Copy or symlink kernel include files into /usr/include.
325: Possible values are "symlinks" or "copies" (which is
326: the same as the variable being unset).
1.1 cgd 327:
1.15 cgd 328: NOPROFILE Do not build profiled versions of system libraries
1.1 cgd 329:
1.15 cgd 330: NOPIC Do not build PIC versions of system libraries, and
331: do not build shared libraries. [set if ${MACHINE_ARCH}
1.65 jlam 332: is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
1.1 cgd 333:
1.40 perry 334: NOLINT Do not build lint libraries.
1.33 jonathan 335:
1.50 thorpej 336: OBJECT_FMT Object file format. [set to "ELF" on architectures that
337: use ELF -- currently if ${MACHINE_ARCH} is "alpha",
338: "mipsel", "mipseb", "powerpc", "sparc", "sparc64",
1.77 simonb 339: "i386" and some m68k machines, or set to "a.out" on
340: other architectures].
1.33 jonathan 341:
1.78 simonb 342: MKSOFTFLOAT If "yes", build with options to enable the compiler to
343: generate output containing library calls for floating
344: point and possibly soft-float library support. Defaults
345: to "no".
1.1 cgd 346:
1.17 thorpej 347: bsd.own.mk is generally useful when building your own Makefiles so that
1.1 cgd 348: they use the same default owners etc. as the rest of the tree.
349:
350: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
351:
352: The include file <bsd.prog.mk> handles building programs from one or
353: more source files, along with their manual pages. It has a limited number
354: of suffixes, consistent with the current needs of the BSD tree.
355:
1.16 jtc 356: It has eight targets:
1.1 cgd 357:
358: all:
359: build the program and its manual page
360: clean:
361: remove the program, any object files and the files a.out,
1.24 mikel 362: Errs, errs, mklog, and ${PROG}.core.
1.1 cgd 363: cleandir:
364: remove all of the files removed by the target clean, as
365: well as .depend, tags, and any manual pages.
1.42 lukem 366: `distclean' is a synonym for `cleandir'.
1.1 cgd 367: depend:
368: make the dependencies for the source files, and store
369: them in the file .depend.
1.16 jtc 370: includes:
371: install any header files.
1.1 cgd 372: install:
373: install the program and its manual pages; if the Makefile
374: does not itself define the target install, the targets
375: beforeinstall and afterinstall may also be used to cause
376: actions immediately before and after the install target
377: is executed.
378: lint:
379: run lint on the source files
380: tags:
381: create a tags file for the source files.
382:
383: It sets/uses the following variables:
384:
385: BINGRP Binary group.
386:
387: BINOWN Binary owner.
388:
389: BINMODE Binary mode.
390:
391: CLEANFILES Additional files to remove for the clean and cleandir targets.
392:
393: COPTS Additional flags to the compiler when creating C objects.
1.35 lukem 394:
395: CPPFLAGS Additional flags to the C pre-processor
1.1 cgd 396:
397: LDADD Additional loader objects. Usually used for libraries.
398: For example, to load with the compatibility and utility
399: libraries, use:
400:
1.5 jtc 401: LDADD+=-lutil -lcompat
1.1 cgd 402:
403: LDFLAGS Additional loader flags.
404:
405: LINKS The list of binary links; should be full pathnames, the
406: linked-to file coming first, followed by the linked
407: file. The files are hard-linked. For example, to link
408: /bin/test and /bin/[, use:
409:
410: LINKS= ${DESTDIR}/bin/test ${DESTDIR}/bin/[
1.19 perry 411:
412: SYMLINKS The list of symbolic links; should be full pathnames.
1.20 perry 413: Syntax is identical to LINKS. Note that DESTDIR is not
414: automatically included in the link.
1.1 cgd 415:
1.15 cgd 416: MAN Manual pages (should end in .1 - .9). If no MAN variable is
1.8 cgd 417: defined, "MAN=${PROG}.1" is assumed.
1.1 cgd 418:
419: PROG The name of the program to build. If not supplied, nothing
420: is built.
421:
1.88 thorpej 422: PROG_CXX If defined, the name of the program to build. Also
423: causes <bsd.prog.mk> to link the program with the C++
424: compiler rather than the C compiler. PROG_CXX overrides
425: the value of PROG if PROG is also set.
1.87 thorpej 426:
1.21 christos 427: PROGNAME The name that the above program will be installed as, if
428: different from ${PROG}.
429:
1.37 tv 430: SRCS List of source files to build the program. If SRCS is not
1.1 cgd 431: defined, it's assumed to be ${PROG}.c.
432:
433: DPADD Additional dependencies for the program. Usually used for
434: libraries. For example, to depend on the compatibility and
435: utility libraries use:
436:
1.5 jtc 437: DPADD+=${LIBCOMPAT} ${LIBUTIL}
1.1 cgd 438:
439: The following libraries are predefined for DPADD:
440:
1.21 christos 441: LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
442: LIBC?= ${DESTDIR}/usr/lib/libc.a
443: LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
444: LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
445: LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
446: LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
447: LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
448: LIBDES?= ${DESTDIR}/usr/lib/libdes.a
449: LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1.73 blymn 450: LIBFORM?= ${DESTDIR}/usr/lib/libform.a
1.21 christos 451: LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
452: LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1.70 itojun 453: LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
1.49 itojun 454: LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
1.21 christos 455: LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
456: LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
457: LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
458: LIBL?= ${DESTDIR}/usr/lib/libl.a
459: LIBM?= ${DESTDIR}/usr/lib/libm.a
1.53 blymn 460: LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
1.21 christos 461: LIBMP?= ${DESTDIR}/usr/lib/libmp.a
1.25 christos 462: LIBNTP?= ${DESTDIR}/usr/lib/libntp.a
1.21 christos 463: LIBPC?= ${DESTDIR}/usr/lib/libpc.a
464: LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
465: LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a
1.26 kleink 466: LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
1.21 christos 467: LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
468: LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
469: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
470: LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
471: LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
472: LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
473: LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
474: LIBY?= ${DESTDIR}/usr/lib/liby.a
475: LIBZ?= ${DESTDIR}/usr/lib/libz.a
1.1 cgd 476:
477: SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
1.12 christos 478: strings, using xstr(1). Note that this will not work with
479: parallel makes.
1.1 cgd 480:
1.59 jlam 481: STRIPFLAG The flag passed to the install program to cause the binary
1.1 cgd 482: to be stripped.
483:
484: SUBDIR A list of subdirectories that should be built as well.
485: Each of the targets will execute the same target in the
486: subdirectories.
487:
1.21 christos 488: SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
489: These are installed exactly like programs.
490:
491: SCRIPTSNAME The name that the above program will be installed as, if
492: different from ${SCRIPTS}. These can be further specialized
493: by setting SCRIPTSNAME_<script>.
494:
495: FILES A list of files to install. The installation is controlled
496: by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
497: variables that can be further specialized by FILES<VAR>_<file>
498:
1.85 lukem 499: SHLINKDIR Target directory for shared linker.
500:
1.1 cgd 501: The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
502: if it exists, as well as the include file <bsd.man.mk>.
503:
504: Some simple examples:
505:
506: To build foo from foo.c with a manual page foo.1, use:
507:
508: PROG= foo
509:
510: .include <bsd.prog.mk>
511:
512: To build foo from foo.c with a manual page foo.2, add the line:
513:
1.9 cgd 514: MAN= foo.2
1.1 cgd 515:
516: If foo does not have a manual page at all, add the line:
517:
1.75 agc 518: MKMAN= no
1.1 cgd 519:
520: If foo has multiple source files, add the line:
521:
522: SRCS= a.c b.c c.c d.c
523:
524: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
525:
526: The include file <bsd.subdir.mk> contains the default targets for building
1.16 jtc 527: subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
528: clean, cleandir, depend, includes, install, lint, and tags. For all of
1.72 sommerfe 529: the directories listed in the variable SUBDIR, the specified directory
1.16 jtc 530: will be visited and the target made. There is also a default target which
531: allows the command "make subdir" where subdir is any directory listed in
1.72 sommerfe 532: the variable SUBDIR.
533:
534: As a special case, the use of a token .WAIT as an entry in SUBDIR acts
535: as a synchronization barrier when multiple make jobs are run; subdirs
536: before the .WAIT must complete before any subdirs after .WAIT are
1.75 agc 537: started. See make(1) for some caveats on use of .WAIT and other
538: special sources.
1.21 christos 539:
540: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
541:
1.23 christos 542: The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
543: and is included from from bsd.lib.mk and bsd.prog.mk.
544:
545: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
546:
547: The include file <bsd.files.mk> handles the FILES variables and is included
548: from bsd.lib.mk and bsd.prog.mk.
1.21 christos 549:
550: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
551:
1.29 cjs 552: The include file <bsd.inc.mk> defines the includes target and uses two
553: variables:
1.21 christos 554:
1.81 wiz 555: INCS The list of include files
1.21 christos 556:
1.81 wiz 557: INCSDIR The location to install the include files.
558:
559: INCSNAME Target name of the include file, if only one; same as
560: FILESNAME, but for include files.
561:
562: INCSNAME_<file> The name file <file> should be installed as, if not <file>,
563: same as FILESNAME_<file>, but for include files.
1.39 cgd 564:
565: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
566:
567: The include file <bsd.kinc.mk> defines the many targets (includes,
568: subdirectories, etc.), and is used by kernel makefiles to handle
569: include file installation. It is intended to be included alone, by
570: kernel Makefiles. Please see bsd.kinc.mk for more details, and keep
571: the documentation in that file up to date.
1.13 christos 572:
573: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
574:
1.47 tv 575: The include file <bsd.info.mk> is used to generate and install GNU Info
576: documentation from respective Texinfo source files. It defines three
577: implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
578: following variables:
579:
580: TEXINFO List of Texinfo source files. Info documentation will
581: consist of single files with the extension replaced by
582: .info.
583:
584: INFOFLAGS Flags to pass to makeinfo. []
585:
586: INSTALL_INFO Name of install-info program. [install-info]
587:
588: MAKEINFO Name of makeinfo program. [makeinfo]
589:
590: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
591:
1.13 christos 592: The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1.14 cgd 593: <bsd.lib.mk>. It contains overrides that are used when building
594: the NetBSD source tree. For instance, if "PARALLEL" is defined by
595: the program/library Makefile, it includes a set of rules for lex and
596: yacc that allow multiple lex and yacc targets to be built in parallel.
1.69 sommerfe 597:
598: Other variables of note (incomplete list):
599:
1.82 lukem 600: WARNS Crank up gcc warning options; the distinct levels are:
601: WARNS=1
602: WARNS=2
603: WARNS=3
1.69 sommerfe 604:
605: FORMAT_AUDIT If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
606: WFORMAT -Wnetbsd-format-audit for extra-stringent format checking.
1.75 agc 607: WFORMAT belongs in individual makefiles and/or
608: Makefile.inc files. (set WFORMAT=1 in individual
609: makefiles if a program is not security critical and is
610: doing bizarre things with format strings which would
611: be even uglier if rewritten) FORMAT_AUDIT should go in
612: mk.conf if you're doing format-string auditing.
1.69 sommerfe 613: FORMAT_AUDIT may go away in time.
1.1 cgd 614:
615: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
616:
617: The include file <bsd.lib.mk> has support for building libraries. It has
1.16 jtc 618: the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
1.44 erh 619: includes, install, lint, and tags. Additionally, it has a checkver target
620: which checks for installed shared object libraries whose version is greater
621: that the version of the source. It has a limited number of suffixes,
1.16 jtc 622: consistent with the current needs of the BSD tree.
1.1 cgd 623:
624: It sets/uses the following variables:
1.10 cgd 625:
626: LIB The name of the library to build.
1.1 cgd 627:
628: LIBDIR Target directory for libraries.
1.85 lukem 629:
630: SHLIBDIR Target directory for shared libraries if ${USE_SHLIBDIR}
631: is "yes".
632:
633: USE_SHLIBDIR If "yes", use ${SHLIBDIR} instead of ${LIBDIR}
634: as the path to install shared libraries to.
1.1 cgd 635:
636: LINTLIBDIR Target directory for lint libraries.
637:
638: LIBGRP Library group.
639:
640: LIBOWN Library owner.
641:
642: LIBMODE Library mode.
643:
644: LDADD Additional loader objects.
645:
1.15 cgd 646: MAN The manual pages to be installed (use a .1 - .9 suffix).
1.47 tv 647:
648: MKLINKLIB If "no", act as "MKPICINSTALL=no MKPROFILE=no".
649: Also:
650: - don't install the .a libraries
651: - don't install _pic.a libraries on PIC systems
652: - don't build .a libraries on PIC systems
653: - don't install the .so symlink on ELF systems
654: I.e, only install the shared library (and the .so.major
655: symlink on ELF).
1.54 simonb 656:
657: MKPICLIB If "no", don't build _pic.a libraries, and build the
658: shared object libraries from the .a libraries. A
659: symlink is installed in ${DESTDIR}/usr/lib for the
660: _pic.a library pointing to the .a library.
1.44 erh 661:
662: NOCHECKVER_<library>
663: NOCHECKVER If set, disables checking for installed shared object
664: libraries with versions greater than the source. A
665: particular library name, without the "lib" prefix, may
666: be appended to the variable name to disable the check for
667: only that library.
1.1 cgd 668:
669: SRCS List of source files to build the library. Suffix types
670: .s, .c, and .f are supported. Note, .s files are preferred
671: to .c files of the same name. (This is not the default for
672: versions of make.)
673:
674: The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
675: if it exists, as well as the include file <bsd.man.mk>.
676:
677: It has rules for building profiled objects; profiled libraries are
678: built by default.
679:
1.4 cgd 680: Libraries are ranlib'd when made.
1.56 sommerfe 681:
682: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
683:
684: The include file <bsd.obj.mk> defines targets related to the creation
685: and use of separated object and source directories.
686:
1.63 sjg 687: If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
688: ${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
1.75 agc 689: it exists. Otherwise make(1) looks for the existence of a
1.63 sjg 690: subdirectory (or a symlink to a directory) of the source directory
691: into which built targets should be placed. If an environment variable
692: named MAKEOBJDIR is set, make(1) uses its value as the name of the
693: object directory; failing that, make first looks for a subdirectory
694: named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
1.56 sommerfe 695:
696: Object directories are not created automatically by make(1) if they
697: don't exist; you need to run a separate "make obj". (This will happen
698: during a top-level build if "MKOBJDIRS" is set to a value other than
1.58 sommerfe 699: "no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
700: and this is determined by a simple string prefix comparison -- object
701: directories are created in a separate object directory tree, and a
702: symlink to the object directory in that tree is created in the source
703: directory; otherwise, "make obj" assumes that you're not in the main
704: source tree and that it's not safe to use a separate object tree.
1.56 sommerfe 705:
706: Several variables used by <bsd.obj.mk> control exactly what
707: directories and links get created during a "make obj":
708:
709: MAKEOBJDIR If set, this is the component name of the object
710: directory.
711:
712: OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
713: object directories or links named "obj.${MACHINE}";
714: otherwise, just creates ones named "obj".
715:
716: USR_OBJMACHINE If set, and the current directory is a subdirectory of
717: ${BSDSRCDIR}, create object directory in the
718: corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
719: otherwise, create it in the corresponding subdirectory
720: of ${BSDOBJDIR}
1.93 thorpej 721:
722: BUILDID If set, the contents of this variable are appended
723: to the object directory name. If OBJMACHINE is also
724: set, ".${BUILDID}" is added after ".${MACHINE}".
1.63 sjg 725:
726: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
727:
728: The include file <bsd.kernobj.mk> defines variables related to the
729: location of kernel sources and object directories.
730:
731: KERNSRCDIR Is the location of the top of the kernel src.
1.95 lukem 732: It defaults to ${_SRC_TOP_}/sys
1.63 sjg 733:
734: KERNARCHDIR Is the location of the machine dependent kernel
735: sources. It defaults to arch/${MACHINE}
736:
737: KERNCONFDIR Is where the configuration files for kernels are
738: found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
739:
740: KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
741: instance will be compiled in ${KERNOBJDIR}/GENERIC.
742: The default value is
743: ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
744: if it exists or the target 'obj' is being made.
745: Otherwise the default is
746: ${KERNSRCDIR}/${KERNARCHDIR}/compile.
747:
748: It is important that Makefiles (such as those under src/distrib) that
749: wish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
750: rather than make assumptions about the location of the compiled kernel.
1.30 agc 751:
752: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CVSweb <webmaster@jp.NetBSD.org>