Makefile revision 227771
1243789Sdim#
2243789Sdim# $FreeBSD: head/Makefile 227771 2011-11-20 20:05:47Z gjb $
3243789Sdim#
4243789Sdim# The user-driven targets are:
5243789Sdim#
6243789Sdim# universe            - *Really* build *everything* (buildworld and
7243789Sdim#                       all kernels on all architectures).
8243789Sdim# tinderbox           - Same as universe, but presents a list of failed build
9243789Sdim#                       targets and exits with an error if there were any.
10243789Sdim# buildworld          - Rebuild *everything*, including glue to help do
11243789Sdim#                       upgrades.
12243789Sdim# installworld        - Install everything built by "buildworld".
13243789Sdim# world               - buildworld + installworld, no kernel.
14243789Sdim# buildkernel         - Rebuild the kernel and the kernel-modules.
15243789Sdim# installkernel       - Install the kernel and the kernel-modules.
16243789Sdim# installkernel.debug
17243789Sdim# reinstallkernel     - Reinstall the kernel and the kernel-modules.
18243789Sdim# reinstallkernel.debug
19243789Sdim# kernel              - buildkernel + installkernel.
20243789Sdim# kernel-toolchain    - Builds the subset of world necessary to build a kernel
21243789Sdim# doxygen             - Build API documentation of the kernel, needs doxygen.
22243789Sdim# update              - Convenient way to update your source tree(s).
23243789Sdim# check-old           - List obsolete directories/files/libraries.
24243789Sdim# check-old-dirs      - List obsolete directories.
25243789Sdim# check-old-files     - List obsolete files.
26243789Sdim# check-old-libs      - List obsolete libraries.
27243789Sdim# delete-old          - Delete obsolete directories/files/libraries.
28249423Sdim# delete-old-dirs     - Delete obsolete directories.
29243789Sdim# delete-old-files    - Delete obsolete files.
30243789Sdim# delete-old-libs     - Delete obsolete libraries.
31243789Sdim# targets             - Print a list of supported TARGET/TARGET_ARCH pairs
32243789Sdim#                       for world and kernel targets.
33243789Sdim# toolchains          - Build a toolchain for all world and kernel targets.
34249423Sdim#
35243789Sdim# This makefile is simple by design. The FreeBSD make automatically reads
36249423Sdim# the /usr/share/mk/sys.mk unless the -m argument is specified on the
37249423Sdim# command line. By keeping this makefile simple, it doesn't matter too
38249423Sdim# much how different the installed mk files are from those in the source
39249423Sdim# tree. This makefile executes a child make process, forcing it to use
40249423Sdim# the mk files from the source tree which are supposed to DTRT.
41249423Sdim#
42249423Sdim# Most of the user-driven targets (as listed above) are implemented in
43249423Sdim# Makefile.inc1.  The exceptions are universe, tinderbox and targets.
44249423Sdim#
45249423Sdim# If you want to build your system from source be sure that /usr/obj has
46249423Sdim# at least 1GB of diskspace available.  A complete 'universe' build requires
47249423Sdim# about 15GB of space.
48249423Sdim#
49243789Sdim# For individuals wanting to build from the sources currently on their
50263508Sdim# system, the simple instructions are:
51243789Sdim#
52243789Sdim# 1.  `cd /usr/src'  (or to the directory containing your source tree).
53243789Sdim# 2.  Define `HISTORICAL_MAKE_WORLD' variable (see README).
54243789Sdim# 3.  `make world'
55243789Sdim#
56243789Sdim# For individuals wanting to upgrade their sources (even if only a
57243789Sdim# delta of a few days):
58243789Sdim#
59243789Sdim#  1.  `cd /usr/src'       (or to the directory containing your source tree).
60243789Sdim#  2.  `make buildworld'
61249423Sdim#  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE'     (default is GENERIC).
62263508Sdim#  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is GENERIC).
63263508Sdim#       [steps 3. & 4. can be combined by using the "kernel" target]
64263508Sdim#  5.  `reboot'        (in single user mode: boot -s from the loader prompt).
65249423Sdim#  6.  `mergemaster -p'
66249423Sdim#  7.  `make installworld'
67243789Sdim#  8.  `make delete-old'
68249423Sdim#  9.  `mergemaster'		(you may wish to use -i, along with -U or -F).
69249423Sdim# 10.  `reboot'
70243789Sdim# 11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)
71243789Sdim#
72243789Sdim# See src/UPDATING `COMMON ITEMS' for more complete information.
73243789Sdim#
74243789Sdim# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can
75243789Sdim# cross build world for other machine types using the buildworld target,
76243789Sdim# and once the world is built you can cross build a kernel using the
77249423Sdim# buildkernel target.
78249423Sdim#
79249423Sdim# Define the user-driven targets. These are listed here in alphabetical
80249423Sdim# order, but that's not important.
81249423Sdim#
82249423Sdim# Targets that begin with underscore are internal targets intended for
83249423Sdim# developer convenience only.  They are intentionally not documented and
84243789Sdim# completely subject to change without notice.
85249423Sdim#
86243789Sdim# For more information, see the build(7) manual page.
87249423Sdim#
88249423SdimTGTS=	all all-man buildenv buildenvvars buildkernel buildworld \
89249423Sdim	check-old check-old-dirs check-old-files check-old-libs \
90249423Sdim	checkdpadd clean cleandepend cleandir \
91249423Sdim	delete-old delete-old-dirs delete-old-files delete-old-libs \
92249423Sdim	depend distribute distributekernel distributekernel.debug \
93249423Sdim	distributeworld distrib-dirs distribution doxygen \
94243789Sdim	everything hierarchy install installcheck installkernel \
95249423Sdim	installkernel.debug packagekernel packageworld \
96249423Sdim	reinstallkernel reinstallkernel.debug \
97249423Sdim	installworld kernel-toolchain libraries lint maninstall \
98249423Sdim	obj objlink regress rerelease showconfig tags toolchain update \
99249423Sdim	_worldtmp _legacy _bootstrap-tools _cleanobj _obj \
100249423Sdim	_build-tools _cross-tools _includes _libraries _depend \
101249423Sdim	build32 builddtb distribute32 install32 xdev xdev-build xdev-install \
102243789Sdim
103249423SdimTGTS+=	${SUBDIR_TARGETS}
104249423Sdim
105249423SdimBITGTS=	files includes
106249423SdimBITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
107249423SdimTGTS+=	${BITGTS}
108249423Sdim
109249423Sdim.ORDER: buildworld installworld
110249423Sdim.ORDER: buildworld distributeworld
111249423Sdim.ORDER: buildworld buildkernel
112243789Sdim.ORDER: buildkernel installkernel
113249423Sdim.ORDER: buildkernel installkernel.debug
114263508Sdim.ORDER: buildkernel reinstallkernel
115263508Sdim.ORDER: buildkernel reinstallkernel.debug
116263508Sdim
117263508SdimPATH=	/sbin:/bin:/usr/sbin:/usr/bin
118263508SdimMAKEOBJDIRPREFIX?=	/usr/obj
119263508Sdim_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
120263508Sdim    ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
121249423Sdim    -f /dev/null -V MAKEOBJDIRPREFIX dummy
122249423Sdim.if !empty(_MAKEOBJDIRPREFIX)
123243789Sdim.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
124249423Sdim	(in make.conf(5)) or command-line variable.
125249423Sdim.endif
126243789SdimMAKEPATH=	${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
127263508SdimBINMAKE= \
128263508Sdim	`if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
129263508Sdim	-m ${.CURDIR}/share/mk
130243789Sdim_MAKE=	PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
131263508Sdim
132263508Sdim# Guess machine architecture from machine type, and vice versa.
133263508Sdim.if !defined(TARGET_ARCH) && defined(TARGET)
134263508Sdim_TARGET_ARCH=	${TARGET:S/pc98/i386/:S/mips/mipsel/}
135263508Sdim.elif !defined(TARGET) && defined(TARGET_ARCH) && \
136263508Sdim    ${TARGET_ARCH} != ${MACHINE_ARCH}
137263508Sdim_TARGET=		${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/}
138263508Sdim.endif
139263508Sdim# Legacy names, for a transition period mips:mips -> mipsel:mips
140263508Sdim.if defined(TARGET) && defined(TARGET_ARCH) && \
141263508Sdim    ${TARGET_ARCH} == "mips" && ${TARGET} == "mips"
142263508Sdim.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb"
143263508Sdim.if defined(TARGET_BIG_ENDIAN)
144263508Sdim_TARGET_ARCH=mipseb
145263508Sdim.else
146263508Sdim_TARGET_ARCH=mipsel
147263508Sdim.endif
148249423Sdim.endif
149243789Sdim# arm with TARGET_BIG_ENDIAN -> armeb
150249423Sdim.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
151249423Sdim.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated.  use armeb"
152249423Sdim_TARGET_ARCH=armeb
153249423Sdim.endif
154263508Sdim.if defined(TARGET) && !defined(_TARGET)
155263508Sdim_TARGET=${TARGET}
156263508Sdim.endif
157263508Sdim.if defined(TARGET_ARCH) && !defined(_TARGET_ARCH)
158263508Sdim_TARGET_ARCH=${TARGET_ARCH}
159249423Sdim.endif
160249423Sdim# Otherwise, default to current machine type and architecture.
161243789Sdim_TARGET?=	${MACHINE}
162249423Sdim_TARGET_ARCH?=	${MACHINE_ARCH}
163263508Sdim
164263508Sdim#
165263508Sdim# Make sure we have an up-to-date make(1). Only world and buildworld
166249423Sdim# should do this as those are the initial targets used for upgrades.
167249423Sdim# The user can define ALWAYS_CHECK_MAKE to have this check performed
168263508Sdim# for all targets.
169263508Sdim#
170249423Sdim.if defined(ALWAYS_CHECK_MAKE)
171249423Sdim${TGTS}: upgrade_checks
172263508Sdim.else
173263508Sdimbuildworld: upgrade_checks
174263508Sdim.endif
175249423Sdim
176263508Sdim#
177249423Sdim# This 'cleanworld' target is not included in TGTS, because it is not a
178263508Sdim# recursive target.  All of the work for it is done right here.   It is
179249423Sdim# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
180263508Sdim# created by bsd.obj.mk, except that we don't want to .include that file
181263508Sdim# in this makefile.  
182263508Sdim#
183263508Sdim# In the following, the first 'rm' in a series will usually remove all
184249423Sdim# files and directories.  If it does not, then there are probably some
185249423Sdim# files with file flags set, so this unsets them and tries the 'rm' a
186249423Sdim# second time.  There are situations where this target will be cleaning
187249423Sdim# some directories via more than one method, but that duplication is
188263508Sdim# needed to correctly handle all the possible situations.  Removing all
189249423Sdim# files without file flags set in the first 'rm' instance saves time,
190263508Sdim# because 'chflags' will need to operate on fewer files afterwards.
191263508Sdim#
192263508SdimBW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
193263508Sdimcleanworld:
194263508Sdim.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
195263508Sdim.if exists(${BW_CANONICALOBJDIR}/)
196249423Sdim	-rm -rf ${BW_CANONICALOBJDIR}/*
197263508Sdim	-chflags -R 0 ${BW_CANONICALOBJDIR}
198263508Sdim	rm -rf ${BW_CANONICALOBJDIR}/*
199243789Sdim.endif
200243789Sdim	#   To be safe in this case, fall back to a 'make cleandir'
201243789Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
202263508Sdim.else
203243789Sdim	-rm -rf ${.OBJDIR}/*
204243789Sdim	-chflags -R 0 ${.OBJDIR}
205243789Sdim	rm -rf ${.OBJDIR}/*
206263508Sdim.endif
207243789Sdim
208263508Sdim#
209263508Sdim# Handle the user-driven targets, using the source relative mk files.
210263508Sdim#
211243789Sdim
212263508Sdim${TGTS}:
213263508Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET}
214263508Sdim
215243789Sdim# Set a reasonable default
216243789Sdim.MAIN:	all
217243789Sdim
218243789SdimSTARTTIME!= LC_ALL=C date
219243789SdimCHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s
220243789Sdim.if !empty(CHECK_TIME)
221243789Sdim.error check your date/time: ${STARTTIME}
222243789Sdim.endif
223243789Sdim
224243789Sdim.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
225243789Sdim#
226243789Sdim# world
227243789Sdim#
228243789Sdim# Attempt to rebuild and reinstall everything. This target is not to be
229243789Sdim# used for upgrading an existing FreeBSD system, because the kernel is
230243789Sdim# not included. One can argue that this target doesn't build everything
231243789Sdim# then.
232243789Sdim#
233243789Sdimworld: upgrade_checks
234243789Sdim	@echo "--------------------------------------------------------------"
235243789Sdim	@echo ">>> make world started on ${STARTTIME}"
236243789Sdim	@echo "--------------------------------------------------------------"
237243789Sdim.if target(pre-world)
238243789Sdim	@echo
239243789Sdim	@echo "--------------------------------------------------------------"
240243789Sdim	@echo ">>> Making 'pre-world' target"
241243789Sdim	@echo "--------------------------------------------------------------"
242263508Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world
243243789Sdim.endif
244263508Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld
245263508Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld
246243789Sdim.if target(post-world)
247243789Sdim	@echo
248243789Sdim	@echo "--------------------------------------------------------------"
249243789Sdim	@echo ">>> Making 'post-world' target"
250243789Sdim	@echo "--------------------------------------------------------------"
251243789Sdim	${_+_}@cd ${.CURDIR}; ${_MAKE} post-world
252243789Sdim.endif
253263508Sdim	@echo
254263508Sdim	@echo "--------------------------------------------------------------"
255243789Sdim	@echo ">>> make world completed on `LC_ALL=C date`"
256249423Sdim	@echo "                   (started ${STARTTIME})"
257243789Sdim	@echo "--------------------------------------------------------------"
258243789Sdim.else
259243789Sdimworld:
260243789Sdim	@echo "WARNING: make world will overwrite your existing FreeBSD"
261263508Sdim	@echo "installation without also building and installing a new"
262263508Sdim	@echo "kernel.  This can be dangerous.  Please read the handbook,"
263243789Sdim	@echo "'Rebuilding world', for how to upgrade your system."
264243789Sdim	@echo "Define DESTDIR to where you want to install FreeBSD,"
265263508Sdim	@echo "including /, to override this warning and proceed as usual."
266263508Sdim	@echo ""
267243789Sdim	@echo "Bailing out now..."
268243789Sdim	@false
269263508Sdim.endif
270243789Sdim
271263508Sdim#
272263508Sdim# kernel
273263508Sdim#
274263508Sdim# Short hand for `make buildkernel installkernel'
275263508Sdim#
276243789Sdimkernel: buildkernel installkernel
277243789Sdim
278243789Sdim#
279263508Sdim# Perform a few tests to determine if the installed tools are adequate
280263508Sdim# for building the world.
281263508Sdim#
282263508Sdimupgrade_checks:
283243789Sdim	@if ! (cd ${.CURDIR}/tools/build/make_check && \
284243789Sdim	    PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \
285243789Sdim	    PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
286243789Sdim	then \
287243789Sdim	    (cd ${.CURDIR} && ${MAKE} make); \
288243789Sdim	fi
289243789Sdim
290243789Sdim#
291243789Sdim# Upgrade make(1) to the current version using the installed
292243789Sdim# headers, libraries and tools.  Also, allow the location of
293243789Sdim# the system bsdmake-like utility to be overridden.
294243789Sdim#
295243789SdimMMAKEENV=	MAKEOBJDIRPREFIX=${MAKEPATH} \
296243789Sdim		DESTDIR= \
297249423Sdim		INSTALL="sh ${.CURDIR}/tools/install.sh"
298249423SdimMMAKE=		${MMAKEENV} ${MAKE} \
299249423Sdim		-D_UPGRADING \
300249423Sdim		-DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \
301249423Sdim		-DNO_CPU_CFLAGS -DNO_WERROR
302249423Sdim
303249423Sdimmake: .PHONY
304249423Sdim	@echo
305243789Sdim	@echo "--------------------------------------------------------------"
306249423Sdim	@echo ">>> Building an up-to-date make(1)"
307249423Sdim	@echo "--------------------------------------------------------------"
308243789Sdim	${_+_}@cd ${.CURDIR}/usr.bin/make; \
309263508Sdim		${MMAKE} obj && \
310243789Sdim		${MMAKE} depend && \
311263508Sdim		${MMAKE} all && \
312263508Sdim		${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
313263508Sdim
314263508Sdimtinderbox:
315263508Sdim	@cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
316263508Sdim
317243789Sdimtoolchains:
318249423Sdim	@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe
319263508Sdim
320249423Sdim#
321263508Sdim# universe
322263508Sdim#
323243789Sdim# Attempt to rebuild *everything* for all supported architectures,
324263508Sdim# with a reasonable chance of success, regardless of how old your
325263508Sdim# existing system is.
326263508Sdim#
327243789Sdim.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
328263508SdimTARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
329263508SdimTARGET_ARCHES_arm?=	arm armeb
330263508SdimTARGET_ARCHES_mips?=	mipsel mipseb mips64el mips64eb mipsn32eb
331243789SdimTARGET_ARCHES_powerpc?=	powerpc powerpc64
332243789SdimTARGET_ARCHES_pc98?=	i386
333263508Sdim.for target in ${TARGETS}
334263508SdimTARGET_ARCHES_${target}?= ${target}
335263508Sdim.endfor
336263508Sdim
337263508Sdim.if defined(UNIVERSE_TARGET)
338249423SdimMAKE_JUST_WORLDS=	YES
339243789Sdim.else
340249423SdimUNIVERSE_TARGET?=	buildworld
341249423Sdim.endif
342249423SdimKERNSRCDIR?=		${.CURDIR}/sys
343243789Sdim
344249423Sdimtargets:
345249423Sdim	@echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets"
346263508Sdim.for target in ${TARGETS}
347243789Sdim.for target_arch in ${TARGET_ARCHES_${target}}
348263508Sdim	@echo "    ${target}/${target_arch}"
349243789Sdim.endfor
350243789Sdim.endfor
351249423Sdim
352249423Sdim.if defined(DOING_TINDERBOX)
353243789SdimFAILFILE=${.CURDIR}/_.tinderbox.failed
354243789SdimMAKEFAIL=tee -a ${FAILFILE}
355243789Sdim.else
356249423SdimMAKEFAIL=cat
357249423Sdim.endif
358249423Sdim
359249423Sdimuniverse: universe_prologue
360243789Sdimuniverse_prologue:
361243789Sdim	@echo "--------------------------------------------------------------"
362243789Sdim	@echo ">>> make universe started on ${STARTTIME}"
363243789Sdim	@echo "--------------------------------------------------------------"
364263508Sdim.if defined(DOING_TINDERBOX)
365243789Sdim	@rm -f ${FAILFILE}
366243789Sdim.endif
367243789Sdim.for target in ${TARGETS}
368243789Sdimuniverse: universe_${target}
369263508Sdim.ORDER: universe_prologue universe_${target} universe_epilogue
370243789Sdimuniverse_${target}: universe_${target}_prologue
371243789Sdimuniverse_${target}_prologue:
372263508Sdim	@echo ">> ${target} started on `LC_ALL=C date`"
373263508Sdim.if !defined(MAKE_JUST_KERNELS)
374263508Sdim.for target_arch in ${TARGET_ARCHES_${target}}
375263508Sdimuniverse_${target}: universe_${target}_${target_arch}
376263508Sdimuniverse_${target}_${target_arch}: universe_${target}_prologue
377263508Sdim	@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
378263508Sdim	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
379263508Sdim	    ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
380263508Sdim	    TARGET=${target} \
381263508Sdim	    TARGET_ARCH=${target_arch} \
382263508Sdim	    > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \
383263508Sdim	    (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \
384263508Sdim	    "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \
385263508Sdim	    ${MAKEFAIL}))
386249423Sdim	@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
387249423Sdim.endfor
388249423Sdim.endif
389249423Sdim.if !defined(MAKE_JUST_WORLDS)
390249423Sdim.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
391249423Sdim	@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
392249423Sdim	    ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
393249423Sdim	    (echo "${target} 'make LINT' failed," \
394249423Sdim	    "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
395249423Sdim.endif
396249423Sdim	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \
397249423Sdim	    universe_kernels
398243789Sdim.endif
399249423Sdim	@echo ">> ${target} completed on `LC_ALL=C date`"
400249423Sdim.endfor
401249423Sdimuniverse_kernels: universe_kernconfs
402249423Sdim.if !defined(TARGET)
403249423SdimTARGET!=	uname -m
404249423Sdim.endif
405249423SdimKERNCONFS!=	cd ${KERNSRCDIR}/${TARGET}/conf && \
406249423Sdim		find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
407249423Sdim		! -name DEFAULTS ! -name NOTES
408249423Sdimuniverse_kernconfs:
409249423Sdim.for kernel in ${KERNCONFS}
410249423SdimTARGET_ARCH_${kernel}!=	cd ${KERNSRCDIR}/${TARGET}/conf && \
411249423Sdim	config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \
412249423Sdim	grep -v WARNING: | cut -f 2
413249423Sdim.if empty(TARGET_ARCH_${kernel})
414249423Sdim.error "Target architecture for ${TARGET}/conf/${kernel} unknown.  config(8) likely too old."
415249423Sdim.endif
416249423Sdimuniverse_kernconfs: universe_kernconf_${TARGET}_${kernel}
417249423Sdimuniverse_kernconf_${TARGET}_${kernel}:
418249423Sdim	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
419249423Sdim	    ${MAKE} ${JFLAG} buildkernel \
420249423Sdim	    TARGET=${TARGET} \
421249423Sdim	    TARGET_ARCH=${TARGET_ARCH_${kernel}} \
422243789Sdim	    KERNCONF=${kernel} \
423243789Sdim	    > _.${TARGET}.${kernel} 2>&1 || \
424243789Sdim	    (echo "${TARGET} ${kernel} kernel failed," \
425243789Sdim	    "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL}))
426243789Sdim.endfor
427243789Sdimuniverse: universe_epilogue
428243789Sdimuniverse_epilogue:
429249423Sdim	@echo "--------------------------------------------------------------"
430249423Sdim	@echo ">>> make universe completed on `LC_ALL=C date`"
431249423Sdim	@echo "                      (started ${STARTTIME})"
432243789Sdim	@echo "--------------------------------------------------------------"
433243789Sdim.if defined(DOING_TINDERBOX)
434263508Sdim	@if [ -e ${FAILFILE} ] ; then \
435249423Sdim		echo "Tinderbox failed:" ;\
436263508Sdim		cat ${FAILFILE} ;\
437243789Sdim		exit 1 ;\
438243789Sdim	fi
439243789Sdim.endif
440243789Sdim.endif
441249423Sdim