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