Annotation of src/Makefile, Revision 1.96
1.96 ! scottr 1: # $NetBSD: Makefile,v 1.95 1999/04/01 02:49:12 cjs Exp $
1.95 cjs 2:
3: # This is the top-level makefile for building NetBSD. For an outline of
4: # how to build a snapshot or release, as well as other release engineering
5: # information, see http://www.netbsd.org/developers/releng/index.html
6: #
7: # Not everything you can set or do is documented in this makefile. In
8: # particular, you should review the files in /usr/share/mk (especially
9: # bsd.README) for general information on building programs and writing
10: # Makefiles within this structure, and see the comments in src/etc/Makefile
11: # for further information on installation and release set options.
12: #
13: # Variables listed below can be set on the make command line (highest
14: # priority), in /etc/mk.conf (middle priority), or in the environment
15: # (lowest priority).
16: #
17: # Variables:
18: # NBUILDJOBS is the number of jobs to start in parallel during a
19: # 'make build'. It defaults to 1.
20: # MKMAN, if set to `no', will prevent building of manual pages.
21: # MKSHARE, if set to `no', will prevent building and installing
22: # anything in /usr/share.
23: # UPDATE will avoid a `make cleandir' at the start of `make build',
24: # as well as having the effects listed in /usr/share/mk/bsd.README.
25: # DESTDIR is the target directory for installation of the compiled
26: # software. It defaults to /. Note that programs are built against
27: # libraries installed in DESTDIR.
1.96 ! scottr 28: # EXPORTABLE_SYSTEM, when set, ensures that non-exportable crypto code
! 29: # is not compiled or installed. EXPORTABLE_SYSTEM is ignored if
! 30: # the `domestic' subtree does not exist.
! 31: # FORCE_DOMESTIC, when set, forces a descent into the domestic tree
! 32: # when handling the `all', `includes', and `install' targets. This
! 33: # flag is incompatible with the `build' target. It's generally a
! 34: # bad idea to use FORCE_DOMESTIC unless the ramifications are well
! 35: # understood, and should never be enabled by default. FORCE_DOMESTIC
! 36: # is ignored if the `domestic' subtree does not exist.
1.95 cjs 37: #
38: # Targets:
39: # build: builds a full release of netbsd in DESTDIR.
40: # release: does a `make build,' and then tars up the DESTDIR files
41: # into RELEASEDIR, in release(7) format. (See etc/Makefile for
42: # more information on this.)
43: # snapshot: a synonym for release.
1.32 cgd 44:
45: .include <bsd.own.mk> # for configuration variables.
1.4 cgd 46:
1.76 bouyer 47:
1.58 tv 48: HAVE_GCC28!= ${CXX} --version | egrep "^(2\.8|egcs)" ; echo
49:
1.76 bouyer 50: .if defined(NBUILDJOBS)
51: _J= -j${NBUILDJOBS}
52: .endif
53:
1.4 cgd 54: # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
1.2 cgd 55:
1.52 mycroft 56: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
1.36 explorer 57:
58: .if exists(games)
59: SUBDIR+= games
60: .endif
61:
1.8 cgd 62: SUBDIR+= gnu
1.52 mycroft 63: # This is needed for libstdc++ and gen-params.
64: includes-gnu: includes-include includes-sys
1.9 cgd 65:
1.82 scottr 66: # Descend into the domestic tree if it exists AND
67: # 1) the target is clean, cleandir, or obj, OR
1.93 scottr 68: # 2) the the target is install or includes AND
1.96 ! scottr 69: # NOT compiling only "exportable" code AND
! 70: # doing it as part of installing a distribution, OR
! 71: # 3) we Really Know what we're doing. (Really!)
1.94 scottr 72: #
73: # NOTE: due to the use of the make(foo) construct here, using the
74: # clean, cleandir, and obj targets on the command line in conjunction
75: # with any other target may produce unexpected results.
1.82 scottr 76:
1.79 scottr 77: .if exists(domestic) && \
78: (make(clean) || make(cleandir) || make(obj) || \
1.82 scottr 79: ((make(includes) || make(install)) && \
1.96 ! scottr 80: !defined(EXPORTABLE_SYSTEM) && defined(_DISTRIB)) || \
! 81: defined(FORCE_DOMESTIC))
1.21 cgd 82: SUBDIR+= domestic
83: .endif
84:
1.13 brezak 85: .if exists(regress)
1.9 cgd 86: .ifmake !(install)
87: SUBDIR+= regress
88: .endif
89:
1.10 cgd 90: regression-tests:
91: @echo Running regression tests...
1.22 cgd 92: @(cd ${.CURDIR}/regress && ${MAKE} regress)
1.13 brezak 93: .endif
1.20 cgd 94:
1.26 tls 95: beforeinstall:
1.45 perry 96: .ifmake build
97: @echo -n "Build started at: "
98: @date
99: .endif
1.26 tls 100: .ifndef DESTDIR
101: (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
1.31 tls 102: .else
103: (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs)
1.26 tls 104: .endif
1.15 cgd 105:
106: afterinstall:
1.86 lukem 107: .if ${MKMAN} != "no" && !defined(_BUILD)
1.81 scottr 108: ${MAKE} whatis.db
109: .endif
110:
111: whatis.db:
1.22 cgd 112: (cd ${.CURDIR}/share/man && ${MAKE} makedb)
1.15 cgd 113:
1.84 tv 114: # wrt info/dir below: It's safe to move this over top of /usr/share/info/dir,
115: # as the build will automatically remove/replace the non-pkg entries there.
116:
1.43 thorpej 117: build: beforeinstall
1.96 ! scottr 118: .if defined(FORCE_DOMESTIC)
! 119: @echo '*** CAPUTE!'
! 120: @echo ' The FORCE_DOMESTIC flag is not compatible with "make build".'
! 121: @echo ' Please correct the problem and try again.'
! 122: @false
! 123: .endif
1.86 lukem 124: .if ${MKSHARE} != "no"
1.32 cgd 125: (cd ${.CURDIR}/share/mk && ${MAKE} install)
1.47 thorpej 126: (cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
1.68 lukem 127: .endif
1.39 christos 128: .if !defined(UPDATE)
1.17 cgd 129: ${MAKE} cleandir
1.39 christos 130: .endif
1.75 tv 131: .if empty(HAVE_GCC28)
1.71 mycroft 132: .if defined(DESTDIR)
133: @echo "*** CAPUTE!"
1.84 tv 134: @echo " You attempted to compile the world without egcs. You must"
1.71 mycroft 135: @echo " first install a native egcs compiler."
1.84 tv 136: @false
1.71 mycroft 137: .else
138: (cd ${.CURDIR}/gnu/usr.bin/egcs && \
1.86 lukem 139: ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
140: ${MAKE} MKMAN=no install && ${MAKE} cleandir)
1.71 mycroft 141: .endif
142: .endif
1.93 scottr 143: ${MAKE} includes
1.61 mycroft 144: (cd ${.CURDIR}/lib/csu && \
1.86 lukem 145: ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
146: ${MAKE} MKMAN=no install)
1.61 mycroft 147: (cd ${.CURDIR}/lib && \
1.86 lukem 148: ${MAKE} depend && ${MAKE} ${_J} MKMAN=no && \
149: ${MAKE} MKMAN=no install)
1.61 mycroft 150: (cd ${.CURDIR}/gnu/lib && \
1.89 mellon 151: ${MAKE} depend && ${MAKE} ${_J} MKMAN=no MKINFO=no && \
152: ${MAKE} MKMAN=no MKINFO=no install)
1.80 scottr 153: ${MAKE} depend && ${MAKE} ${_J} && ${MAKE} _BUILD= install
1.32 cgd 154: .if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
1.78 scottr 155: (cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)
1.49 lukem 156: .endif
1.81 scottr 157: ${MAKE} whatis.db
1.50 mellon 158: @echo -n "Build finished at: "
159: @date
1.87 cjs 160:
161: release snapshot: build
1.91 scottr 162: (cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
1.1 cgd 163:
164: .include <bsd.subdir.mk>
CVSweb <webmaster@jp.NetBSD.org>