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