Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2015 22:28:31 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r290424 - in head: . share/mk
Message-ID:  <201511052228.tA5MSVCn054022@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Nov  5 22:28:31 2015
New Revision: 290424
URL: https://svnweb.freebsd.org/changeset/base/290424

Log:
  Allow 'make buildenv' to work anywhere in the src tree.
  
  Sponsored by:	EMC / Isilon Storage Division

Added:
  head/share/mk/src.init.mk   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/share/mk/local.init.mk

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Thu Nov  5 22:09:00 2015	(r290423)
+++ head/Makefile.inc1	Thu Nov  5 22:28:31 2015	(r290424)
@@ -773,7 +773,7 @@ buildworld_epilogue:
 # modification of the current environment's PATH.  In addition, we need
 # to quote multiword values.
 #
-buildenvvars:
+buildenvvars: .PHONY
 	@echo ${WMAKEENV:Q} ${.MAKE.EXPORTED:@v@$v=\"${$v}\"@}
 
 .if ${.TARGETS:Mbuildenv}
@@ -781,9 +781,11 @@ buildenvvars:
 .error The buildenv target is incompatible with -j
 .endif
 .endif
-buildenv:
+BUILDENV_DIR?=	${.CURDIR}
+buildenv: .PHONY
 	@echo Entering world for ${TARGET_ARCH}:${TARGET}
-	@cd ${.CURDIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} || true
+	@cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \
+	    || true
 
 TOOLCHAIN_TGTS=	${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
 toolchain: ${TOOLCHAIN_TGTS}

Modified: head/share/mk/local.init.mk
==============================================================================
--- head/share/mk/local.init.mk	Thu Nov  5 22:09:00 2015	(r290423)
+++ head/share/mk/local.init.mk	Thu Nov  5 22:28:31 2015	(r290424)
@@ -38,3 +38,5 @@ CPP=		${HOST_CPP}
 HOST_CFLAGS+= -DHOSTPROG
 CFLAGS+= ${HOST_CFLAGS}
 .endif
+
+.-include "src.init.mk"

Added: head/share/mk/src.init.mk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/mk/src.init.mk	Thu Nov  5 22:28:31 2015	(r290424)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.if !target(__<src.init.mk>__)
+__<src.init.mk>__:
+
+.if !target(buildenv)
+buildenv: .PHONY
+	@env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv
+.endif
+
+.endif	# !target(__<src.init.mk>__)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511052228.tA5MSVCn054022>