From 621e4ae168ef6121b27ffd1641ec114707c0c88d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 6 Jun 2006 16:24:54 +0000 Subject: [PATCH] Create a new target 'buildenvvars'. This target reports the build environment for cross building (the same one you'd get interactively in make buildenv). This cannot be a simple make -f Makefile.inc1 -V WMAKEENV because in PATH is not set correctly unless one takes a trip through the Makefile/Makefile.inc1 indirection, the logic of which is too large to reproduce outside of Makefiles. --- Makefile | 6 +++--- Makefile.inc1 | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 49c702a6db83..bc1f0cb82ef6 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,9 @@ # developer convenience only. They are intentionally not documented and # completely subject to change without notice. # -TGTS= all all-man buildenv buildkernel buildworld check-old checkdpadd \ - clean cleandepend cleandir delete-old delete-old-libs depend \ - distribute distributeworld distrib-dirs distribution doxygen \ +TGTS= all all-man buildenv buildenvvars buildkernel buildworld check-old \ + checkdpadd clean cleandepend cleandir delete-old delete-old-libs \ + depend distribute distributeworld distrib-dirs distribution doxygen \ everything hierarchy install installcheck installkernel \ installkernel.debug reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ diff --git a/Makefile.inc1 b/Makefile.inc1 index 6e5bb1e6dff6..8619eb752781 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -468,6 +468,15 @@ WMAKE_TGTS+= build32 buildworld: ${WMAKE_TGTS} .ORDER: ${WMAKE_TGTS} + +# +# We need to have this as a target because the indirection between Makefile +# and Makefile.inc1 causes the correct PATH to be used, rather than a +# modification of the current environment's PATH. +# +buildenvvars: + @echo ${WMAKEENV} + buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} @cd ${.CURDIR} && env ${WMAKEENV} sh || true