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