diff --git a/include/Makefile b/include/Makefile index 8b896bad8999..274dd2c4591f 100644 --- a/include/Makefile +++ b/include/Makefile @@ -121,7 +121,7 @@ _MARCHS+= x86 .if ${MK_STAGING} != "no" # tell bsd.incs.mk that we have it covered -stage_includes: +NO_STAGE_INCLUDES= .endif .include @@ -371,3 +371,12 @@ symlinks: .if ${MK_META_MODE} == "yes" touch ${.TARGET} .endif + +.if ${MACHINE} == "host" +# we're here because we are building a sysroot... +# we need MACHINE et al set correctly +HOST_MACHINE!= uname -m +HOST_MACHINE_ARCH!= uname -p +MACHINE:= ${HOST_MACHINE} +MACHINE_ARCH:= ${HOST_MACHINE_ARCH} +.endif diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index ee4305a73816..08ef376b5d7e 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -45,6 +45,7 @@ ${group}NAME_${header:T}?= ${header:T} STAGE_AS_SETS+= ${group} STAGE_AS_${header:T}= ${${group}NAME_${header:T}} stage_as.${group}: ${header} +stage_includes: stage_as.${group} installincludes: _${group}INS_${header:T} _${group}INS_${header:T}: ${header} @@ -58,6 +59,7 @@ _${group}INCS+= ${header} .endfor .if !empty(_${group}INCS) stage_files.${group}: ${_${group}INCS} +stage_includes: stage_files.${group} installincludes: _${group}INS _${group}INS: ${_${group}INCS} @@ -91,13 +93,8 @@ realinstall: installincludes .ORDER: beforeinstall installincludes .if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) -.if !target(stage_includes) -.if !empty(STAGE_SETS) -buildincludes: stage_files -.if !empty(STAGE_AS_SETS) -buildincludes: stage_as -.endif -.endif +.if !defined(NO_STAGE_INCLUDES) +staging: stage_includes .if !empty(INCSLINKS) staging: stage_symlinks STAGE_SYMLINKS.INCS= ${INCSLINKS} diff --git a/share/mk/meta.stage.mk b/share/mk/meta.stage.mk index 63cef7f656ad..1c9475963908 100644 --- a/share/mk/meta.stage.mk +++ b/share/mk/meta.stage.mk @@ -123,6 +123,7 @@ _STAGE_BASENAME_USE: .USE ${.TARGET:T} STAGE_TARGETS += stage_incs STAGE_INCS ?= ${.ALLSRC:N.dirdep} +stage_includes: stage_incs stage_incs: .dirdep @${STAGE_FILE_SCRIPT}; StageFiles ${STAGE_INCSDIR:${STAGE_DIR_FILTER}} ${STAGE_INCS} @touch $@ @@ -220,7 +221,7 @@ stage_as.$s: .dirdep .endfor .endif -CLEANFILES += ${STAGE_TARGETS} +CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes # stage_*links usually needs to follow any others. .for t in ${STAGE_TARGETS:N*links:O:u}