[Midnightbsd-cvs] src [10265] trunk/share/mk/bsd.subdir.mk: update subdir
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jun 2 18:06:51 EDT 2018
Revision: 10265
http://svnweb.midnightbsd.org/src/?rev=10265
Author: laffer1
Date: 2018-06-02 18:06:51 -0400 (Sat, 02 Jun 2018)
Log Message:
-----------
update subdir
Modified Paths:
--------------
trunk/share/mk/bsd.subdir.mk
Modified: trunk/share/mk/bsd.subdir.mk
===================================================================
--- trunk/share/mk/bsd.subdir.mk 2018-06-02 22:06:02 UTC (rev 10264)
+++ trunk/share/mk/bsd.subdir.mk 2018-06-02 22:06:51 UTC (rev 10265)
@@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
-# $FreeBSD: src/share/mk/bsd.subdir.mk,v 1.50 2005/05/31 07:14:51 ru Exp $
+# $FreeBSD: stable/10/share/mk/bsd.subdir.mk 313790 2017-02-16 05:14:07Z ngie $
# $MidnightBSD$
#
# The include file <bsd.subdir.mk> contains the default targets
@@ -25,9 +25,9 @@
# This is a variant of install, which will
# put the stuff into the right "distribution".
#
-# afterinstall, all, all-man, beforeinstall, checkdpadd, clean,
-# cleandepend, cleandir, cleanilinks, depend, install, lint,
-# maninstall, manlint, obj, objlink, realinstall, regress, tags
+# afterinstall, all, all-man, beforeinstall, check, checkdpadd, clean,
+# cleandepend, cleandir, cleanilinks depend, install, lint,
+# maninstall, manlint, obj, objlink, realinstall, tags
#
.if !target(__<bsd.subdir.mk>__)
@@ -46,22 +46,22 @@
_SUBDIR: .USE .MAKE
.if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR)
- @${_+_}set -e; for entry in ${SUBDIR}; do \
+ @${_+_}for entry in ${SUBDIR:N.WAIT}; do \
if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
- ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \
+ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \
edir=$${entry}.${MACHINE_ARCH}; \
cd ${.CURDIR}/$${edir}; \
else \
- ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:realinstall=install})"; \
+ ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \
edir=$${entry}; \
cd ${.CURDIR}/$${edir}; \
fi; \
- ${MAKE} ${.TARGET:realinstall=install} \
+ ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \
DIRPRFX=${DIRPRFX}$$edir/; \
done
.endif
-${SUBDIR}: .PHONY .MAKE
+${SUBDIR:N.WAIT}: .PHONY .MAKE
${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \
cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \
else \
@@ -69,15 +69,25 @@
fi; \
${MAKE} all
-.for __target in all all-man checkdpadd clean cleandepend cleandir \
+# Work around parsing of .if nested in .for by putting .WAIT string into a var.
+__wait= .WAIT
+.for __target in all all-man check checkdpadd clean cleandepend cleandir \
cleanilinks depend distribute lint maninstall manlint obj objlink \
- realinstall regress tags ${SUBDIR_TARGETS}
+ realinstall tags ${SUBDIR_TARGETS}
.ifdef SUBDIR_PARALLEL
+__subdir_targets=
.for __dir in ${SUBDIR}
-${__target}: ${__target}_subdir_${__dir}
-${__target}_subdir_${__dir}: .MAKE
- @${_+_}set -e; \
- if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
+.if ${__wait} == ${__dir}
+__subdir_targets+= .WAIT
+.else
+__subdir_targets+= ${__target}_subdir_${__dir}
+__deps=
+.for __dep in ${SUBDIR_DEPEND_${__dir}}
+__deps+= ${__target}_subdir_${__dep}
+.endfor
+${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps}
+.if !defined(NO_SUBDIR)
+ @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \
edir=${__dir}.${MACHINE_ARCH}; \
cd ${.CURDIR}/$${edir}; \
@@ -88,9 +98,13 @@
fi; \
${MAKE} ${__target:realinstall=install} \
DIRPRFX=${DIRPRFX}$$edir/
+.endif
+.endif
.endfor
+${__target}: ${__subdir_targets}
.else
-${__target}: _SUBDIR
+${__target}: _sub.${__target}
+_sub.${__target}: _SUBDIR
.endif
.endfor
@@ -98,11 +112,14 @@
.for __stage in build install
${__stage}${__target}:
.if make(${__stage}${__target})
-${__stage}${__target}: _SUBDIR
+${__stage}${__target}: _sub.${__stage}${__target}
+_sub.${__stage}${__target}: _SUBDIR
.endif
.endfor
+.if !target(${__target})
${__target}: .MAKE
- ${_+_}set -e; cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
+ ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
+.endif
.endfor
.if !target(install)
More information about the Midnightbsd-cvs
mailing list