Makefile revision 253002
12061Sjkh#
250479Speter# $FreeBSD: head/Makefile 253002 2013-07-07 20:39:11Z alfred $
32061Sjkh#
438666Sjb# The user-driven targets are:
532427Sjb#
6111131Sru# universe            - *Really* build *everything* (buildworld and
7111131Sru#                       all kernels on all architectures).
8217733Sbz# tinderbox           - Same as universe, but presents a list of failed build
9217733Sbz#                       targets and exits with an error if there were any.
1038666Sjb# buildworld          - Rebuild *everything*, including glue to help do
1138666Sjb#                       upgrades.
1238666Sjb# installworld        - Install everything built by "buildworld".
13159363Strhodes# world               - buildworld + installworld, no kernel.
1464049Salex# buildkernel         - Rebuild the kernel and the kernel-modules.
1564049Salex# installkernel       - Install the kernel and the kernel-modules.
16116679Ssimokawa# installkernel.debug
1766071Smarkm# reinstallkernel     - Reinstall the kernel and the kernel-modules.
18116679Ssimokawa# reinstallkernel.debug
1973504Sobrien# kernel              - buildkernel + installkernel.
20204661Simp# kernel-toolchain    - Builds the subset of world necessary to build a kernel
21232907Sjmallett# kernel-toolchains   - Build kernel-toolchain for all universe targets.
22158962Snetchild# doxygen             - Build API documentation of the kernel, needs doxygen.
23223148Sru# update              - Convenient way to update your source tree(s).
24169597Sdes# check-old           - List obsolete directories/files/libraries.
25169597Sdes# check-old-dirs      - List obsolete directories.
26169597Sdes# check-old-files     - List obsolete files.
27169597Sdes# check-old-libs      - List obsolete libraries.
28231821Spluknet# delete-old          - Delete obsolete directories/files.
29169597Sdes# delete-old-dirs     - Delete obsolete directories.
30169597Sdes# delete-old-files    - Delete obsolete files.
31169597Sdes# delete-old-libs     - Delete obsolete libraries.
32217815Sbz# targets             - Print a list of supported TARGET/TARGET_ARCH pairs
33217815Sbz#                       for world and kernel targets.
34218524Sjhb# toolchains          - Build a toolchain for all world and kernel targets.
35253002Salfred# 
36253002Salfred# "quick" way to test all kernel builds:
37253002Salfred# 	_jflag=`sysctl -n hw.ncpu`
38253002Salfred# 	_jflag=$(($_jflag * 2))
39253002Salfred# 	[ $_jflag -gt 12 ] && _jflag=12
40253002Salfred# 	make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
4132427Sjb#
4238666Sjb# This makefile is simple by design. The FreeBSD make automatically reads
43108451Sschweikh# the /usr/share/mk/sys.mk unless the -m argument is specified on the
4438666Sjb# command line. By keeping this makefile simple, it doesn't matter too
4538666Sjb# much how different the installed mk files are from those in the source
4638666Sjb# tree. This makefile executes a child make process, forcing it to use
4738666Sjb# the mk files from the source tree which are supposed to DTRT.
4817308Speter#
49217273Simp# Most of the user-driven targets (as listed above) are implemented in
50217294Simp# Makefile.inc1.  The exceptions are universe, tinderbox and targets.
5119175Sbde#
5296205Sjwd# If you want to build your system from source be sure that /usr/obj has
53217297Simp# at least 1GB of diskspace available.  A complete 'universe' build requires
54217297Simp# about 15GB of space.
5538042Sbde#
5696205Sjwd# For individuals wanting to build from the sources currently on their
5796205Sjwd# system, the simple instructions are:
5838042Sbde#
5996205Sjwd# 1.  `cd /usr/src'  (or to the directory containing your source tree).
60159363Strhodes# 2.  Define `HISTORICAL_MAKE_WORLD' variable (see README).
61159363Strhodes# 3.  `make world'
6217308Speter#
6396205Sjwd# For individuals wanting to upgrade their sources (even if only a
6496205Sjwd# delta of a few days):
6517308Speter#
66148330Snetchild#  1.  `cd /usr/src'       (or to the directory containing your source tree).
67148330Snetchild#  2.  `make buildworld'
68148330Snetchild#  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE'     (default is GENERIC).
69148330Snetchild#  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is GENERIC).
70159831Sobrien#       [steps 3. & 4. can be combined by using the "kernel" target]
71148330Snetchild#  5.  `reboot'        (in single user mode: boot -s from the loader prompt).
72148330Snetchild#  6.  `mergemaster -p'
73148330Snetchild#  7.  `make installworld'
74251107Screes#  8.  `mergemaster'		(you may wish to use -i, along with -U or -F).
75251107Screes#  9.  `make delete-old'
76148330Snetchild# 10.  `reboot'
77148330Snetchild# 11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)
7896205Sjwd#
7996205Sjwd# See src/UPDATING `COMMON ITEMS' for more complete information.
8096205Sjwd#
81162147Sru# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can
82162147Sru# cross build world for other machine types using the buildworld target,
8398723Sdillon# and once the world is built you can cross build a kernel using the
8498723Sdillon# buildkernel target.
8598723Sdillon#
8638666Sjb# Define the user-driven targets. These are listed here in alphabetical
8738666Sjb# order, but that's not important.
8817308Speter#
89123311Speter# Targets that begin with underscore are internal targets intended for
90123311Speter# developer convenience only.  They are intentionally not documented and
91123311Speter# completely subject to change without notice.
92123311Speter#
93175833Sjhb# For more information, see the build(7) manual page.
94175833Sjhb#
95169597SdesTGTS=	all all-man buildenv buildenvvars buildkernel buildworld \
96169597Sdes	check-old check-old-dirs check-old-files check-old-libs \
97169597Sdes	checkdpadd clean cleandepend cleandir \
98169597Sdes	delete-old delete-old-dirs delete-old-files delete-old-libs \
99219177Snwhitehorn	depend distribute distributekernel distributekernel.debug \
100219177Snwhitehorn	distributeworld distrib-dirs distribution doxygen \
101238051Sobrien	everything hier hierarchy install installcheck installkernel \
102219177Snwhitehorn	installkernel.debug packagekernel packageworld \
103219177Snwhitehorn	reinstallkernel reinstallkernel.debug \
104158962Snetchild	installworld kernel-toolchain libraries lint maninstall \
105156840Sru	obj objlink regress rerelease showconfig tags toolchain update \
106123311Speter	_worldtmp _legacy _bootstrap-tools _cleanobj _obj \
107137288Speter	_build-tools _cross-tools _includes _libraries _depend \
108209128Sraj	build32 builddtb distribute32 install32 xdev xdev-build xdev-install \
109209128Sraj
110156740SruTGTS+=	${SUBDIR_TARGETS}
1112061Sjkh
11297769SruBITGTS=	files includes
11397252SruBITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
114119579SruTGTS+=	${BITGTS}
11597252Sru
11695730Sru.ORDER: buildworld installworld
11795793Sru.ORDER: buildworld distributeworld
118111617Sru.ORDER: buildworld buildkernel
11995730Sru.ORDER: buildkernel installkernel
120116679Ssimokawa.ORDER: buildkernel installkernel.debug
12195730Sru.ORDER: buildkernel reinstallkernel
122116679Ssimokawa.ORDER: buildkernel reinstallkernel.debug
12395730Sru
124110035SruPATH=	/sbin:/bin:/usr/sbin:/usr/bin
125107516SruMAKEOBJDIRPREFIX?=	/usr/obj
126138921Sru_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
127156145Syar    ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
128138921Sru    -f /dev/null -V MAKEOBJDIRPREFIX dummy
129133942Sru.if !empty(_MAKEOBJDIRPREFIX)
130133942Sru.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
131156145Syar	(in make.conf(5)) or command-line variable.
132133942Sru.endif
133110035SruMAKEPATH=	${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
134117234SruBINMAKE= \
135110035Sru	`if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
136117229Sru	-m ${.CURDIR}/share/mk
137218206Simp_MAKE=	PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
13854324Smarcel
139218130Simp# Guess machine architecture from machine type, and vice versa.
140218130Simp.if !defined(TARGET_ARCH) && defined(TARGET)
141233644Sjmallett_TARGET_ARCH=	${TARGET:S/pc98/i386/}
142218130Simp.elif !defined(TARGET) && defined(TARGET_ARCH) && \
143218130Simp    ${TARGET_ARCH} != ${MACHINE_ARCH}
144239272Sgonzo_TARGET=		${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/}
145218130Simp.endif
146233644Sjmallett# Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1
147218130Simp.if defined(TARGET) && defined(TARGET_ARCH) && \
148233644Sjmallett    ${TARGET} == "mips" && ${TARGET_ARCH:Mmips*eb}
149233644Sjmallett_TARGET_ARCH=		${TARGET_ARCH:C/eb$//}
150233644Sjmallett.warning "TARGET_ARCH of ${TARGET_ARCH} is deprecated in favor of ${_TARGET_ARCH}"
151218130Simp.endif
152233644Sjmallett.if defined(TARGET) && ${TARGET} == "mips" && defined(TARGET_BIG_ENDIAN)
153233644Sjmallett.warning "TARGET_BIG_ENDIAN is no longer necessary for MIPS.  Big-endian is not the default."
154218130Simp.endif
155218130Simp# arm with TARGET_BIG_ENDIAN -> armeb
156218130Simp.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
157218130Simp.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated.  use armeb"
158218130Simp_TARGET_ARCH=armeb
159218130Simp.endif
160218130Simp.if defined(TARGET) && !defined(_TARGET)
161218130Simp_TARGET=${TARGET}
162218130Simp.endif
163218130Simp.if defined(TARGET_ARCH) && !defined(_TARGET_ARCH)
164218130Simp_TARGET_ARCH=${TARGET_ARCH}
165218130Simp.endif
166218130Simp# Otherwise, default to current machine type and architecture.
167218130Simp_TARGET?=	${MACHINE}
168218130Simp_TARGET_ARCH?=	${MACHINE_ARCH}
169218130Simp
17017308Speter#
171119519Smarcel# Make sure we have an up-to-date make(1). Only world and buildworld
172119519Smarcel# should do this as those are the initial targets used for upgrades.
173119519Smarcel# The user can define ALWAYS_CHECK_MAKE to have this check performed
174119519Smarcel# for all targets.
175119519Smarcel#
176119519Smarcel.if defined(ALWAYS_CHECK_MAKE)
177119579Sru${TGTS}: upgrade_checks
178119519Smarcel.else
179119519Smarcelbuildworld: upgrade_checks
180119519Smarcel.endif
181119519Smarcel
182119519Smarcel#
183126031Sgad# This 'cleanworld' target is not included in TGTS, because it is not a
184126024Sgad# recursive target.  All of the work for it is done right here.   It is
185126024Sgad# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be
186126024Sgad# created by bsd.obj.mk, except that we don't want to .include that file
187126024Sgad# in this makefile.  
188126024Sgad#
189126024Sgad# In the following, the first 'rm' in a series will usually remove all
190126024Sgad# files and directories.  If it does not, then there are probably some
191227771Sgjb# files with file flags set, so this unsets them and tries the 'rm' a
192126024Sgad# second time.  There are situations where this target will be cleaning
193126024Sgad# some directories via more than one method, but that duplication is
194227769Sgjb# needed to correctly handle all the possible situations.  Removing all
195227771Sgjb# files without file flags set in the first 'rm' instance saves time,
196227771Sgjb# because 'chflags' will need to operate on fewer files afterwards.
197126024Sgad#
198126024SgadBW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
199126031Sgadcleanworld:
200126024Sgad.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
201126024Sgad.if exists(${BW_CANONICALOBJDIR}/)
202126024Sgad	-rm -rf ${BW_CANONICALOBJDIR}/*
203172744Sdelphij	-chflags -R 0 ${BW_CANONICALOBJDIR}
204126024Sgad	rm -rf ${BW_CANONICALOBJDIR}/*
205126024Sgad.endif
206126024Sgad	#   To be safe in this case, fall back to a 'make cleandir'
207133376Sharti	${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
208126024Sgad.else
209126024Sgad	-rm -rf ${.OBJDIR}/*
210172744Sdelphij	-chflags -R 0 ${.OBJDIR}
211126024Sgad	rm -rf ${.OBJDIR}/*
212126024Sgad.endif
213125885Sgad
214125885Sgad#
21538666Sjb# Handle the user-driven targets, using the source relative mk files.
21617308Speter#
217119519Smarcel
218251750Ssjg.if empty(.MAKEFLAGS:M-n)
219251750Ssjg# skip this for -n to avoid changing previous behavior of 
220251750Ssjg# 'make -n buildworld' etc.
221251750Ssjg${TGTS}: .MAKE
222251750Ssjg.endif
223251750Ssjg
224119579Sru${TGTS}:
225218206Simp	${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET}
2262302Spaul
22739206Sjkh# Set a reasonable default
22839206Sjkh.MAIN:	all
22939206Sjkh
230133945SruSTARTTIME!= LC_ALL=C date
231240403SobrienCHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo
232177609Sru.if !empty(CHECK_TIME)
233177609Sru.error check your date/time: ${STARTTIME}
234177609Sru.endif
235133945Sru
236132358Smarkm.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
23717308Speter#
23854324Smarcel# world
23954324Smarcel#
240132234Smarcel# Attempt to rebuild and reinstall everything. This target is not to be
241132234Smarcel# used for upgrading an existing FreeBSD system, because the kernel is
242132234Smarcel# not included. One can argue that this target doesn't build everything
243132234Smarcel# then.
24454324Smarcel#
24554324Smarcelworld: upgrade_checks
24654324Smarcel	@echo "--------------------------------------------------------------"
247118531Sru	@echo ">>> make world started on ${STARTTIME}"
24854324Smarcel	@echo "--------------------------------------------------------------"
24954324Smarcel.if target(pre-world)
25054324Smarcel	@echo
25154324Smarcel	@echo "--------------------------------------------------------------"
25254324Smarcel	@echo ">>> Making 'pre-world' target"
25354324Smarcel	@echo "--------------------------------------------------------------"
254133376Sharti	${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world
25554324Smarcel.endif
256133376Sharti	${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld
257133376Sharti	${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld
25854324Smarcel.if target(post-world)
25954324Smarcel	@echo
26054324Smarcel	@echo "--------------------------------------------------------------"
26154324Smarcel	@echo ">>> Making 'post-world' target"
26254324Smarcel	@echo "--------------------------------------------------------------"
263133376Sharti	${_+_}@cd ${.CURDIR}; ${_MAKE} post-world
26454324Smarcel.endif
26554324Smarcel	@echo
26654324Smarcel	@echo "--------------------------------------------------------------"
267118531Sru	@echo ">>> make world completed on `LC_ALL=C date`"
268118531Sru	@echo "                   (started ${STARTTIME})"
26954324Smarcel	@echo "--------------------------------------------------------------"
270132234Smarcel.else
271132234Smarcelworld:
272132234Smarcel	@echo "WARNING: make world will overwrite your existing FreeBSD"
273132234Smarcel	@echo "installation without also building and installing a new"
274132234Smarcel	@echo "kernel.  This can be dangerous.  Please read the handbook,"
275132588Skensmith	@echo "'Rebuilding world', for how to upgrade your system."
276132358Smarkm	@echo "Define DESTDIR to where you want to install FreeBSD,"
277132234Smarcel	@echo "including /, to override this warning and proceed as usual."
278132358Smarkm	@echo ""
279132234Smarcel	@echo "Bailing out now..."
280132234Smarcel	@false
281132234Smarcel.endif
28254324Smarcel
28354324Smarcel#
28495730Sru# kernel
28595730Sru#
28695730Sru# Short hand for `make buildkernel installkernel'
28795730Sru#
28895730Srukernel: buildkernel installkernel
28995730Sru
29095730Sru#
29138666Sjb# Perform a few tests to determine if the installed tools are adequate
292107374Sru# for building the world.
29317308Speter#
29455678Smarcelupgrade_checks:
295241298Smarcel.if !defined(.PARSEDIR)
296250719Ssjg.if !defined(WITHOUT_BMAKE)
297249395Ssjg	(cd ${.CURDIR} && ${MAKE} bmake)
298249395Ssjg.else
299143032Sharti	@if ! (cd ${.CURDIR}/tools/build/make_check && \
300138515Sharti	    PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \
301117793Sru	    PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
302110035Sru	then \
303174564Simp	    (cd ${.CURDIR} && ${MAKE} make); \
304110035Sru	fi
305241298Smarcel.endif
306249395Ssjg.endif
3072061Sjkh
30817308Speter#
309107516Sru# Upgrade make(1) to the current version using the installed
310174539Simp# headers, libraries and tools.  Also, allow the location of
311174539Simp# the system bsdmake-like utility to be overridden.
31255678Smarcel#
313107516SruMMAKEENV=	MAKEOBJDIRPREFIX=${MAKEPATH} \
314107516Sru		DESTDIR= \
315107516Sru		INSTALL="sh ${.CURDIR}/tools/install.sh"
316174564SimpMMAKE=		${MMAKEENV} ${MAKE} \
317107516Sru		-D_UPGRADING \
318139112Sru		-DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \
319164470Sjb		-DNO_CPU_CFLAGS -DNO_WERROR
320107516Sru
321249395Ssjgmake bmake: .PHONY
32255678Smarcel	@echo
32355678Smarcel	@echo "--------------------------------------------------------------"
324116696Sru	@echo ">>> Building an up-to-date make(1)"
32555678Smarcel	@echo "--------------------------------------------------------------"
326249395Ssjg	${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \
327107516Sru		${MMAKE} obj && \
328107516Sru		${MMAKE} depend && \
329107516Sru		${MMAKE} all && \
330107516Sru		${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
33155678Smarcel
332185499Salfredtinderbox:
333218524Sjhb	@cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
334185499Salfred
335218524Sjhbtoolchains:
336218524Sjhb	@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe
337218524Sjhb
338232907Sjmallettkernel-toolchains:
339232907Sjmallett	@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=kernel-toolchain universe
340232907Sjmallett
34155678Smarcel#
342111131Sru# universe
343111131Sru#
344111131Sru# Attempt to rebuild *everything* for all supported architectures,
345133945Sru# with a reasonable chance of success, regardless of how old your
346111131Sru# existing system is.
347111131Sru#
348217125Simp.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
349221869SattilioTARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
350239272SgonzoTARGET_ARCHES_arm?=	arm armeb armv6 armv6eb
351233644SjmallettTARGET_ARCHES_mips?=	mipsel mips mips64el mips64 mipsn32
352216520SnwhitehornTARGET_ARCHES_powerpc?=	powerpc powerpc64
353216520SnwhitehornTARGET_ARCHES_pc98?=	i386
354216520Snwhitehorn.for target in ${TARGETS}
355216520SnwhitehornTARGET_ARCHES_${target}?= ${target}
356216520Snwhitehorn.endfor
357168280Smarcel
358218524Sjhb.if defined(UNIVERSE_TARGET)
359218524SjhbMAKE_JUST_WORLDS=	YES
360218524Sjhb.else
361218524SjhbUNIVERSE_TARGET?=	buildworld
362218524Sjhb.endif
363219137SjhbKERNSRCDIR?=		${.CURDIR}/sys
364218524Sjhb
365217125Simptargets:
366217815Sbz	@echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets"
367217125Simp.for target in ${TARGETS}
368217125Simp.for target_arch in ${TARGET_ARCHES_${target}}
369217125Simp	@echo "    ${target}/${target_arch}"
370217125Simp.endfor
371217125Simp.endfor
372217125Simp
373185499Salfred.if defined(DOING_TINDERBOX)
374217735SbzFAILFILE=${.CURDIR}/_.tinderbox.failed
375185499SalfredMAKEFAIL=tee -a ${FAILFILE}
376185499Salfred.else
377185499SalfredMAKEFAIL=cat
378185499Salfred.endif
379185499Salfred
380249316Sdimuniverse: universe_prologue upgrade_checks
381133945Sruuniverse_prologue:
382103985Sphk	@echo "--------------------------------------------------------------"
383103985Sphk	@echo ">>> make universe started on ${STARTTIME}"
384103985Sphk	@echo "--------------------------------------------------------------"
385185499Salfred.if defined(DOING_TINDERBOX)
386217754Sbz	@rm -f ${FAILFILE}
387185499Salfred.endif
388168280Smarcel.for target in ${TARGETS}
389162147Sruuniverse: universe_${target}
390251352Ssjg.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue
391216520Snwhitehornuniverse_${target}: universe_${target}_prologue
392216520Snwhitehornuniverse_${target}_prologue:
393216520Snwhitehorn	@echo ">> ${target} started on `LC_ALL=C date`"
394179232Sjb.if !defined(MAKE_JUST_KERNELS)
395216520Snwhitehorn.for target_arch in ${TARGET_ARCHES_${target}}
396216520Snwhitehornuniverse_${target}: universe_${target}_${target_arch}
397216520Snwhitehornuniverse_${target}_${target_arch}: universe_${target}_prologue
398218524Sjhb	@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
399185250Sdes	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
400218524Sjhb	    ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
401162147Sru	    TARGET=${target} \
402216520Snwhitehorn	    TARGET_ARCH=${target_arch} \
403218524Sjhb	    > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \
404218524Sjhb	    (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \
405218524Sjhb	    "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \
406216520Snwhitehorn	    ${MAKEFAIL}))
407218524Sjhb	@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
408216520Snwhitehorn.endfor
409179232Sjb.endif
410205290Sdougb.if !defined(MAKE_JUST_WORLDS)
411248937Sandrew# If we are building world and kernels wait for the required worlds to finish
412248937Sandrew.if !defined(MAKE_JUST_KERNELS)
413248937Sandrew.for target_arch in ${TARGET_ARCHES_${target}}
414248937Sandrewuniverse_${target}_kernels: universe_${target}_${target_arch}
415248937Sandrew.endfor
416248937Sandrew.endif
417248937Sandrewuniverse_${target}: universe_${target}_kernels
418248937Sandrewuniverse_${target}_kernels: universe_${target}_prologue
419219137Sjhb.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
420219137Sjhb	@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
421185250Sdes	    ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
422185499Salfred	    (echo "${target} 'make LINT' failed," \
423185499Salfred	    "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
424103985Sphk.endif
425201815Sbz	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \
426201815Sbz	    universe_kernels
427205290Sdougb.endif
428201815Sbz	@echo ">> ${target} completed on `LC_ALL=C date`"
429201815Sbz.endfor
430201815Sbzuniverse_kernels: universe_kernconfs
431202095Sbz.if !defined(TARGET)
432202095SbzTARGET!=	uname -m
433202095Sbz.endif
434219137SjhbKERNCONFS!=	cd ${KERNSRCDIR}/${TARGET}/conf && \
435201815Sbz		find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
436201815Sbz		! -name DEFAULTS ! -name NOTES
437201815Sbzuniverse_kernconfs:
438148154Sru.for kernel in ${KERNCONFS}
439219137SjhbTARGET_ARCH_${kernel}!=	cd ${KERNSRCDIR}/${TARGET}/conf && \
440219137Sjhb	config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \
441216934Simp	grep -v WARNING: | cut -f 2
442216934Simp.if empty(TARGET_ARCH_${kernel})
443216934Simp.error "Target architecture for ${TARGET}/conf/${kernel} unknown.  config(8) likely too old."
444216934Simp.endif
445216520Snwhitehornuniverse_kernconfs: universe_kernconf_${TARGET}_${kernel}
446216520Snwhitehornuniverse_kernconf_${TARGET}_${kernel}:
447185250Sdes	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
448185250Sdes	    ${MAKE} ${JFLAG} buildkernel \
449201815Sbz	    TARGET=${TARGET} \
450216520Snwhitehorn	    TARGET_ARCH=${TARGET_ARCH_${kernel}} \
451148154Sru	    KERNCONF=${kernel} \
452201815Sbz	    > _.${TARGET}.${kernel} 2>&1 || \
453201815Sbz	    (echo "${TARGET} ${kernel} kernel failed," \
454201815Sbz	    "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL}))
455148154Sru.endfor
456133945Sruuniverse: universe_epilogue
457133945Sruuniverse_epilogue:
458103985Sphk	@echo "--------------------------------------------------------------"
459118531Sru	@echo ">>> make universe completed on `LC_ALL=C date`"
460118531Sru	@echo "                      (started ${STARTTIME})"
461103985Sphk	@echo "--------------------------------------------------------------"
462185499Salfred.if defined(DOING_TINDERBOX)
463185499Salfred	@if [ -e ${FAILFILE} ] ; then \
464185499Salfred		echo "Tinderbox failed:" ;\
465185499Salfred		cat ${FAILFILE} ;\
466185499Salfred		exit 1 ;\
467185499Salfred	fi
468133945Sru.endif
469185499Salfred.endif
470242522Smarcel
471242522SmarcelbuildLINT:
472242522Smarcel	${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT
473