aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-11-08 19:38:31 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-11-08 19:38:31 +0000
commit0ccf8b63170fef406fca97fc9a0690e7e1d18f78 (patch)
treeac9955a793c5d42fd29bca57a12e18a4cbbb4e1d /Makefile
parent07f3cbff8c3d6e2fd5c8ce9eff346761ce65ba9e (diff)
MFC:
- moved the MAKEOBJDIRPREFIX check from Makefile.inc1 to Makefile, - improved "make universe", - fixed "make world DESTDIR=/mnt".
Notes
svn path=/stable/5/; revision=137404
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 23 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 51bd582efda0..366796a2db2f 100644
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,13 @@ TGTS+= ${BITGTS}
PATH= /sbin:/bin:/usr/sbin:/usr/bin
MAKEOBJDIRPREFIX?= /usr/obj
+_MAKEOBJDIRPREFIX!= /usr/bin/env -i \
+ PATH=${PATH} MAKEFLAGS="${.MAKEFLAGS}" ${MAKE} \
+ -f /dev/null -V MAKEOBJDIRPREFIX dummy
+.if !empty(_MAKEOBJDIRPREFIX)
+.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
+ (in /etc/make.conf) or command-line variable.
+.endif
MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
BINMAKE= \
`if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
@@ -144,10 +151,9 @@ ${TGTS}:
# Set a reasonable default
.MAIN: all
-.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
-.if make(world)
STARTTIME!= LC_ALL=C date
-.endif
+
+.if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR)
#
# world
#
@@ -242,16 +248,20 @@ make: .PHONY
# universe
#
# Attempt to rebuild *everything* for all supported architectures,
-# with reasonable chance of success, regardless of how old your
+# with a reasonable chance of success, regardless of how old your
# existing system is.
#
-i386_mach= pc98
-universe:
+universe: universe_prologue
+universe_prologue:
@echo "--------------------------------------------------------------"
@echo ">>> make universe started on ${STARTTIME}"
@echo "--------------------------------------------------------------"
-.for arch in i386 sparc64 alpha ia64 amd64
-.for mach in ${arch} ${${arch}_mach}
+.for target in i386 i386:pc98 sparc64 alpha ia64 amd64
+.for arch in ${target:C/:.*$//}
+.for mach in ${target:C/^.*://}
+universe: universe_${mach}
+.ORDER: universe_prologue universe_${mach} universe_epilogue
+universe_${mach}:
@echo ">> ${mach} started on `LC_ALL=C date`"
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \
TARGET_ARCH=${arch} TARGET=${mach} \
@@ -262,10 +272,13 @@ universe:
-cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \
> ${.CURDIR}/_.${mach}.makeLINT 2>&1
.endif
- cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernels TARGET_ARCH=${arch} TARGET=${mach}
+ cd ${.CURDIR} && ${MAKE} buildkernels TARGET_ARCH=${arch} TARGET=${mach}
@echo ">> ${mach} completed on `LC_ALL=C date`"
.endfor
.endfor
+.endfor
+universe: universe_epilogue
+universe_epilogue:
@echo "--------------------------------------------------------------"
@echo ">>> make universe completed on `LC_ALL=C date`"
@echo " (started ${STARTTIME})"
@@ -274,8 +287,6 @@ universe:
.if make(buildkernels)
KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \
find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES
-.endif
-
buildkernels:
.for kernel in ${KERNCONFS}
-cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \
@@ -283,3 +294,4 @@ buildkernels:
__MAKE_CONF=/dev/null \
> _.${TARGET}.${kernel} 2>&1
.endfor
+.endif