Deleted Added
full compact
Makefile (205290) Makefile (209128)
1#
1#
2# $FreeBSD: head/Makefile 205290 2010-03-18 18:58:17Z dougb $
2# $FreeBSD: head/Makefile 209128 2010-06-13 13:02:43Z raj $
3#
4# The user-driven targets are:
5#
6# universe - *Really* build *everything* (buildworld and
7# all kernels on all architectures).
8# buildworld - Rebuild *everything*, including glue to help do
9# upgrades.
10# installworld - Install everything built by "buildworld".
11# world - buildworld + installworld, no kernel.
12# buildkernel - Rebuild the kernel and the kernel-modules.
13# installkernel - Install the kernel and the kernel-modules.
14# installkernel.debug
15# reinstallkernel - Reinstall the kernel and the kernel-modules.
16# reinstallkernel.debug
17# kernel - buildkernel + installkernel.
18# kernel-toolchain - Builds the subset of world necessary to build a kernel
19# doxygen - Build API documentation of the kernel, needs doxygen.
20# update - Convenient way to update your source tree (cvs).
21# check-old - List obsolete directories/files/libraries.
22# check-old-dirs - List obsolete directories.
23# check-old-files - List obsolete files.
24# check-old-libs - List obsolete libraries.
25# delete-old - Delete obsolete directories/files/libraries.
26# delete-old-dirs - Delete obsolete directories.
27# delete-old-files - Delete obsolete files.
28# delete-old-libs - Delete obsolete libraries.
29#
30# This makefile is simple by design. The FreeBSD make automatically reads
31# the /usr/share/mk/sys.mk unless the -m argument is specified on the
32# command line. By keeping this makefile simple, it doesn't matter too
33# much how different the installed mk files are from those in the source
34# tree. This makefile executes a child make process, forcing it to use
35# the mk files from the source tree which are supposed to DTRT.
36#
37# The user-driven targets (as listed above) are implemented in Makefile.inc1.
38#
39# If you want to build your system from source be sure that /usr/obj has
40# at least 800MB of diskspace available.
41#
42# For individuals wanting to build from the sources currently on their
43# system, the simple instructions are:
44#
45# 1. `cd /usr/src' (or to the directory containing your source tree).
46# 2. Define `HISTORICAL_MAKE_WORLD' variable (see README).
47# 3. `make world'
48#
49# For individuals wanting to upgrade their sources (even if only a
50# delta of a few days):
51#
52# 1. `cd /usr/src' (or to the directory containing your source tree).
53# 2. `make buildworld'
54# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
55# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
56# [steps 3. & 4. can be combined by using the "kernel" target]
57# 5. `reboot' (in single user mode: boot -s from the loader prompt).
58# 6. `mergemaster -p'
59# 7. `make installworld'
60# 8. `make delete-old'
61# 9. `mergemaster' (you may wish to use -U or -ai).
62# 10. `reboot'
63# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
64#
65# See src/UPDATING `COMMON ITEMS' for more complete information.
66#
67# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can
68# cross build world for other machine types using the buildworld target,
69# and once the world is built you can cross build a kernel using the
70# buildkernel target.
71#
72# Define the user-driven targets. These are listed here in alphabetical
73# order, but that's not important.
74#
75# Targets that begin with underscore are internal targets intended for
76# developer convenience only. They are intentionally not documented and
77# completely subject to change without notice.
78#
79# For more information, see the build(7) manual page.
80#
81TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
82 check-old check-old-dirs check-old-files check-old-libs \
83 checkdpadd clean cleandepend cleandir \
84 delete-old delete-old-dirs delete-old-files delete-old-libs \
85 depend distribute distributeworld distrib-dirs distribution doxygen \
86 everything hierarchy install installcheck installkernel \
87 installkernel.debug reinstallkernel reinstallkernel.debug \
88 installworld kernel-toolchain libraries lint maninstall \
89 obj objlink regress rerelease showconfig tags toolchain update \
90 _worldtmp _legacy _bootstrap-tools _cleanobj _obj \
91 _build-tools _cross-tools _includes _libraries _depend \
3#
4# The user-driven targets are:
5#
6# universe - *Really* build *everything* (buildworld and
7# all kernels on all architectures).
8# buildworld - Rebuild *everything*, including glue to help do
9# upgrades.
10# installworld - Install everything built by "buildworld".
11# world - buildworld + installworld, no kernel.
12# buildkernel - Rebuild the kernel and the kernel-modules.
13# installkernel - Install the kernel and the kernel-modules.
14# installkernel.debug
15# reinstallkernel - Reinstall the kernel and the kernel-modules.
16# reinstallkernel.debug
17# kernel - buildkernel + installkernel.
18# kernel-toolchain - Builds the subset of world necessary to build a kernel
19# doxygen - Build API documentation of the kernel, needs doxygen.
20# update - Convenient way to update your source tree (cvs).
21# check-old - List obsolete directories/files/libraries.
22# check-old-dirs - List obsolete directories.
23# check-old-files - List obsolete files.
24# check-old-libs - List obsolete libraries.
25# delete-old - Delete obsolete directories/files/libraries.
26# delete-old-dirs - Delete obsolete directories.
27# delete-old-files - Delete obsolete files.
28# delete-old-libs - Delete obsolete libraries.
29#
30# This makefile is simple by design. The FreeBSD make automatically reads
31# the /usr/share/mk/sys.mk unless the -m argument is specified on the
32# command line. By keeping this makefile simple, it doesn't matter too
33# much how different the installed mk files are from those in the source
34# tree. This makefile executes a child make process, forcing it to use
35# the mk files from the source tree which are supposed to DTRT.
36#
37# The user-driven targets (as listed above) are implemented in Makefile.inc1.
38#
39# If you want to build your system from source be sure that /usr/obj has
40# at least 800MB of diskspace available.
41#
42# For individuals wanting to build from the sources currently on their
43# system, the simple instructions are:
44#
45# 1. `cd /usr/src' (or to the directory containing your source tree).
46# 2. Define `HISTORICAL_MAKE_WORLD' variable (see README).
47# 3. `make world'
48#
49# For individuals wanting to upgrade their sources (even if only a
50# delta of a few days):
51#
52# 1. `cd /usr/src' (or to the directory containing your source tree).
53# 2. `make buildworld'
54# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
55# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
56# [steps 3. & 4. can be combined by using the "kernel" target]
57# 5. `reboot' (in single user mode: boot -s from the loader prompt).
58# 6. `mergemaster -p'
59# 7. `make installworld'
60# 8. `make delete-old'
61# 9. `mergemaster' (you may wish to use -U or -ai).
62# 10. `reboot'
63# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
64#
65# See src/UPDATING `COMMON ITEMS' for more complete information.
66#
67# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can
68# cross build world for other machine types using the buildworld target,
69# and once the world is built you can cross build a kernel using the
70# buildkernel target.
71#
72# Define the user-driven targets. These are listed here in alphabetical
73# order, but that's not important.
74#
75# Targets that begin with underscore are internal targets intended for
76# developer convenience only. They are intentionally not documented and
77# completely subject to change without notice.
78#
79# For more information, see the build(7) manual page.
80#
81TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
82 check-old check-old-dirs check-old-files check-old-libs \
83 checkdpadd clean cleandepend cleandir \
84 delete-old delete-old-dirs delete-old-files delete-old-libs \
85 depend distribute distributeworld distrib-dirs distribution doxygen \
86 everything hierarchy install installcheck installkernel \
87 installkernel.debug reinstallkernel reinstallkernel.debug \
88 installworld kernel-toolchain libraries lint maninstall \
89 obj objlink regress rerelease showconfig tags toolchain update \
90 _worldtmp _legacy _bootstrap-tools _cleanobj _obj \
91 _build-tools _cross-tools _includes _libraries _depend \
92 build32 distribute32 install32 xdev xdev-build xdev-install
92 build32 builddtb distribute32 install32 xdev xdev-build xdev-install \
93
93TGTS+= ${SUBDIR_TARGETS}
94
95BITGTS= files includes
96BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
97TGTS+= ${BITGTS}
98
99.ORDER: buildworld installworld
100.ORDER: buildworld distributeworld
101.ORDER: buildworld buildkernel
102.ORDER: buildkernel installkernel
103.ORDER: buildkernel installkernel.debug
104.ORDER: buildkernel reinstallkernel
105.ORDER: buildkernel reinstallkernel.debug
106
107PATH= /sbin:/bin:/usr/sbin:/usr/bin
108MAKEOBJDIRPREFIX?= /usr/obj
109_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
110 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
111 -f /dev/null -V MAKEOBJDIRPREFIX dummy
112.if !empty(_MAKEOBJDIRPREFIX)
113.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
114 (in make.conf(5)) or command-line variable.
115.endif
116MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
117BINMAKE= \
118 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
119 -m ${.CURDIR}/share/mk
120_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1
121
122#
123# Make sure we have an up-to-date make(1). Only world and buildworld
124# should do this as those are the initial targets used for upgrades.
125# The user can define ALWAYS_CHECK_MAKE to have this check performed
126# for all targets.
127#
128.if defined(ALWAYS_CHECK_MAKE)
129${TGTS}: upgrade_checks
130.else
131buildworld: upgrade_checks
132.endif
133
134#
135# This 'cleanworld' target is not included in TGTS, because it is not a
136# recursive target. All of the work for it is done right here. It is
137# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
138# created by bsd.obj.mk, except that we don't want to .include that file
139# in this makefile.
140#
141# In the following, the first 'rm' in a series will usually remove all
142# files and directories. If it does not, then there are probably some
143# files with chflags set, so this unsets them and tries the 'rm' a
144# second time. There are situations where this target will be cleaning
145# some directories via more than one method, but that duplication is
146# needed to correctly handle all the possible situations.
147#
148BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
149cleanworld:
150.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
151.if exists(${BW_CANONICALOBJDIR}/)
152 -rm -rf ${BW_CANONICALOBJDIR}/*
153 -chflags -R 0 ${BW_CANONICALOBJDIR}
154 rm -rf ${BW_CANONICALOBJDIR}/*
155.endif
156 # To be safe in this case, fall back to a 'make cleandir'
157 ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
158.else
159 -rm -rf ${.OBJDIR}/*
160 -chflags -R 0 ${.OBJDIR}
161 rm -rf ${.OBJDIR}/*
162.endif
163
164#
165# Handle the user-driven targets, using the source relative mk files.
166#
167
168${TGTS}:
169 ${_+_}@cd ${.CURDIR}; \
170 ${_MAKE} ${.TARGET}
171
172# Set a reasonable default
173.MAIN: all
174
175STARTTIME!= LC_ALL=C date
176CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0
177.if !empty(CHECK_TIME)
178.error check your date/time: ${STARTTIME}
179.endif
180
181.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
182#
183# world
184#
185# Attempt to rebuild and reinstall everything. This target is not to be
186# used for upgrading an existing FreeBSD system, because the kernel is
187# not included. One can argue that this target doesn't build everything
188# then.
189#
190world: upgrade_checks
191 @echo "--------------------------------------------------------------"
192 @echo ">>> make world started on ${STARTTIME}"
193 @echo "--------------------------------------------------------------"
194.if target(pre-world)
195 @echo
196 @echo "--------------------------------------------------------------"
197 @echo ">>> Making 'pre-world' target"
198 @echo "--------------------------------------------------------------"
199 ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world
200.endif
201 ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld
202 ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld
203.if target(post-world)
204 @echo
205 @echo "--------------------------------------------------------------"
206 @echo ">>> Making 'post-world' target"
207 @echo "--------------------------------------------------------------"
208 ${_+_}@cd ${.CURDIR}; ${_MAKE} post-world
209.endif
210 @echo
211 @echo "--------------------------------------------------------------"
212 @echo ">>> make world completed on `LC_ALL=C date`"
213 @echo " (started ${STARTTIME})"
214 @echo "--------------------------------------------------------------"
215.else
216world:
217 @echo "WARNING: make world will overwrite your existing FreeBSD"
218 @echo "installation without also building and installing a new"
219 @echo "kernel. This can be dangerous. Please read the handbook,"
220 @echo "'Rebuilding world', for how to upgrade your system."
221 @echo "Define DESTDIR to where you want to install FreeBSD,"
222 @echo "including /, to override this warning and proceed as usual."
223 @echo ""
224 @echo "Bailing out now..."
225 @false
226.endif
227
228#
229# kernel
230#
231# Short hand for `make buildkernel installkernel'
232#
233kernel: buildkernel installkernel
234
235#
236# Perform a few tests to determine if the installed tools are adequate
237# for building the world.
238#
239upgrade_checks:
240 @if ! (cd ${.CURDIR}/tools/build/make_check && \
241 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \
242 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
243 then \
244 (cd ${.CURDIR} && ${MAKE} make); \
245 fi
246
247#
248# Upgrade make(1) to the current version using the installed
249# headers, libraries and tools. Also, allow the location of
250# the system bsdmake-like utility to be overridden.
251#
252MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \
253 DESTDIR= \
254 INSTALL="sh ${.CURDIR}/tools/install.sh"
255MMAKE= ${MMAKEENV} ${MAKE} \
256 -D_UPGRADING \
257 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \
258 -DNO_CPU_CFLAGS -DNO_WERROR
259
260make: .PHONY
261 @echo
262 @echo "--------------------------------------------------------------"
263 @echo ">>> Building an up-to-date make(1)"
264 @echo "--------------------------------------------------------------"
265 ${_+_}@cd ${.CURDIR}/usr.bin/make; \
266 ${MMAKE} obj && \
267 ${MMAKE} depend && \
268 ${MMAKE} all && \
269 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
270
271tinderbox:
272 cd ${.CURDIR} && \
273 DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe
274
275#
276# universe
277#
278# Attempt to rebuild *everything* for all supported architectures,
279# with a reasonable chance of success, regardless of how old your
280# existing system is.
281#
282.if make(universe) || make(universe_kernels) || make(tinderbox)
283TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
284
285.if defined(DOING_TINDERBOX)
286FAILFILE=tinderbox.failed
287MAKEFAIL=tee -a ${FAILFILE}
288.else
289MAKEFAIL=cat
290.endif
291
292universe: universe_prologue
293universe_prologue:
294 @echo "--------------------------------------------------------------"
295 @echo ">>> make universe started on ${STARTTIME}"
296 @echo "--------------------------------------------------------------"
297.if defined(DOING_TINDERBOX)
298 rm -f ${FAILFILE}
299.endif
300.for target in ${TARGETS}
301universe: universe_${target}
302.ORDER: universe_prologue universe_${target} universe_epilogue
303universe_${target}:
304.if !defined(MAKE_JUST_KERNELS)
305 @echo ">> ${target} started on `LC_ALL=C date`"
306 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
307 ${MAKE} ${JFLAG} buildworld \
308 TARGET=${target} \
309 > _.${target}.buildworld 2>&1 || \
310 (echo "${target} world failed," \
311 "check _.${target}.buildworld for details" | ${MAKEFAIL}))
312 @echo ">> ${target} buildworld completed on `LC_ALL=C date`"
313.endif
314.if !defined(MAKE_JUST_WORLDS)
315.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
316 @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
317 ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
318 (echo "${target} 'make LINT' failed," \
319 "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
320.endif
321 @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \
322 universe_kernels
323.endif
324 @echo ">> ${target} completed on `LC_ALL=C date`"
325.endfor
326universe_kernels: universe_kernconfs
327.if !defined(TARGET)
328TARGET!= uname -m
329.endif
330KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
331 find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
332 ! -name DEFAULTS ! -name NOTES
333universe_kernconfs:
334.for kernel in ${KERNCONFS}
335 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
336 ${MAKE} ${JFLAG} buildkernel \
337 TARGET=${TARGET} \
338 KERNCONF=${kernel} \
339 > _.${TARGET}.${kernel} 2>&1 || \
340 (echo "${TARGET} ${kernel} kernel failed," \
341 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL}))
342.endfor
343universe: universe_epilogue
344universe_epilogue:
345 @echo "--------------------------------------------------------------"
346 @echo ">>> make universe completed on `LC_ALL=C date`"
347 @echo " (started ${STARTTIME})"
348 @echo "--------------------------------------------------------------"
349.if defined(DOING_TINDERBOX)
350 @if [ -e ${FAILFILE} ] ; then \
351 echo "Tinderbox failed:" ;\
352 cat ${FAILFILE} ;\
353 exit 1 ;\
354 fi
355.endif
356.endif
94TGTS+= ${SUBDIR_TARGETS}
95
96BITGTS= files includes
97BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
98TGTS+= ${BITGTS}
99
100.ORDER: buildworld installworld
101.ORDER: buildworld distributeworld
102.ORDER: buildworld buildkernel
103.ORDER: buildkernel installkernel
104.ORDER: buildkernel installkernel.debug
105.ORDER: buildkernel reinstallkernel
106.ORDER: buildkernel reinstallkernel.debug
107
108PATH= /sbin:/bin:/usr/sbin:/usr/bin
109MAKEOBJDIRPREFIX?= /usr/obj
110_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
111 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
112 -f /dev/null -V MAKEOBJDIRPREFIX dummy
113.if !empty(_MAKEOBJDIRPREFIX)
114.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
115 (in make.conf(5)) or command-line variable.
116.endif
117MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
118BINMAKE= \
119 `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
120 -m ${.CURDIR}/share/mk
121_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1
122
123#
124# Make sure we have an up-to-date make(1). Only world and buildworld
125# should do this as those are the initial targets used for upgrades.
126# The user can define ALWAYS_CHECK_MAKE to have this check performed
127# for all targets.
128#
129.if defined(ALWAYS_CHECK_MAKE)
130${TGTS}: upgrade_checks
131.else
132buildworld: upgrade_checks
133.endif
134
135#
136# This 'cleanworld' target is not included in TGTS, because it is not a
137# recursive target. All of the work for it is done right here. It is
138# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
139# created by bsd.obj.mk, except that we don't want to .include that file
140# in this makefile.
141#
142# In the following, the first 'rm' in a series will usually remove all
143# files and directories. If it does not, then there are probably some
144# files with chflags set, so this unsets them and tries the 'rm' a
145# second time. There are situations where this target will be cleaning
146# some directories via more than one method, but that duplication is
147# needed to correctly handle all the possible situations.
148#
149BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
150cleanworld:
151.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
152.if exists(${BW_CANONICALOBJDIR}/)
153 -rm -rf ${BW_CANONICALOBJDIR}/*
154 -chflags -R 0 ${BW_CANONICALOBJDIR}
155 rm -rf ${BW_CANONICALOBJDIR}/*
156.endif
157 # To be safe in this case, fall back to a 'make cleandir'
158 ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
159.else
160 -rm -rf ${.OBJDIR}/*
161 -chflags -R 0 ${.OBJDIR}
162 rm -rf ${.OBJDIR}/*
163.endif
164
165#
166# Handle the user-driven targets, using the source relative mk files.
167#
168
169${TGTS}:
170 ${_+_}@cd ${.CURDIR}; \
171 ${_MAKE} ${.TARGET}
172
173# Set a reasonable default
174.MAIN: all
175
176STARTTIME!= LC_ALL=C date
177CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0
178.if !empty(CHECK_TIME)
179.error check your date/time: ${STARTTIME}
180.endif
181
182.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
183#
184# world
185#
186# Attempt to rebuild and reinstall everything. This target is not to be
187# used for upgrading an existing FreeBSD system, because the kernel is
188# not included. One can argue that this target doesn't build everything
189# then.
190#
191world: upgrade_checks
192 @echo "--------------------------------------------------------------"
193 @echo ">>> make world started on ${STARTTIME}"
194 @echo "--------------------------------------------------------------"
195.if target(pre-world)
196 @echo
197 @echo "--------------------------------------------------------------"
198 @echo ">>> Making 'pre-world' target"
199 @echo "--------------------------------------------------------------"
200 ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world
201.endif
202 ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld
203 ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld
204.if target(post-world)
205 @echo
206 @echo "--------------------------------------------------------------"
207 @echo ">>> Making 'post-world' target"
208 @echo "--------------------------------------------------------------"
209 ${_+_}@cd ${.CURDIR}; ${_MAKE} post-world
210.endif
211 @echo
212 @echo "--------------------------------------------------------------"
213 @echo ">>> make world completed on `LC_ALL=C date`"
214 @echo " (started ${STARTTIME})"
215 @echo "--------------------------------------------------------------"
216.else
217world:
218 @echo "WARNING: make world will overwrite your existing FreeBSD"
219 @echo "installation without also building and installing a new"
220 @echo "kernel. This can be dangerous. Please read the handbook,"
221 @echo "'Rebuilding world', for how to upgrade your system."
222 @echo "Define DESTDIR to where you want to install FreeBSD,"
223 @echo "including /, to override this warning and proceed as usual."
224 @echo ""
225 @echo "Bailing out now..."
226 @false
227.endif
228
229#
230# kernel
231#
232# Short hand for `make buildkernel installkernel'
233#
234kernel: buildkernel installkernel
235
236#
237# Perform a few tests to determine if the installed tools are adequate
238# for building the world.
239#
240upgrade_checks:
241 @if ! (cd ${.CURDIR}/tools/build/make_check && \
242 PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \
243 PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
244 then \
245 (cd ${.CURDIR} && ${MAKE} make); \
246 fi
247
248#
249# Upgrade make(1) to the current version using the installed
250# headers, libraries and tools. Also, allow the location of
251# the system bsdmake-like utility to be overridden.
252#
253MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \
254 DESTDIR= \
255 INSTALL="sh ${.CURDIR}/tools/install.sh"
256MMAKE= ${MMAKEENV} ${MAKE} \
257 -D_UPGRADING \
258 -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \
259 -DNO_CPU_CFLAGS -DNO_WERROR
260
261make: .PHONY
262 @echo
263 @echo "--------------------------------------------------------------"
264 @echo ">>> Building an up-to-date make(1)"
265 @echo "--------------------------------------------------------------"
266 ${_+_}@cd ${.CURDIR}/usr.bin/make; \
267 ${MMAKE} obj && \
268 ${MMAKE} depend && \
269 ${MMAKE} all && \
270 ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
271
272tinderbox:
273 cd ${.CURDIR} && \
274 DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe
275
276#
277# universe
278#
279# Attempt to rebuild *everything* for all supported architectures,
280# with a reasonable chance of success, regardless of how old your
281# existing system is.
282#
283.if make(universe) || make(universe_kernels) || make(tinderbox)
284TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
285
286.if defined(DOING_TINDERBOX)
287FAILFILE=tinderbox.failed
288MAKEFAIL=tee -a ${FAILFILE}
289.else
290MAKEFAIL=cat
291.endif
292
293universe: universe_prologue
294universe_prologue:
295 @echo "--------------------------------------------------------------"
296 @echo ">>> make universe started on ${STARTTIME}"
297 @echo "--------------------------------------------------------------"
298.if defined(DOING_TINDERBOX)
299 rm -f ${FAILFILE}
300.endif
301.for target in ${TARGETS}
302universe: universe_${target}
303.ORDER: universe_prologue universe_${target} universe_epilogue
304universe_${target}:
305.if !defined(MAKE_JUST_KERNELS)
306 @echo ">> ${target} started on `LC_ALL=C date`"
307 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
308 ${MAKE} ${JFLAG} buildworld \
309 TARGET=${target} \
310 > _.${target}.buildworld 2>&1 || \
311 (echo "${target} world failed," \
312 "check _.${target}.buildworld for details" | ${MAKEFAIL}))
313 @echo ">> ${target} buildworld completed on `LC_ALL=C date`"
314.endif
315.if !defined(MAKE_JUST_WORLDS)
316.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
317 @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
318 ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
319 (echo "${target} 'make LINT' failed," \
320 "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
321.endif
322 @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \
323 universe_kernels
324.endif
325 @echo ">> ${target} completed on `LC_ALL=C date`"
326.endfor
327universe_kernels: universe_kernconfs
328.if !defined(TARGET)
329TARGET!= uname -m
330.endif
331KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
332 find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
333 ! -name DEFAULTS ! -name NOTES
334universe_kernconfs:
335.for kernel in ${KERNCONFS}
336 @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
337 ${MAKE} ${JFLAG} buildkernel \
338 TARGET=${TARGET} \
339 KERNCONF=${kernel} \
340 > _.${TARGET}.${kernel} 2>&1 || \
341 (echo "${TARGET} ${kernel} kernel failed," \
342 "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL}))
343.endfor
344universe: universe_epilogue
345universe_epilogue:
346 @echo "--------------------------------------------------------------"
347 @echo ">>> make universe completed on `LC_ALL=C date`"
348 @echo " (started ${STARTTIME})"
349 @echo "--------------------------------------------------------------"
350.if defined(DOING_TINDERBOX)
351 @if [ -e ${FAILFILE} ] ; then \
352 echo "Tinderbox failed:" ;\
353 cat ${FAILFILE} ;\
354 exit 1 ;\
355 fi
356.endif
357.endif