diff --git a/Makefile.inc1 b/Makefile.inc1 index 35275fc676a2..2ec25d0d8b82 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -299,7 +299,7 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4: populating ${WORLDTMP}/usr/include" @echo "--------------------------------------------------------------" - cd ${.CURDIR}; ${WMAKE} includes; ${WMAKE} SHARED=symlinks incsinstall + cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes _libraries: @echo @echo "--------------------------------------------------------------" @@ -749,7 +749,7 @@ _startup_libs: ${_startup_libs:S/$/__L/} _prebuild_libs: ${_prebuild_libs:S/$/__L/} _generic_libs: ${_generic_libs:S/$/__L/} -.for __target in clean cleandepend cleandir depend obj +.for __target in clean cleandepend cleandir depend includes obj .for entry in ${SUBDIR} ${entry}.${__target}__D: .PHONY @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ diff --git a/include/Makefile b/include/Makefile index 3dc44dec65df..234cbd807d13 100644 --- a/include/Makefile +++ b/include/Makefile @@ -116,6 +116,6 @@ symlinks: rm -rf ${DESTDIR}/usr/include/machine ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine -_incsinstall: ${SHARED} - .include + +installincludes: ${SHARED} diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index c61959045794..57a2886f93a5 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -6,23 +6,18 @@ INCSGROUPS?= INCS -.if !target(includes) +.if !target(buildincludes) .for group in ${INCSGROUPS} -includes: ${${group}} +buildincludes: ${${group}} .endfor .endif -_incsinstall: .USE - -.if !target(incsinstall) -incsinstall: _incsinstall -.endif +all: buildincludes +.if !target(installincludes) .for group in ${INCSGROUPS} .if defined(${group}) && !empty(${group}) -all: ${${group}} - ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} @@ -42,7 +37,7 @@ ${group}NAME_${header:T}?= ${${group}NAME} .else ${group}NAME_${header:T}?= ${header:T} .endif -_incsinstall: _${group}INS_${header:T} +installincludes: _${group}INS_${header:T} _${group}INS_${header:T}: ${header} ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ @@ -53,7 +48,7 @@ _${group}INCS+= ${header} .endif .endfor .if !empty(_${group}INCS) -_incsinstall: _${group}INS +installincludes: _${group}INS _${group}INS: ${_${group}INCS} .if defined(${group}NAME) ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ @@ -68,7 +63,7 @@ _${group}INS: ${_${group}INCS} .endfor .if defined(INCSLINKS) && !empty(INCSLINKS) -_incsinstall: +installincludes: @set ${INCSLINKS}; \ while test $$# -ge 2; do \ l=$$1; \ @@ -79,3 +74,6 @@ _incsinstall: ln -fs $$l $$t; \ done; true .endif +.endif !target(installincludes) + +realinstall: installincludes diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index b3069169e356..c16f4b80bb64 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -339,7 +339,7 @@ realinstall: done; true .endif -realinstall: _incsinstall +.include .if !defined(NOMAN) realinstall: _maninstall @@ -352,8 +352,6 @@ lint: ${SRCS:M*.c} ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} .endif -.include - .if !defined(NOMAN) .include .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 83f57a569dee..6ecbf5062f07 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -196,7 +196,7 @@ _FILESINS_${file:T}: ${file} .endfor .endif -realinstall: _incsinstall +.include .if !defined(NOMAN) realinstall: _maninstall @@ -225,8 +225,6 @@ tags: ${SRCS} .endif .endif -.include - .if !defined(NOMAN) .include .endif diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 9a6d4664a40f..20a38d7292a8 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -58,11 +58,22 @@ ${SUBDIR}:: .for __target in all all-man checkdpadd clean cleandepend cleandir \ - depend distribute includes incsinstall lint maninstall \ + depend distribute lint maninstall \ obj objlink realinstall regress tags ${__target}: _SUBDIR .endfor +.for __target in includes +.for __stage in build install +${__stage}${__target}: +.if make(${__stage}${__target}) +${__stage}${__target}: _SUBDIR +.endif +.endfor +${__target}: + cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} +.endfor + .if !target(install) .if !target(beforeinstall) beforeinstall: