Makefile revision 1.297 1 1.297 apb # $NetBSD: Makefile,v 1.297 2012/08/14 13:12:15 apb Exp $
2 1.95 cjs
3 1.193 lukem #
4 1.95 cjs # This is the top-level makefile for building NetBSD. For an outline of
5 1.95 cjs # how to build a snapshot or release, as well as other release engineering
6 1.221 salo # information, see http://www.NetBSD.org/developers/releng/index.html
7 1.95 cjs #
8 1.95 cjs # Not everything you can set or do is documented in this makefile. In
9 1.95 cjs # particular, you should review the files in /usr/share/mk (especially
10 1.95 cjs # bsd.README) for general information on building programs and writing
11 1.95 cjs # Makefiles within this structure, and see the comments in src/etc/Makefile
12 1.95 cjs # for further information on installation and release set options.
13 1.95 cjs #
14 1.95 cjs # Variables listed below can be set on the make command line (highest
15 1.95 cjs # priority), in /etc/mk.conf (middle priority), or in the environment
16 1.95 cjs # (lowest priority).
17 1.95 cjs #
18 1.95 cjs # Variables:
19 1.101 sommerfe # DESTDIR is the target directory for installation of the compiled
20 1.101 sommerfe # software. It defaults to /. Note that programs are built against
21 1.101 sommerfe # libraries installed in DESTDIR.
22 1.214 lukem # MKMAN, if `no', will prevent building of manual pages.
23 1.214 lukem # MKOBJDIRS, if not `no', will build object directories at
24 1.101 sommerfe # an appropriate point in a build.
25 1.214 lukem # MKSHARE, if `no', will prevent building and installing
26 1.95 cjs # anything in /usr/share.
27 1.214 lukem # MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
28 1.178 enami # `make build', as well as having the effects listed in
29 1.178 enami # /usr/share/mk/bsd.README.
30 1.125 mrg # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
31 1.178 enami # of the `make build'.
32 1.119 toddpw # NOINCLUDES will avoid the `make includes' usually done by `make build'.
33 1.95 cjs #
34 1.214 lukem # See mk.conf(5) for more details.
35 1.214 lukem #
36 1.214 lukem #
37 1.95 cjs # Targets:
38 1.137 tv # build:
39 1.196 lukem # Builds a full release of NetBSD in DESTDIR, except for the
40 1.196 lukem # /etc configuration files.
41 1.196 lukem # If BUILD_DONE is set, this is an empty target.
42 1.196 lukem # distribution:
43 1.196 lukem # Builds a full release of NetBSD in DESTDIR, including the /etc
44 1.196 lukem # configuration files.
45 1.196 lukem # buildworld:
46 1.196 lukem # As per `make distribution', except that it ensures that DESTDIR
47 1.196 lukem # is not the root directory.
48 1.196 lukem # installworld:
49 1.196 lukem # Install the distribution from DESTDIR to INSTALLWORLDDIR (which
50 1.196 lukem # defaults to the root directory). Ensures that INSTALLWORLDDIR
51 1.291 abs # is not the root directory if cross compiling.
52 1.137 tv # release:
53 1.240 lukem # Does a `make distribution', and then tars up the DESTDIR files
54 1.252 lukem # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
55 1.196 lukem # (See etc/Makefile for more information on this.)
56 1.137 tv # regression-tests:
57 1.137 tv # Runs the regression tests in "regress" on this host.
58 1.206 lukem # sets:
59 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
60 1.252 lukem # from ${DESTDIR}
61 1.206 lukem # sourcesets:
62 1.206 lukem # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
63 1.241 apb # syspkgs:
64 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
65 1.252 lukem # from ${DESTDIR}
66 1.243 apb # iso-image:
67 1.248 jnemeth # Create CD-ROM image in RELEASEDIR/iso.
68 1.243 apb # RELEASEDIR must already have been populated by `make release'
69 1.243 apb # or equivalent.
70 1.248 jnemeth # iso-image-source:
71 1.248 jnemeth # Create CD-ROM image with source in RELEASEDIR/iso.
72 1.248 jnemeth # RELEASEDIR must already have been populated by
73 1.248 jnemeth # `make release sourcesets' or equivalent.
74 1.290 tsutsui # live-image:
75 1.290 tsutsui # Create bootable live image for emulators or USB stick etc.
76 1.290 tsutsui # in RELEASEDIR/liveimage.
77 1.290 tsutsui # RELEASEDIR must already have been populated by `make release'
78 1.290 tsutsui # or equivalent.
79 1.290 tsutsui # install-image:
80 1.290 tsutsui # Create bootable installation image for USB stick etc.
81 1.290 tsutsui # in RELEASEDIR/installimage.
82 1.290 tsutsui # RELEASEDIR must already have been populated by `make release'
83 1.290 tsutsui # or equivalent.
84 1.123 mrg #
85 1.137 tv # Targets invoked by `make build,' in order:
86 1.155 tv # cleandir: cleans the tree.
87 1.261 apb # do-top-obj: creates the top level object directory.
88 1.260 apb # do-tools-obj: creates object directories for the host toolchain.
89 1.260 apb # do-tools: builds host toolchain.
90 1.137 tv # obj: creates object directories.
91 1.208 lukem # do-distrib-dirs: creates the distribution directories.
92 1.208 lukem # includes: installs include files.
93 1.202 thorpej # do-tools-compat: builds the "libnbcompat" library; needed for some
94 1.202 thorpej # random host tool programs in the source tree.
95 1.238 lukem # do-lib-csu: builds and installs prerequisites from lib/csu.
96 1.249 lukem # do-libgcc: builds and installs prerequisites from
97 1.249 lukem # gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
98 1.249 lukem # gnu/lib/libgcc${LIBGCC_EXT}.
99 1.256 gmcgarry # do-libpcc: builds and install prerequisites from
100 1.280 skrll # external/bsd/pcc/crtstuff (if necessary) and
101 1.280 skrll # external/bsd/pcc/libpcc.
102 1.186 thorpej # do-lib-libc: builds and installs prerequisites from lib/libc.
103 1.143 tv # do-lib: builds and installs prerequisites from lib.
104 1.274 pooka # do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
105 1.259 pooka # do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
106 1.277 pooka # do-sys-rump-kern-lib: builds and installs prereq. from sys/rump/kern/lib
107 1.259 pooka # do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
108 1.265 pooka # do-sys-modules: builds and installs kernel modules (used by rump binaries)
109 1.189 itohy # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
110 1.262 mrg # do-compat-lib-csu: builds and installs prerequisites from compat/lib/csu
111 1.262 mrg # if ${MKCOMPAT} != "no".
112 1.262 mrg # do-compat-libgcc: builds and installs prerequisites from
113 1.262 mrg # compat/gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
114 1.262 mrg # compat/gnu/lib/libgcc${LIBGCC_EXT} if ${MKCOMPAT} != "no".
115 1.262 mrg # do-compat-lib-libc: builds and installs prerequisites from compat/lib/libc
116 1.262 mrg # if ${MKCOMPAT} != "no".
117 1.137 tv # do-build: builds and installs the entire system.
118 1.263 mrg # do-x11: builds and installs X11 if ${MKX11} != "no"; either
119 1.263 mrg # X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
120 1.263 mrg # or X11R6 from src/x11
121 1.275 uebayasi # do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
122 1.222 lukem # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
123 1.193 lukem #
124 1.32 cgd
125 1.146 tv .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
126 1.146 tv .MAKEFLAGS: -m ${.CURDIR}/share/mk
127 1.146 tv .endif
128 1.163 tv
129 1.193 lukem #
130 1.163 tv # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
131 1.163 tv # not be the top level objdir, because "make obj" can happen in the *middle*
132 1.163 tv # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
133 1.163 tv # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
134 1.193 lukem #
135 1.163 tv _SRC_TOP_OBJ_=
136 1.148 jmc
137 1.146 tv .include <bsd.own.mk>
138 1.4 cgd
139 1.193 lukem #
140 1.137 tv # Sanity check: make sure that "make build" is not invoked simultaneously
141 1.137 tv # with a standard recursive target.
142 1.193 lukem #
143 1.137 tv
144 1.137 tv .if make(build) || make(release) || make(snapshot)
145 1.137 tv .for targ in ${TARGETS:Nobj:Ncleandir}
146 1.137 tv .if make(${targ}) && !target(.BEGIN)
147 1.137 tv .BEGIN:
148 1.137 tv @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
149 1.137 tv @false
150 1.137 tv .endif
151 1.137 tv .endfor
152 1.137 tv .endif
153 1.58 tv
154 1.261 apb #
155 1.261 apb # _SUBDIR is used to set SUBDIR, after removing directories that have
156 1.261 apb # BUILD_${dir}=no, or that have no ${dir}/Makefile.
157 1.261 apb #
158 1.271 christos _SUBDIR= tools lib include gnu external crypto/external bin games
159 1.271 christos _SUBDIR+= libexec sbin usr.bin
160 1.262 mrg _SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
161 1.105 assar
162 1.137 tv .for dir in ${_SUBDIR}
163 1.261 apb .if "${dir}" == ".WAIT" \
164 1.261 apb || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
165 1.137 tv SUBDIR+= ${dir}
166 1.36 explorer .endif
167 1.137 tv .endfor
168 1.21 cgd
169 1.13 brezak .if exists(regress)
170 1.242 dsl regression-tests: .PHONY .MAKE
171 1.10 cgd @echo Running regression tests...
172 1.232 lukem ${MAKEDIRTARGET} regress regress
173 1.13 brezak .endif
174 1.20 cgd
175 1.214 lukem .if ${MKUNPRIVED} != "no"
176 1.179 thorpej NOPOSTINSTALL= # defined
177 1.179 thorpej .endif
178 1.179 thorpej
179 1.242 dsl afterinstall: .PHONY .MAKE
180 1.137 tv .if ${MKMAN} != "no"
181 1.232 lukem ${MAKEDIRTARGET} share/man makedb
182 1.137 tv .endif
183 1.214 lukem .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
184 1.232 lukem ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
185 1.176 lukem .endif
186 1.179 thorpej .if !defined(NOPOSTINSTALL)
187 1.232 lukem ${MAKEDIRTARGET} . postinstall-check
188 1.159 perry .endif
189 1.170 lukem
190 1.239 lukem _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
191 1.295 apb _POSTINSTALL_ENV= \
192 1.295 apb AWK=${TOOL_AWK:Q} \
193 1.295 apb DB=${TOOL_DB:Q} \
194 1.295 apb MAKE=${MAKE:Q} \
195 1.297 apb PWD_MKDB=${TOOL_PWD_MKDB:Q} \
196 1.297 apb STAT=${TOOL_STAT:Q}
197 1.239 lukem
198 1.228 lukem postinstall-check: .PHONY
199 1.169 lukem @echo " === Post installation checks ==="
200 1.295 apb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
201 1.171 lukem @echo " ================================"
202 1.171 lukem
203 1.228 lukem postinstall-fix: .NOTMAIN .PHONY
204 1.171 lukem @echo " === Post installation fixes ==="
205 1.295 apb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
206 1.212 lukem @echo " ==============================="
207 1.212 lukem
208 1.228 lukem postinstall-fix-obsolete: .NOTMAIN .PHONY
209 1.212 lukem @echo " === Removing obsolete files ==="
210 1.295 apb ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
211 1.212 lukem @echo " ==============================="
212 1.169 lukem
213 1.108 erh
214 1.193 lukem #
215 1.137 tv # Targets (in order!) called by "make build".
216 1.193 lukem #
217 1.256 gmcgarry .if defined(HAVE_GCC)
218 1.284 mrg .if ${HAVE_GCC} == "4"
219 1.284 mrg LIBGCC_EXT=4
220 1.285 mrg BUILD_CC_LIB_BASEDIR= gnu/lib
221 1.285 mrg BUILD_CC_LIB_BASETARGET= gnu-lib
222 1.245 mrg .else
223 1.285 mrg LIBGCC_EXT=
224 1.285 mrg BUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib
225 1.285 mrg BUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib
226 1.220 mrg .endif
227 1.256 gmcgarry .endif
228 1.123 mrg
229 1.156 tv BUILDTARGETS+= check-tools
230 1.214 lukem .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
231 1.155 tv BUILDTARGETS+= cleandir
232 1.155 tv .endif
233 1.261 apb .if ${MKOBJDIRS} != "no"
234 1.261 apb BUILDTARGETS+= do-top-obj
235 1.261 apb .endif
236 1.261 apb .if ${USETOOLS} == "yes" # {
237 1.149 tv .if ${MKOBJDIRS} != "no"
238 1.260 apb BUILDTARGETS+= do-tools-obj
239 1.123 mrg .endif
240 1.152 tv BUILDTARGETS+= do-tools
241 1.261 apb .endif # USETOOLS # }
242 1.260 apb .if ${MKOBJDIRS} != "no"
243 1.260 apb BUILDTARGETS+= obj
244 1.260 apb .endif
245 1.270 apb BUILDTARGETS+= clean_METALOG
246 1.137 tv .if !defined(NODISTRIBDIRS)
247 1.137 tv BUILDTARGETS+= do-distrib-dirs
248 1.131 tv .endif
249 1.137 tv .if !defined(NOINCLUDES)
250 1.137 tv BUILDTARGETS+= includes
251 1.131 tv .endif
252 1.202 thorpej BUILDTARGETS+= do-tools-compat
253 1.231 skrll BUILDTARGETS+= do-lib-csu
254 1.207 drochner .if ${MKGCC} != "no"
255 1.249 lukem BUILDTARGETS+= do-libgcc
256 1.207 drochner .endif
257 1.256 gmcgarry .if ${MKPCC} != "no"
258 1.256 gmcgarry BUILDTARGET+= do-libpcc
259 1.256 gmcgarry .endif
260 1.231 skrll BUILDTARGETS+= do-lib-libc
261 1.281 plunky BUILDTARGETS+= do-lib
262 1.283 mrg .if ${MKKMOD} != "no"
263 1.265 pooka BUILDTARGETS+= do-sys-modules
264 1.265 pooka .endif
265 1.294 apb .if ${MKRUMP} != "no"
266 1.277 pooka BUILDTARGETS+= do-sys-rump-dev-lib do-sys-rump-fs-lib
267 1.277 pooka BUILDTARGETS+= do-sys-rump-kern-lib do-sys-rump-net-lib
268 1.293 christos .endif
269 1.262 mrg .if ${MKCOMPAT} != "no"
270 1.262 mrg BUILDTARGETS+= do-compat-lib-csu
271 1.262 mrg BUILDTARGETS+= do-compat-libgcc
272 1.262 mrg BUILDTARGETS+= do-compat-lib-libc
273 1.262 mrg .endif
274 1.224 lukem BUILDTARGETS+= do-ld.so
275 1.224 lukem BUILDTARGETS+= do-build
276 1.263 mrg .if ${MKX11} != "no"
277 1.227 lukem BUILDTARGETS+= do-x11
278 1.227 lukem .endif
279 1.275 uebayasi .if ${MKEXTSRC} != "no"
280 1.275 uebayasi BUILDTARGETS+= do-extsrc
281 1.275 uebayasi .endif
282 1.200 lukem BUILDTARGETS+= do-obsolete
283 1.131 tv
284 1.193 lukem #
285 1.137 tv # Enforce proper ordering of some rules.
286 1.193 lukem #
287 1.123 mrg
288 1.137 tv .ORDER: ${BUILDTARGETS}
289 1.228 lukem includes-lib: .PHONY includes-include includes-sys
290 1.228 lukem includes-gnu: .PHONY includes-lib
291 1.123 mrg
292 1.193 lukem #
293 1.137 tv # Build the system and install into DESTDIR.
294 1.193 lukem #
295 1.123 mrg
296 1.191 lukem START_TIME!= date
297 1.191 lukem
298 1.242 dsl build: .PHONY .MAKE
299 1.137 tv .if defined(BUILD_DONE)
300 1.137 tv @echo "Build already installed into ${DESTDIR}"
301 1.137 tv .else
302 1.191 lukem @echo "Build started at: ${START_TIME}"
303 1.145 tv .for tgt in ${BUILDTARGETS}
304 1.232 lukem ${MAKEDIRTARGET} . ${tgt}
305 1.145 tv .endfor
306 1.232 lukem ${MAKEDIRTARGET} etc install-etc-release
307 1.191 lukem @echo "Build started at: ${START_TIME}"
308 1.172 bjh21 @printf "Build finished at: " && date
309 1.71 mycroft .endif
310 1.160 thorpej
311 1.193 lukem #
312 1.160 thorpej # Build a full distribution, but not a release (i.e. no sets into
313 1.193 lukem # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
314 1.193 lukem #
315 1.160 thorpej
316 1.242 dsl distribution buildworld: .PHONY .MAKE
317 1.194 lukem .if make(buildworld) && \
318 1.194 lukem (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
319 1.193 lukem @echo "Won't make ${.TARGET} with DESTDIR=/"
320 1.193 lukem @false
321 1.193 lukem .endif
322 1.232 lukem ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
323 1.232 lukem ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
324 1.181 thorpej .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
325 1.232 lukem ${MAKEDIRTARGET} . postinstall-fix-obsolete
326 1.232 lukem ${MAKEDIRTARGET} distrib/sets checkflist
327 1.181 thorpej .endif
328 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
329 1.185 lukem @printf "make ${.TARGET} finished at: " && date
330 1.123 mrg
331 1.193 lukem #
332 1.193 lukem # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
333 1.193 lukem # If installing to /, ensures that the host's operating system is NetBSD and
334 1.193 lukem # the host's `uname -m` == ${MACHINE}.
335 1.193 lukem #
336 1.193 lukem
337 1.193 lukem HOST_UNAME_S!= uname -s
338 1.193 lukem HOST_UNAME_M!= uname -m
339 1.193 lukem
340 1.242 dsl installworld: .PHONY .MAKE
341 1.194 lukem .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
342 1.193 lukem @echo "Can't make ${.TARGET} to DESTDIR=/"
343 1.193 lukem @false
344 1.193 lukem .endif
345 1.193 lukem .if !defined(INSTALLWORLDDIR) || \
346 1.193 lukem ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
347 1.193 lukem .if (${HOST_UNAME_S} != "NetBSD")
348 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
349 1.193 lukem @false
350 1.193 lukem .endif
351 1.193 lukem .if (${HOST_UNAME_M} != ${MACHINE})
352 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
353 1.193 lukem @false
354 1.193 lukem .endif
355 1.193 lukem .endif
356 1.232 lukem ${MAKEDIRTARGET} distrib/sets installsets \
357 1.282 jym INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
358 1.232 lukem ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
359 1.193 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
360 1.193 lukem @printf "make ${.TARGET} finished at: " && date
361 1.199 lukem
362 1.199 lukem #
363 1.287 jmcneill # Install modules from $DESTDIR to $INSTALLMODULESDIR
364 1.287 jmcneill #
365 1.287 jmcneill installmodules: .PHONY .MAKE
366 1.287 jmcneill .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
367 1.287 jmcneill @echo "Can't make ${.TARGET} to DESTDIR=/"
368 1.287 jmcneill @false
369 1.287 jmcneill .endif
370 1.287 jmcneill .if !defined(INSTALLMODULESDIR) || \
371 1.287 jmcneill ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
372 1.287 jmcneill .if (${HOST_UNAME_S} != "NetBSD")
373 1.287 jmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
374 1.287 jmcneill @false
375 1.287 jmcneill .endif
376 1.287 jmcneill .if (${HOST_UNAME_M} != ${MACHINE})
377 1.287 jmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
378 1.287 jmcneill @false
379 1.287 jmcneill .endif
380 1.287 jmcneill .endif
381 1.288 jmcneill ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
382 1.287 jmcneill @echo "make ${.TARGET} started at: ${START_TIME}"
383 1.287 jmcneill @printf "make ${.TARGET} finished at: " && date
384 1.287 jmcneill
385 1.287 jmcneill #
386 1.206 lukem # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
387 1.199 lukem #
388 1.199 lukem
389 1.241 apb .for tgt in sets sourcesets syspkgs
390 1.242 dsl ${tgt}: .PHONY .MAKE
391 1.232 lukem ${MAKEDIRTARGET} distrib/sets ${tgt}
392 1.206 lukem .endfor
393 1.193 lukem
394 1.193 lukem #
395 1.240 lukem # Build a release or snapshot (implies "make distribution"). Note that
396 1.181 thorpej # in this case, the set lists will be checked before the tar files
397 1.181 thorpej # are made.
398 1.193 lukem #
399 1.123 mrg
400 1.242 dsl release snapshot: .PHONY .MAKE
401 1.240 lukem ${MAKEDIRTARGET} . distribution
402 1.240 lukem ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
403 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
404 1.185 lukem @printf "make ${.TARGET} finished at: " && date
405 1.123 mrg
406 1.193 lukem #
407 1.243 apb # Create a CD-ROM image.
408 1.243 apb #
409 1.243 apb
410 1.243 apb iso-image: .PHONY
411 1.247 bouyer ${MAKEDIRTARGET} distrib iso_image
412 1.243 apb ${MAKEDIRTARGET} etc iso-image
413 1.243 apb @echo "make ${.TARGET} started at: ${START_TIME}"
414 1.243 apb @printf "make ${.TARGET} finished at: " && date
415 1.243 apb
416 1.248 jnemeth iso-image-source: .PHONY
417 1.248 jnemeth ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
418 1.248 jnemeth ${MAKEDIRTARGET} etc iso-image
419 1.248 jnemeth @echo "make ${.TARGET} started at: ${START_TIME}"
420 1.248 jnemeth @printf "make ${.TARGET} finished at: " && date
421 1.248 jnemeth
422 1.243 apb #
423 1.290 tsutsui # Create bootable live images.
424 1.290 tsutsui #
425 1.290 tsutsui
426 1.290 tsutsui live-image: .PHONY
427 1.290 tsutsui ${MAKEDIRTARGET} etc live-image
428 1.290 tsutsui @echo "make ${.TARGET} started at: ${START_TIME}"
429 1.290 tsutsui @printf "make ${.TARGET} finished at: " && date
430 1.290 tsutsui
431 1.290 tsutsui #
432 1.290 tsutsui # Create bootable installation images.
433 1.290 tsutsui #
434 1.290 tsutsui
435 1.290 tsutsui install-image: .PHONY
436 1.290 tsutsui ${MAKEDIRTARGET} etc install-image
437 1.290 tsutsui @echo "make ${.TARGET} started at: ${START_TIME}"
438 1.290 tsutsui @printf "make ${.TARGET} finished at: " && date
439 1.290 tsutsui
440 1.290 tsutsui #
441 1.137 tv # Special components of the "make build" process.
442 1.193 lukem #
443 1.156 tv
444 1.228 lukem check-tools: .PHONY
445 1.223 lukem .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
446 1.187 thorpej @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
447 1.187 thorpej @echo '*** May result in a failed build or corrupt binaries!'
448 1.187 thorpej .elif defined(EXTERNAL_TOOLCHAIN)
449 1.187 thorpej @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
450 1.156 tv .endif
451 1.173 sommerfe .if defined(NBUILDJOBS)
452 1.173 sommerfe @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
453 1.173 sommerfe .endif
454 1.123 mrg
455 1.270 apb # Delete or sanitise a leftover METALOG from a previous build.
456 1.270 apb clean_METALOG: .PHONY .MAKE
457 1.270 apb .if ${MKUPDATE} != "no"
458 1.270 apb ${MAKEDIRTARGET} distrib/sets clean_METALOG
459 1.270 apb .endif
460 1.270 apb
461 1.242 dsl do-distrib-dirs: .PHONY .MAKE
462 1.147 jmc .if !defined(DESTDIR) || ${DESTDIR} == ""
463 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
464 1.147 jmc .else
465 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
466 1.147 jmc .endif
467 1.190 lukem
468 1.190 lukem .for targ in cleandir obj includes
469 1.228 lukem do-${targ}: .PHONY ${targ}
470 1.190 lukem @true
471 1.190 lukem .endfor
472 1.123 mrg
473 1.256 gmcgarry .if defined(HAVE_GCC)
474 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
475 1.285 mrg BUILD_CC_LIB= ${BUILD_CC_LIB_BASEDIR}/crtstuff${LIBGCC_EXT}
476 1.280 skrll .endif
477 1.285 mrg BUILD_CC_LIB+= ${BUILD_CC_LIB_BASEDIR}/libgcc${LIBGCC_EXT}
478 1.256 gmcgarry .elif defined(HAVE_PCC)
479 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/crtstuff
480 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/libpcc
481 1.256 gmcgarry .endif
482 1.256 gmcgarry
483 1.281 plunky .for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
484 1.242 dsl do-${dir:S/\//-/g}: .PHONY .MAKE
485 1.137 tv .for targ in dependall install
486 1.232 lukem ${MAKEDIRTARGET} ${dir} ${targ}
487 1.137 tv .endfor
488 1.184 lukem .endfor
489 1.184 lukem
490 1.276 mrg .if ${MKCOMPAT} != "no"
491 1.276 mrg COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
492 1.276 mrg .for dir in ${COMPAT_SUBDIR_LIST}
493 1.276 mrg do-compat-${dir:S/\//-/g}: .PHONY .MAKE
494 1.281 plunky .for targ in dependall install
495 1.276 mrg ${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS="../../../${dir}"
496 1.276 mrg .endfor
497 1.276 mrg .endfor
498 1.276 mrg .endif
499 1.276 mrg
500 1.261 apb do-top-obj: .PHONY .MAKE
501 1.261 apb ${MAKEDIRTARGET} . obj NOSUBDIR=
502 1.261 apb
503 1.260 apb do-tools-obj: .PHONY .MAKE
504 1.260 apb ${MAKEDIRTARGET} tools obj
505 1.260 apb
506 1.249 lukem do-libgcc: .PHONY .MAKE
507 1.256 gmcgarry .if defined(HAVE_GCC)
508 1.249 lukem .if ${MKGCC} != "no"
509 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
510 1.285 mrg ${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
511 1.249 lukem .endif
512 1.285 mrg ${MAKEDIRTARGET} . do-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
513 1.249 lukem .endif
514 1.256 gmcgarry .endif
515 1.256 gmcgarry
516 1.262 mrg do-compat-libgcc: .PHONY .MAKE
517 1.262 mrg .if defined(HAVE_GCC)
518 1.262 mrg .if ${MKGCC} != "no"
519 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
520 1.285 mrg ${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-crtstuff${LIBGCC_EXT}
521 1.280 skrll .endif
522 1.285 mrg ${MAKEDIRTARGET} . do-compat-${BUILD_CC_LIB_BASETARGET}-libgcc${LIBGCC_EXT}
523 1.262 mrg .endif
524 1.262 mrg .endif
525 1.262 mrg
526 1.256 gmcgarry do-libpcc: .PHONY .MAKE
527 1.256 gmcgarry .if defined(HAVE_PCC)
528 1.256 gmcgarry .if ${MKPCC} != "no"
529 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
530 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
531 1.280 skrll .endif
532 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-libpcc
533 1.256 gmcgarry .endif
534 1.256 gmcgarry .endif
535 1.249 lukem
536 1.242 dsl do-ld.so: .PHONY .MAKE
537 1.184 lukem .for targ in dependall install
538 1.232 lukem ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
539 1.137 tv .endfor
540 1.143 tv
541 1.242 dsl do-build: .PHONY .MAKE
542 1.154 tv .for targ in dependall install
543 1.232 lukem ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
544 1.154 tv .endfor
545 1.200 lukem
546 1.242 dsl do-x11: .PHONY .MAKE
547 1.263 mrg .if ${MKX11} != "no"
548 1.263 mrg .if ${X11FLAVOUR} == "Xorg"
549 1.254 mrg ${MAKEDIRTARGET} external/mit/xorg build
550 1.263 mrg .else
551 1.257 lukem ${MAKEDIRTARGET} x11 build
552 1.263 mrg .endif
553 1.254 mrg .else
554 1.263 mrg @echo "MKX11 is not enabled"
555 1.257 lukem @false
556 1.254 mrg .endif
557 1.227 lukem
558 1.275 uebayasi do-extsrc: .PHONY .MAKE
559 1.275 uebayasi .if ${MKEXTSRC} != "no"
560 1.275 uebayasi ${MAKEDIRTARGET} extsrc build
561 1.275 uebayasi .else
562 1.275 uebayasi @echo "MKEXTSRC is not enabled"
563 1.275 uebayasi @false
564 1.275 uebayasi .endif
565 1.275 uebayasi
566 1.242 dsl do-obsolete: .PHONY .MAKE
567 1.232 lukem ${MAKEDIRTARGET} etc install-obsolete-lists
568 1.87 cjs
569 1.193 lukem #
570 1.137 tv # Speedup stubs for some subtrees that don't need to run these rules.
571 1.137 tv # (Tells <bsd.subdir.mk> not to recurse for them.)
572 1.193 lukem #
573 1.129 tv
574 1.292 veego .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
575 1.228 lukem includes-${dir}: .PHONY
576 1.152 tv @true
577 1.152 tv .endfor
578 1.152 tv .for dir in etc distrib regress
579 1.228 lukem install-${dir}: .PHONY
580 1.152 tv @true
581 1.152 tv .endfor
582 1.152 tv
583 1.193 lukem #
584 1.152 tv # XXX this needs to change when distrib Makefiles are recursion compliant
585 1.193 lukem # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
586 1.193 lukem #
587 1.228 lukem dependall-distrib depend-distrib all-distrib: .PHONY
588 1.136 nathanw @true
589 1.130 tv
590 1.211 lukem .include <bsd.sys.mk>
591 1.151 tv .include <bsd.obj.mk>
592 1.209 lukem .include <bsd.kernobj.mk>
593 1.146 tv .include <bsd.subdir.mk>
594 1.144 tv
595 1.209 lukem #
596 1.209 lukem # Display current make(1) parameters
597 1.209 lukem #
598 1.242 dsl params: .PHONY .MAKE
599 1.232 lukem ${MAKEDIRTARGET} etc params
600