From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 17:55:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 561C13C2; Wed, 24 Jul 2013 17:55:09 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3452B2220; Wed, 24 Jul 2013 17:55:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6OHt9ng062689; Wed, 24 Jul 2013 17:55:09 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6OHt9jt062688; Wed, 24 Jul 2013 17:55:09 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201307241755.r6OHt9jt062688@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 24 Jul 2013 17:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253616 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 17:55:09 -0000 Author: sjg Date: Wed Jul 24 17:55:08 2013 New Revision: 253616 URL: http://svnweb.freebsd.org/changeset/base/253616 Log: Fix bug in universe where if upgrade_checks wants a new make, it gets built 16 times in parallel in the same location. While we are at it, until we finish getting rid of fmake, be explicit about the make we want to use, thus avoid the problem of the temp make being the wrong version. Reviewed by: obrien Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jul 24 16:22:27 2013 (r253615) +++ head/Makefile Wed Jul 24 17:55:08 2013 (r253616) @@ -130,11 +130,34 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ (in make.conf(5)) or command-line variable. .endif -MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} -BINMAKE= \ - `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ + +# We often need to use the tree's version of make to build it. +# Choices add to complexity though. +# We cannot blindly use a make which may not be the one we want +# so be exlicit - until all choice is removed. +.if !defined(WITHOUT_BMAKE) +WANT_MAKE= bmake +.else +WANT_MAKE= fmake +.endif +MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +.if defined(.PARSEDIR) +HAVE_MAKE= bmake +.else +HAVE_MAKE= fmake +.endif +.if exists(${MYMAKE}) +SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk +.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +# It may not exist yet but we may cause it to. +# In the case of fmake, upgrade_checks may cause a newer version to be built. +SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ -m ${.CURDIR}/share/mk -_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.else +SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk +.endif + +_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) @@ -291,11 +314,13 @@ kernel: buildkernel installkernel # Perform a few tests to determine if the installed tools are adequate # for building the world. # +# Note: if we ever need to care about the version of bmake, simply testing +# MAKE_VERSION against a required version should suffice. +# upgrade_checks: -.if !defined(.PARSEDIR) -.if !defined(WITHOUT_BMAKE) - (cd ${.CURDIR} && ${MAKE} bmake) -.else +.if ${HAVE_MAKE} != ${WANT_MAKE} + @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) +.elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ @@ -303,14 +328,13 @@ upgrade_checks: (cd ${.CURDIR} && ${MAKE} make); \ fi .endif -.endif # # Upgrade make(1) to the current version using the installed # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ +MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ @@ -327,7 +351,7 @@ make bmake: .PHONY ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T} tinderbox: @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe @@ -377,7 +401,8 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue upgrade_checks +universe_prologue: upgrade_checks +universe: universe_prologue universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -387,9 +412,9 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue +universe_epilogue: universe_${target} universe_${target}: universe_${target}_prologue -universe_${target}_prologue: +universe_${target}_prologue: universe_prologue @echo ">> ${target} started on `LC_ALL=C date`" .if !defined(MAKE_JUST_KERNELS) .for target_arch in ${TARGET_ARCHES_${target}} @@ -397,7 +422,7 @@ universe_${target}: universe_${target}_$ universe_${target}_${target_arch}: universe_${target}_prologue @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ + ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ TARGET=${target} \ TARGET_ARCH=${target_arch} \ > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ @@ -418,11 +443,11 @@ universe_${target}: universe_${target}_k universe_${target}_kernels: universe_${target}_prologue .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ + ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif - @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ + @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif @echo ">> ${target} completed on `LC_ALL=C date`" @@ -445,7 +470,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR} universe_kernconfs: universe_kernconf_${TARGET}_${kernel} universe_kernconf_${TARGET}_${kernel}: @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} buildkernel \ + ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ TARGET_ARCH=${TARGET_ARCH_${kernel}} \ KERNCONF=${kernel} \