diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2015-11-05 22:28:31 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2015-11-05 22:28:31 +0000 |
commit | 777135d213c6c04775e5e65933efd3b8b8820c34 (patch) | |
tree | ff50d2c74bc4f5963b7325b9917acf913f6761f0 | |
parent | f85ce54a015b0eb2e4b4be6460d30ab9fc356030 (diff) | |
download | FreeBSD-src-777135d213c6c04775e5e65933efd3b8b8820c34.zip FreeBSD-src-777135d213c6c04775e5e65933efd3b8b8820c34.tar.gz |
Allow 'make buildenv' to work anywhere in the src tree.
Sponsored by: EMC / Isilon Storage Division
-rw-r--r-- | Makefile.inc1 | 8 | ||||
-rw-r--r-- | share/mk/local.init.mk | 2 | ||||
-rw-r--r-- | share/mk/src.init.mk | 11 |
3 files changed, 18 insertions, 3 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 3c5ff93..48fef50 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -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} diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index 85303c3..a30ed0e 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -38,3 +38,5 @@ CPP= ${HOST_CPP} HOST_CFLAGS+= -DHOSTPROG CFLAGS+= ${HOST_CFLAGS} .endif + +.-include "src.init.mk" diff --git a/share/mk/src.init.mk b/share/mk/src.init.mk new file mode 100644 index 0000000..437489e --- /dev/null +++ b/share/mk/src.init.mk @@ -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>__) |