Makefile revision 1.332 1 1.332 christos # $NetBSD: Makefile,v 1.332 2020/05/15 16:34:44 christos 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.319 christos # NOBINARIES will not build binaries, only includes and libraries
34 1.95 cjs #
35 1.214 lukem # See mk.conf(5) for more details.
36 1.214 lukem #
37 1.214 lukem #
38 1.95 cjs # Targets:
39 1.137 tv # build:
40 1.196 lukem # Builds a full release of NetBSD in DESTDIR, except for the
41 1.196 lukem # /etc configuration files.
42 1.196 lukem # If BUILD_DONE is set, this is an empty target.
43 1.196 lukem # distribution:
44 1.196 lukem # Builds a full release of NetBSD in DESTDIR, including the /etc
45 1.196 lukem # configuration files.
46 1.196 lukem # buildworld:
47 1.196 lukem # As per `make distribution', except that it ensures that DESTDIR
48 1.196 lukem # is not the root directory.
49 1.196 lukem # installworld:
50 1.196 lukem # Install the distribution from DESTDIR to INSTALLWORLDDIR (which
51 1.196 lukem # defaults to the root directory). Ensures that INSTALLWORLDDIR
52 1.291 abs # is not the root directory if cross compiling.
53 1.137 tv # release:
54 1.240 lukem # Does a `make distribution', and then tars up the DESTDIR files
55 1.252 lukem # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
56 1.196 lukem # (See etc/Makefile for more information on this.)
57 1.137 tv # regression-tests:
58 1.137 tv # Runs the regression tests in "regress" on this host.
59 1.206 lukem # sets:
60 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
61 1.252 lukem # from ${DESTDIR}
62 1.206 lukem # sourcesets:
63 1.206 lukem # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
64 1.241 apb # syspkgs:
65 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
66 1.252 lukem # from ${DESTDIR}
67 1.243 apb # iso-image:
68 1.311 snj # Create CD-ROM image in RELEASEDIR/images.
69 1.243 apb # RELEASEDIR must already have been populated by `make release'
70 1.243 apb # or equivalent.
71 1.248 jnemeth # iso-image-source:
72 1.311 snj # Create CD-ROM image with source in RELEASEDIR/images.
73 1.248 jnemeth # RELEASEDIR must already have been populated by
74 1.248 jnemeth # `make release sourcesets' or equivalent.
75 1.290 tsutsui # live-image:
76 1.290 tsutsui # Create bootable live image for emulators or USB stick etc.
77 1.290 tsutsui # in RELEASEDIR/liveimage.
78 1.290 tsutsui # RELEASEDIR must already have been populated by `make release'
79 1.290 tsutsui # or equivalent.
80 1.290 tsutsui # install-image:
81 1.290 tsutsui # Create bootable installation image for USB stick etc.
82 1.290 tsutsui # in RELEASEDIR/installimage.
83 1.290 tsutsui # RELEASEDIR must already have been populated by `make release'
84 1.290 tsutsui # or equivalent.
85 1.123 mrg #
86 1.137 tv # Targets invoked by `make build,' in order:
87 1.155 tv # cleandir: cleans the tree.
88 1.261 apb # do-top-obj: creates the top level object directory.
89 1.260 apb # do-tools-obj: creates object directories for the host toolchain.
90 1.260 apb # do-tools: builds host toolchain.
91 1.300 apb # params: record the values of variables that might affect the
92 1.300 apb # build.
93 1.137 tv # obj: creates object directories.
94 1.208 lukem # do-distrib-dirs: creates the distribution directories.
95 1.208 lukem # includes: installs include files.
96 1.326 martin # do-lib: builds and installs prerequisites from lib.
97 1.299 joerg # do-compat-lib: builds and installs prerequisites from compat/lib
98 1.262 mrg # if ${MKCOMPAT} != "no".
99 1.320 uwe # do-x11: builds and installs X11 tools and libraries
100 1.320 uwe # from src/external/mit/xorg if ${MKX11} != "no".
101 1.137 tv # do-build: builds and installs the entire system.
102 1.275 uebayasi # do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
103 1.222 lukem # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
104 1.193 lukem #
105 1.32 cgd
106 1.146 tv .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
107 1.146 tv .MAKEFLAGS: -m ${.CURDIR}/share/mk
108 1.146 tv .endif
109 1.163 tv
110 1.193 lukem #
111 1.163 tv # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
112 1.163 tv # not be the top level objdir, because "make obj" can happen in the *middle*
113 1.163 tv # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
114 1.163 tv # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
115 1.193 lukem #
116 1.163 tv _SRC_TOP_OBJ_=
117 1.148 jmc
118 1.146 tv .include <bsd.own.mk>
119 1.4 cgd
120 1.193 lukem #
121 1.137 tv # Sanity check: make sure that "make build" is not invoked simultaneously
122 1.137 tv # with a standard recursive target.
123 1.193 lukem #
124 1.137 tv
125 1.137 tv .if make(build) || make(release) || make(snapshot)
126 1.137 tv .for targ in ${TARGETS:Nobj:Ncleandir}
127 1.137 tv .if make(${targ}) && !target(.BEGIN)
128 1.137 tv .BEGIN:
129 1.137 tv @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
130 1.137 tv @false
131 1.137 tv .endif
132 1.137 tv .endfor
133 1.137 tv .endif
134 1.58 tv
135 1.261 apb #
136 1.261 apb # _SUBDIR is used to set SUBDIR, after removing directories that have
137 1.261 apb # BUILD_${dir}=no, or that have no ${dir}/Makefile.
138 1.261 apb #
139 1.329 kamil _SUBDIR= tools .WAIT lib
140 1.329 kamil .if ${MKLLVM} != "no"
141 1.329 kamil _SUBDIR+= external/bsd/compiler_rt
142 1.329 kamil .endif
143 1.329 kamil _SUBDIR+= include external crypto/external bin
144 1.325 maya _SUBDIR+= games libexec sbin usr.bin
145 1.303 joerg _SUBDIR+= usr.sbin share sys etc tests compat
146 1.303 joerg _SUBDIR+= .WAIT rescue .WAIT distrib regress
147 1.105 assar
148 1.137 tv .for dir in ${_SUBDIR}
149 1.261 apb .if "${dir}" == ".WAIT" \
150 1.261 apb || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
151 1.137 tv SUBDIR+= ${dir}
152 1.36 explorer .endif
153 1.137 tv .endfor
154 1.21 cgd
155 1.13 brezak .if exists(regress)
156 1.242 dsl regression-tests: .PHONY .MAKE
157 1.10 cgd @echo Running regression tests...
158 1.232 lukem ${MAKEDIRTARGET} regress regress
159 1.13 brezak .endif
160 1.20 cgd
161 1.214 lukem .if ${MKUNPRIVED} != "no"
162 1.179 thorpej NOPOSTINSTALL= # defined
163 1.179 thorpej .endif
164 1.179 thorpej
165 1.242 dsl afterinstall: .PHONY .MAKE
166 1.137 tv .if ${MKMAN} != "no"
167 1.232 lukem ${MAKEDIRTARGET} share/man makedb
168 1.137 tv .endif
169 1.214 lukem .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
170 1.317 christos ${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta
171 1.176 lukem .endif
172 1.179 thorpej .if !defined(NOPOSTINSTALL)
173 1.232 lukem ${MAKEDIRTARGET} . postinstall-check
174 1.159 perry .endif
175 1.170 lukem
176 1.327 martin _POSTINSTALL= ${:!cd ${.CURDIR}/usr.sbin/postinstall && \
177 1.327 martin ${MAKE} print-objdir!}/postinstall \
178 1.308 apb -m ${MACHINE} -a ${MACHINE_ARCH}
179 1.295 apb _POSTINSTALL_ENV= \
180 1.295 apb AWK=${TOOL_AWK:Q} \
181 1.295 apb DB=${TOOL_DB:Q} \
182 1.298 apb HOST_SH=${HOST_SH:Q} \
183 1.295 apb MAKE=${MAKE:Q} \
184 1.297 apb PWD_MKDB=${TOOL_PWD_MKDB:Q} \
185 1.307 apb SED=${TOOL_SED:Q} \
186 1.297 apb STAT=${TOOL_STAT:Q}
187 1.239 lukem
188 1.313 martin .if ${MKX11} != "no"
189 1.313 martin _POSTINSTALL_X11=-x ${X11SRCDIR:Q}
190 1.313 martin .endif
191 1.313 martin
192 1.228 lukem postinstall-check: .PHONY
193 1.169 lukem @echo " === Post installation checks ==="
194 1.313 martin ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
195 1.171 lukem @echo " ================================"
196 1.171 lukem
197 1.228 lukem postinstall-fix: .NOTMAIN .PHONY
198 1.171 lukem @echo " === Post installation fixes ==="
199 1.313 martin ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix
200 1.212 lukem @echo " ==============================="
201 1.212 lukem
202 1.228 lukem postinstall-fix-obsolete: .NOTMAIN .PHONY
203 1.212 lukem @echo " === Removing obsolete files ==="
204 1.313 martin ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete
205 1.212 lukem @echo " ==============================="
206 1.169 lukem
207 1.309 apb postinstall-fix-obsolete_stand: .NOTMAIN .PHONY
208 1.309 apb @echo " === Removing obsolete files ==="
209 1.313 martin ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand
210 1.332 christos ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand_debug
211 1.309 apb @echo " ==============================="
212 1.309 apb
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.156 tv BUILDTARGETS+= check-tools
218 1.214 lukem .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
219 1.155 tv BUILDTARGETS+= cleandir
220 1.155 tv .endif
221 1.261 apb .if ${MKOBJDIRS} != "no"
222 1.261 apb BUILDTARGETS+= do-top-obj
223 1.261 apb .endif
224 1.261 apb .if ${USETOOLS} == "yes" # {
225 1.149 tv .if ${MKOBJDIRS} != "no"
226 1.260 apb BUILDTARGETS+= do-tools-obj
227 1.123 mrg .endif
228 1.152 tv BUILDTARGETS+= do-tools
229 1.261 apb .endif # USETOOLS # }
230 1.300 apb BUILDTARGETS+= params
231 1.260 apb .if ${MKOBJDIRS} != "no"
232 1.260 apb BUILDTARGETS+= obj
233 1.260 apb .endif
234 1.270 apb BUILDTARGETS+= clean_METALOG
235 1.137 tv .if !defined(NODISTRIBDIRS)
236 1.137 tv BUILDTARGETS+= do-distrib-dirs
237 1.131 tv .endif
238 1.137 tv .if !defined(NOINCLUDES)
239 1.137 tv BUILDTARGETS+= includes
240 1.131 tv .endif
241 1.281 plunky BUILDTARGETS+= do-lib
242 1.299 joerg BUILDTARGETS+= do-compat-lib
243 1.328 kamil .if ${MKLLVM} != "no"
244 1.329 kamil BUILDTARGETS+= do-sanitizer
245 1.328 kamil .if ${MKSANITIZER:Uno} == "yes"
246 1.328 kamil BUILDTARGETS+= do-sanitizer-tools
247 1.328 kamil .endif
248 1.328 kamil .endif
249 1.263 mrg .if ${MKX11} != "no"
250 1.227 lukem BUILDTARGETS+= do-x11
251 1.227 lukem .endif
252 1.321 uwe .if !defined(NOBINARIES)
253 1.312 joerg BUILDTARGETS+= do-build
254 1.275 uebayasi .if ${MKEXTSRC} != "no"
255 1.275 uebayasi BUILDTARGETS+= do-extsrc
256 1.275 uebayasi .endif
257 1.200 lukem BUILDTARGETS+= do-obsolete
258 1.319 christos .endif
259 1.131 tv
260 1.193 lukem #
261 1.137 tv # Enforce proper ordering of some rules.
262 1.193 lukem #
263 1.123 mrg
264 1.137 tv .ORDER: ${BUILDTARGETS}
265 1.228 lukem includes-lib: .PHONY includes-include includes-sys
266 1.123 mrg
267 1.193 lukem #
268 1.300 apb # Record the values of variables that might affect the build.
269 1.300 apb # If no values have changed, avoid updating the timestamp
270 1.300 apb # of the params file.
271 1.300 apb #
272 1.300 apb # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
273 1.300 apb #
274 1.302 apb .include "${NETBSDSRCDIR}/etc/Makefile.params"
275 1.300 apb CLEANDIRFILES+= params
276 1.300 apb params: .EXEC
277 1.300 apb ${_MKMSG_CREATE} params
278 1.302 apb @${PRINT_PARAMS} >${.TARGET}.new
279 1.300 apb @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
280 1.300 apb : "params is unchanged" ; \
281 1.300 apb rm ${.TARGET}.new ; \
282 1.300 apb else \
283 1.300 apb : "params has changed or is new" ; \
284 1.300 apb mv ${.TARGET}.new ${.TARGET} ; \
285 1.300 apb fi
286 1.300 apb
287 1.300 apb #
288 1.302 apb # Display current make(1) parameters
289 1.302 apb #
290 1.302 apb show-params: .PHONY .MAKE
291 1.302 apb @${PRINT_PARAMS}
292 1.302 apb
293 1.302 apb #
294 1.137 tv # Build the system and install into DESTDIR.
295 1.193 lukem #
296 1.123 mrg
297 1.191 lukem START_TIME!= date
298 1.191 lukem
299 1.242 dsl build: .PHONY .MAKE
300 1.137 tv .if defined(BUILD_DONE)
301 1.137 tv @echo "Build already installed into ${DESTDIR}"
302 1.137 tv .else
303 1.191 lukem @echo "Build started at: ${START_TIME}"
304 1.145 tv .for tgt in ${BUILDTARGETS}
305 1.232 lukem ${MAKEDIRTARGET} . ${tgt}
306 1.145 tv .endfor
307 1.232 lukem ${MAKEDIRTARGET} etc install-etc-release
308 1.191 lukem @echo "Build started at: ${START_TIME}"
309 1.172 bjh21 @printf "Build finished at: " && date
310 1.71 mycroft .endif
311 1.160 thorpej
312 1.193 lukem #
313 1.160 thorpej # Build a full distribution, but not a release (i.e. no sets into
314 1.193 lukem # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
315 1.193 lukem #
316 1.160 thorpej
317 1.242 dsl distribution buildworld: .PHONY .MAKE
318 1.194 lukem .if make(buildworld) && \
319 1.194 lukem (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
320 1.193 lukem @echo "Won't make ${.TARGET} with DESTDIR=/"
321 1.193 lukem @false
322 1.193 lukem .endif
323 1.232 lukem ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
324 1.232 lukem ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
325 1.181 thorpej .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
326 1.232 lukem ${MAKEDIRTARGET} . postinstall-fix-obsolete
327 1.309 apb ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand
328 1.232 lukem ${MAKEDIRTARGET} distrib/sets checkflist
329 1.181 thorpej .endif
330 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
331 1.185 lukem @printf "make ${.TARGET} finished at: " && date
332 1.123 mrg
333 1.193 lukem #
334 1.193 lukem # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
335 1.193 lukem # If installing to /, ensures that the host's operating system is NetBSD and
336 1.193 lukem # the host's `uname -m` == ${MACHINE}.
337 1.193 lukem #
338 1.193 lukem
339 1.193 lukem HOST_UNAME_S!= uname -s
340 1.193 lukem HOST_UNAME_M!= uname -m
341 1.193 lukem
342 1.242 dsl installworld: .PHONY .MAKE
343 1.194 lukem .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
344 1.193 lukem @echo "Can't make ${.TARGET} to DESTDIR=/"
345 1.193 lukem @false
346 1.193 lukem .endif
347 1.193 lukem .if !defined(INSTALLWORLDDIR) || \
348 1.193 lukem ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
349 1.193 lukem .if (${HOST_UNAME_S} != "NetBSD")
350 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
351 1.193 lukem @false
352 1.193 lukem .endif
353 1.193 lukem .if (${HOST_UNAME_M} != ${MACHINE})
354 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
355 1.193 lukem @false
356 1.193 lukem .endif
357 1.193 lukem .endif
358 1.232 lukem ${MAKEDIRTARGET} distrib/sets installsets \
359 1.282 jym INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
360 1.232 lukem ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
361 1.193 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
362 1.193 lukem @printf "make ${.TARGET} finished at: " && date
363 1.199 lukem
364 1.199 lukem #
365 1.287 jmcneill # Install modules from $DESTDIR to $INSTALLMODULESDIR
366 1.287 jmcneill #
367 1.287 jmcneill installmodules: .PHONY .MAKE
368 1.287 jmcneill .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
369 1.287 jmcneill @echo "Can't make ${.TARGET} to DESTDIR=/"
370 1.287 jmcneill @false
371 1.287 jmcneill .endif
372 1.287 jmcneill .if !defined(INSTALLMODULESDIR) || \
373 1.287 jmcneill ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
374 1.287 jmcneill .if (${HOST_UNAME_S} != "NetBSD")
375 1.287 jmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
376 1.287 jmcneill @false
377 1.287 jmcneill .endif
378 1.287 jmcneill .if (${HOST_UNAME_M} != ${MACHINE})
379 1.287 jmcneill @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
380 1.287 jmcneill @false
381 1.287 jmcneill .endif
382 1.287 jmcneill .endif
383 1.288 jmcneill ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
384 1.287 jmcneill @echo "make ${.TARGET} started at: ${START_TIME}"
385 1.287 jmcneill @printf "make ${.TARGET} finished at: " && date
386 1.287 jmcneill
387 1.287 jmcneill #
388 1.206 lukem # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
389 1.199 lukem #
390 1.199 lukem
391 1.241 apb .for tgt in sets sourcesets syspkgs
392 1.242 dsl ${tgt}: .PHONY .MAKE
393 1.232 lukem ${MAKEDIRTARGET} distrib/sets ${tgt}
394 1.206 lukem .endfor
395 1.193 lukem
396 1.193 lukem #
397 1.240 lukem # Build a release or snapshot (implies "make distribution"). Note that
398 1.181 thorpej # in this case, the set lists will be checked before the tar files
399 1.181 thorpej # are made.
400 1.193 lukem #
401 1.123 mrg
402 1.242 dsl release snapshot: .PHONY .MAKE
403 1.240 lukem ${MAKEDIRTARGET} . distribution
404 1.240 lukem ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
405 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
406 1.185 lukem @printf "make ${.TARGET} finished at: " && date
407 1.123 mrg
408 1.193 lukem #
409 1.243 apb # Create a CD-ROM image.
410 1.243 apb #
411 1.243 apb
412 1.243 apb iso-image: .PHONY
413 1.247 bouyer ${MAKEDIRTARGET} distrib iso_image
414 1.243 apb ${MAKEDIRTARGET} etc iso-image
415 1.243 apb @echo "make ${.TARGET} started at: ${START_TIME}"
416 1.243 apb @printf "make ${.TARGET} finished at: " && date
417 1.243 apb
418 1.248 jnemeth iso-image-source: .PHONY
419 1.248 jnemeth ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
420 1.248 jnemeth ${MAKEDIRTARGET} etc iso-image
421 1.248 jnemeth @echo "make ${.TARGET} started at: ${START_TIME}"
422 1.248 jnemeth @printf "make ${.TARGET} finished at: " && date
423 1.248 jnemeth
424 1.243 apb #
425 1.290 tsutsui # Create bootable live images.
426 1.290 tsutsui #
427 1.290 tsutsui
428 1.290 tsutsui live-image: .PHONY
429 1.290 tsutsui ${MAKEDIRTARGET} etc live-image
430 1.290 tsutsui @echo "make ${.TARGET} started at: ${START_TIME}"
431 1.290 tsutsui @printf "make ${.TARGET} finished at: " && date
432 1.290 tsutsui
433 1.290 tsutsui #
434 1.290 tsutsui # Create bootable installation images.
435 1.290 tsutsui #
436 1.290 tsutsui
437 1.290 tsutsui install-image: .PHONY
438 1.290 tsutsui ${MAKEDIRTARGET} etc install-image
439 1.290 tsutsui @echo "make ${.TARGET} started at: ${START_TIME}"
440 1.290 tsutsui @printf "make ${.TARGET} finished at: " && date
441 1.290 tsutsui
442 1.290 tsutsui #
443 1.137 tv # Special components of the "make build" process.
444 1.193 lukem #
445 1.156 tv
446 1.228 lukem check-tools: .PHONY
447 1.223 lukem .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
448 1.187 thorpej @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
449 1.187 thorpej @echo '*** May result in a failed build or corrupt binaries!'
450 1.187 thorpej .elif defined(EXTERNAL_TOOLCHAIN)
451 1.187 thorpej @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
452 1.156 tv .endif
453 1.173 sommerfe .if defined(NBUILDJOBS)
454 1.173 sommerfe @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
455 1.173 sommerfe .endif
456 1.123 mrg
457 1.270 apb # Delete or sanitise a leftover METALOG from a previous build.
458 1.270 apb clean_METALOG: .PHONY .MAKE
459 1.270 apb .if ${MKUPDATE} != "no"
460 1.270 apb ${MAKEDIRTARGET} distrib/sets clean_METALOG
461 1.270 apb .endif
462 1.270 apb
463 1.242 dsl do-distrib-dirs: .PHONY .MAKE
464 1.147 jmc .if !defined(DESTDIR) || ${DESTDIR} == ""
465 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
466 1.147 jmc .else
467 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
468 1.147 jmc .endif
469 1.190 lukem
470 1.190 lukem .for targ in cleandir obj includes
471 1.228 lukem do-${targ}: .PHONY ${targ}
472 1.190 lukem @true
473 1.190 lukem .endfor
474 1.123 mrg
475 1.301 joerg do-tools: .PHONY .MAKE
476 1.301 joerg ${MAKEDIRTARGET} tools build_install
477 1.184 lukem
478 1.299 joerg do-lib: .PHONY .MAKE
479 1.299 joerg ${MAKEDIRTARGET} lib build_install
480 1.299 joerg
481 1.299 joerg do-compat-lib: .PHONY .MAKE
482 1.299 joerg ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
483 1.276 mrg
484 1.329 kamil do-sanitizer: .PHONY .MAKE
485 1.331 kamil ${MAKEDIRTARGET} external/bsd/compiler_rt build_install
486 1.328 kamil
487 1.328 kamil do-sanitizer-tools: .PHONY .MAKE
488 1.329 kamil .if !exists(${TOOLDIR}/lib/clang) && ${HAVE_LLVM:Uno} == "yes"
489 1.328 kamil mkdir -p ${TOOLDIR}/lib/clang
490 1.328 kamil cd ${DESTDIR}/usr/lib/clang && \
491 1.328 kamil ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang
492 1.328 kamil .endif
493 1.328 kamil
494 1.261 apb do-top-obj: .PHONY .MAKE
495 1.261 apb ${MAKEDIRTARGET} . obj NOSUBDIR=
496 1.261 apb
497 1.260 apb do-tools-obj: .PHONY .MAKE
498 1.260 apb ${MAKEDIRTARGET} tools obj
499 1.260 apb
500 1.242 dsl do-build: .PHONY .MAKE
501 1.154 tv .for targ in dependall install
502 1.232 lukem ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
503 1.154 tv .endfor
504 1.200 lukem
505 1.242 dsl do-x11: .PHONY .MAKE
506 1.263 mrg .if ${MKX11} != "no"
507 1.312 joerg ${MAKEDIRTARGET} external/mit/xorg/tools all
508 1.312 joerg ${MAKEDIRTARGET} external/mit/xorg/lib build_install
509 1.315 matt .if ${MKCOMPATX11} != "no"
510 1.314 matt ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib"
511 1.314 matt .endif
512 1.263 mrg .else
513 1.263 mrg @echo "MKX11 is not enabled"
514 1.257 lukem @false
515 1.254 mrg .endif
516 1.227 lukem
517 1.275 uebayasi do-extsrc: .PHONY .MAKE
518 1.275 uebayasi .if ${MKEXTSRC} != "no"
519 1.275 uebayasi ${MAKEDIRTARGET} extsrc build
520 1.275 uebayasi .else
521 1.275 uebayasi @echo "MKEXTSRC is not enabled"
522 1.275 uebayasi @false
523 1.275 uebayasi .endif
524 1.275 uebayasi
525 1.242 dsl do-obsolete: .PHONY .MAKE
526 1.232 lukem ${MAKEDIRTARGET} etc install-obsolete-lists
527 1.87 cjs
528 1.193 lukem #
529 1.137 tv # Speedup stubs for some subtrees that don't need to run these rules.
530 1.137 tv # (Tells <bsd.subdir.mk> not to recurse for them.)
531 1.193 lukem #
532 1.129 tv
533 1.292 veego .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
534 1.228 lukem includes-${dir}: .PHONY
535 1.152 tv @true
536 1.152 tv .endfor
537 1.152 tv .for dir in etc distrib regress
538 1.228 lukem install-${dir}: .PHONY
539 1.152 tv @true
540 1.152 tv .endfor
541 1.152 tv
542 1.193 lukem #
543 1.152 tv # XXX this needs to change when distrib Makefiles are recursion compliant
544 1.193 lukem # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
545 1.193 lukem #
546 1.228 lukem dependall-distrib depend-distrib all-distrib: .PHONY
547 1.136 nathanw @true
548 1.130 tv
549 1.151 tv .include <bsd.obj.mk>
550 1.209 lukem .include <bsd.kernobj.mk>
551 1.146 tv .include <bsd.subdir.mk>
552 1.322 mrg .include <bsd.clean.mk>
553