Make make recurse into sub-directories and sub-makes when given

two -n flags.  If only one -n flag is given the old behaviour
is retained (POLA).  In order to make this working for installworld
change the IMAKEENV in this case so that the tools are found
(we have no temporary installation environment in this case).

Submitted by:	ru (IMAKEENV part)
This commit is contained in:
Hartmut Brandt 2004-08-09 11:38:41 +00:00
parent 95798370a1
commit 088cf0fb43
2 changed files with 34 additions and 29 deletions

View File

@ -126,7 +126,7 @@ cleanworld:
rm -rf ${BW_CANONICALOBJDIR}/* rm -rf ${BW_CANONICALOBJDIR}/*
.endif .endif
# To be safe in this case, fall back to a 'make cleandir' # To be safe in this case, fall back to a 'make cleandir'
@cd ${.CURDIR}; ${_MAKE} cleandir ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir
.else .else
-rm -rf ${.OBJDIR}/* -rm -rf ${.OBJDIR}/*
chflags -R 0 ${.OBJDIR} chflags -R 0 ${.OBJDIR}
@ -138,7 +138,7 @@ cleanworld:
# #
${TGTS}: ${TGTS}:
@cd ${.CURDIR}; \ ${_+_}@cd ${.CURDIR}; \
${_MAKE} ${.TARGET} ${_MAKE} ${.TARGET}
# Set a reasonable default # Set a reasonable default
@ -165,16 +165,16 @@ world: upgrade_checks
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Making 'pre-world' target" @echo ">>> Making 'pre-world' target"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@cd ${.CURDIR}; ${_MAKE} pre-world ${_+_}@cd ${.CURDIR}; ${_MAKE} pre-world
.endif .endif
@cd ${.CURDIR}; ${_MAKE} buildworld ${_+_}@cd ${.CURDIR}; ${_MAKE} buildworld
@cd ${.CURDIR}; ${_MAKE} -B installworld ${_+_}@cd ${.CURDIR}; ${_MAKE} -B installworld
.if target(post-world) .if target(post-world)
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Making 'post-world' target" @echo ">>> Making 'post-world' target"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@cd ${.CURDIR}; ${_MAKE} post-world ${_+_}@cd ${.CURDIR}; ${_MAKE} post-world
.endif .endif
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@ -232,7 +232,7 @@ make: .PHONY
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Building an up-to-date make(1)" @echo ">>> Building an up-to-date make(1)"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@cd ${.CURDIR}/usr.bin/make; \ ${_+_}@cd ${.CURDIR}/usr.bin/make; \
${MMAKE} obj && \ ${MMAKE} obj && \
${MMAKE} depend && \ ${MMAKE} depend && \
${MMAKE} all && \ ${MMAKE} all && \

View File

@ -204,8 +204,13 @@ WMAKEENV= ${CROSSENV} \
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
# install stage # install stage
.if empty(.MAKEFLAGS:M-n)
IMAKEENV= ${CROSSENV} \ IMAKEENV= ${CROSSENV} \
PATH=${STRICTTMPPATH}:${INSTALLTMP} PATH=${STRICTTMPPATH}:${INSTALLTMP}
.else
IMAKEENV= ${CROSSENV} \
PATH=${TMPPATH}:${INSTALLTMP}
.endif
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
# kernel stage # kernel stage
@ -272,51 +277,51 @@ _legacy:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 1.1: legacy release compatibility shims" @echo ">>> stage 1.1: legacy release compatibility shims"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${BMAKE} legacy ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
_bootstrap-tools: _bootstrap-tools:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 1.2: bootstrap tools" @echo ">>> stage 1.2: bootstrap tools"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${BMAKE} bootstrap-tools ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
_cleanobj: _cleanobj:
.if !defined(NOCLEAN) .if !defined(NOCLEAN)
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 2.1: cleaning up the object tree" @echo ">>> stage 2.1: cleaning up the object tree"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
.endif .endif
_obj: _obj:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 2.2: rebuilding the object tree" @echo ">>> stage 2.2: rebuilding the object tree"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} par-obj ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
_build-tools: _build-tools:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools" @echo ">>> stage 2.3: build tools"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${TMAKE} build-tools ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
_cross-tools: _cross-tools:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 3: cross tools" @echo ">>> stage 3: cross tools"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${XMAKE} cross-tools ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
_includes: _includes:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 4.1: building includes" @echo ">>> stage 4.1: building includes"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
_libraries: _libraries:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 4.2: building libraries" @echo ">>> stage 4.2: building libraries"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; \ ${_+_}cd ${.CURDIR}; \
${WMAKE} -DNOFSCHG -DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPROFILE \ ${WMAKE} -DNOFSCHG -DNOHTML -DNOINFO -DNOLINT -DNOMAN -DNOPROFILE \
libraries libraries
_depend: _depend:
@ -324,13 +329,13 @@ _depend:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 4.3: make dependencies" @echo ">>> stage 4.3: make dependencies"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} par-depend ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
everything: everything:
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> stage 4.4: building everything" @echo ">>> stage 4.4: building everything"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${WMAKE} par-all ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
WMAKE_TGTS= WMAKE_TGTS=
@ -452,7 +457,7 @@ distributeworld installworld: installcheck
test true uname wc zic; do \ test true uname wc zic; do \
cp `which $$prog` ${INSTALLTMP}; \ cp `which $$prog` ${INSTALLTMP}; \
done done
cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
rm -rf ${INSTALLTMP} rm -rf ${INSTALLTMP}
# #
@ -466,18 +471,18 @@ reinstall: ${SPECIAL_INSTALLCHECKS}
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Making hierarchy" @echo ">>> Making hierarchy"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Installing everything" @echo ">>> Installing everything"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
redistribute: redistribute:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> Distributing everything" @echo ">>> Distributing everything"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
# #
# buildkernel and installkernel # buildkernel and installkernel
@ -672,7 +677,7 @@ update:
# #
legacy: legacy:
.for _tool in tools/build .for _tool in tools/build
@${ECHODIR} "===> ${_tool}"; \ ${_+_}@${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
@ -747,7 +752,7 @@ bootstrap-tools:
${_crunchgen} \ ${_crunchgen} \
${_gensnmptree} \ ${_gensnmptree} \
${_kbdcontrol} ${_kbdcontrol}
@${ECHODIR} "===> ${_tool}"; \ ${_+_}@${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ depend; \
@ -786,14 +791,14 @@ build-tools:
usr.bin/awk \ usr.bin/awk \
lib/libmagic \ lib/libmagic \
usr.sbin/sysinstall usr.sbin/sysinstall
@${ECHODIR} "===> ${_tool}"; \ ${_+_}@${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ build-tools ${MAKE} DIRPRFX=${_tool}/ build-tools
.endfor .endfor
.for _tool in \ .for _tool in \
${_kerberos5_tools} ${_kerberos5_tools}
@${ECHODIR} "===> ${_tool}"; \ ${_+_}@${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ depend; \
@ -837,7 +842,7 @@ cross-tools:
${_crunchide} \ ${_crunchide} \
${_elf2exe} \ ${_elf2exe} \
${_kgzip} ${_kgzip}
@${ECHODIR} "===> ${_tool}"; \ ${_+_}@${ECHODIR} "===> ${_tool}"; \
cd ${.CURDIR}/${_tool}; \ cd ${.CURDIR}/${_tool}; \
${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ depend; \
@ -930,7 +935,7 @@ _generic_libs+= usr.sbin/pcvt/keycap
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
${_lib}__L: .PHONY ${_lib}__L: .PHONY
.if exists(${.CURDIR}/${_lib}) .if exists(${.CURDIR}/${_lib})
@${ECHODIR} "===> ${_lib}"; \ ${_+_}@${ECHODIR} "===> ${_lib}"; \
cd ${.CURDIR}/${_lib}; \ cd ${.CURDIR}/${_lib}; \
${MAKE} DIRPRFX=${_lib}/ depend; \ ${MAKE} DIRPRFX=${_lib}/ depend; \
${MAKE} DIRPRFX=${_lib}/ all; \ ${MAKE} DIRPRFX=${_lib}/ all; \
@ -942,7 +947,7 @@ ${_lib}__L: .PHONY
# static PAM library, and dynamic PAM library before dynamic PAM # static PAM library, and dynamic PAM library before dynamic PAM
# modules. # modules.
lib/libpam__L: .PHONY lib/libpam__L: .PHONY
@${ECHODIR} "===> lib/libpam"; \ ${_+_}@${ECHODIR} "===> lib/libpam"; \
cd ${.CURDIR}/lib/libpam; \ cd ${.CURDIR}/lib/libpam; \
${MAKE} DIRPRFX=lib/libpam/ depend; \ ${MAKE} DIRPRFX=lib/libpam/ depend; \
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
@ -955,7 +960,7 @@ _generic_libs: ${_generic_libs:S/$/__L/}
.for __target in all clean cleandepend cleandir depend includes obj .for __target in all clean cleandepend cleandir depend includes obj
.for entry in ${SUBDIR} .for entry in ${SUBDIR}
${entry}.${__target}__D: .PHONY ${entry}.${__target}__D: .PHONY
@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \ ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
edir=${entry}.${MACHINE_ARCH}; \ edir=${entry}.${MACHINE_ARCH}; \
cd ${.CURDIR}/$${edir}; \ cd ${.CURDIR}/$${edir}; \