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.
This commit is contained in:
Warner Losh 2006-06-06 16:24:54 +00:00
parent 5f467a3bb6
commit 621e4ae168
2 changed files with 12 additions and 3 deletions

View File

@ -68,9 +68,9 @@
# developer convenience only. They are intentionally not documented and # developer convenience only. They are intentionally not documented and
# completely subject to change without notice. # completely subject to change without notice.
# #
TGTS= all all-man buildenv buildkernel buildworld check-old checkdpadd \ TGTS= all all-man buildenv buildenvvars buildkernel buildworld check-old \
clean cleandepend cleandir delete-old delete-old-libs depend \ checkdpadd clean cleandepend cleandir delete-old delete-old-libs \
distribute distributeworld distrib-dirs distribution doxygen \ depend distribute distributeworld distrib-dirs distribution doxygen \
everything hierarchy install installcheck installkernel \ everything hierarchy install installcheck installkernel \
installkernel.debug reinstallkernel reinstallkernel.debug \ installkernel.debug reinstallkernel reinstallkernel.debug \
installworld kernel-toolchain libraries lint maninstall \ installworld kernel-toolchain libraries lint maninstall \

View File

@ -468,6 +468,15 @@ WMAKE_TGTS+= build32
buildworld: ${WMAKE_TGTS} buildworld: ${WMAKE_TGTS}
.ORDER: ${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: buildenv:
@echo Entering world for ${TARGET_ARCH}:${TARGET} @echo Entering world for ${TARGET_ARCH}:${TARGET}
@cd ${.CURDIR} && env ${WMAKEENV} sh || true @cd ${.CURDIR} && env ${WMAKEENV} sh || true