svn commit: r291634 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Wed Dec 2 01:49:24 UTC 2015


Author: bdrewery
Date: Wed Dec  2 01:49:22 2015
New Revision: 291634
URL: https://svnweb.freebsd.org/changeset/base/291634

Log:
  Revert r291633. Some files were missed.

Modified:
  head/share/mk/bsd.subdir.mk

Modified: head/share/mk/bsd.subdir.mk
==============================================================================
--- head/share/mk/bsd.subdir.mk	Wed Dec  2 01:47:27 2015	(r291633)
+++ head/share/mk/bsd.subdir.mk	Wed Dec  2 01:49:22 2015	(r291634)
@@ -36,11 +36,10 @@
 .if !target(__<bsd.subdir.mk>__)
 __<bsd.subdir.mk>__:
 
-ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \
-		    checkdpadd clean cleandepend cleandir cleanilinks \
-		    cleanobj depend distribute files includes installconfig \
-		    installfiles installincludes install lint maninstall \
-		    manlint obj objlink regress tags \
+ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \
+		    cleandir cleanilinks cleanobj depend distribute \
+		    installconfig lint maninstall manlint obj objlink \
+		    realinstall regress tags \
 		    ${SUBDIR_TARGETS}
 
 # Described above.
@@ -72,27 +71,6 @@ distribute: .MAKE
 .endfor
 .endif
 
-# Convenience targets to run 'build${target}' and 'install${target}' when
-# calling 'make ${target}'.
-.for __target in files includes
-.if !target(${__target})
-${__target}:	build${__target} install${__target}
-.ORDER:		build${__target} install${__target}
-.endif
-.endfor
-
-# Make 'install' supports a before and after target.  Actual install
-# hooks are placed in 'realinstall'.
-.if !target(install)
-.for __stage in before real after
-.if !target(${__stage}install)
-${__stage}install:
-.endif
-.endfor
-install:	beforeinstall realinstall afterinstall
-.ORDER:		beforeinstall realinstall afterinstall
-.endif
-
 # Subdir code shared among 'make <subdir>', 'make <target>' and SUBDIR_PARALLEL.
 _SUBDIR_SH=	\
 		if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \
@@ -104,7 +82,7 @@ _SUBDIR_SH=	\
 
 _SUBDIR: .USEBEFORE
 .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR)
-	@${_+_}target=${.TARGET}; \
+	@${_+_}target=${.TARGET:S,realinstall,install,}; \
 	    for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done
 .endif
 
@@ -123,10 +101,6 @@ SUBDIR:=	${SUBDIR:N.WAIT}
 .else
 _is_standalone_target=	0
 .endif
-# Only recurse on directly-called targets.  I.e., don't recurse on dependencies
-# such as 'install' becoming {before,real,after}install, just recurse
-# 'install'.
-.if make(${__target})
 .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1
 __subdir_targets=
 .for __dir in ${SUBDIR}
@@ -142,7 +116,7 @@ __deps+= ${__target}_subdir_${__dep}
 .endif
 ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps}
 .if !defined(NO_SUBDIR)
-	@${_+_}target=${__target}; \
+	@${_+_}target=${__target:realinstall=install}; \
 	    dir=${__dir}; \
 	    ${_SUBDIR_SH};
 .endif
@@ -152,11 +126,35 @@ ${__target}: ${__subdir_targets}
 .else
 ${__target}: _SUBDIR
 .endif	# SUBDIR_PARALLEL || _is_standalone_target
-.elif !target(${__target})
-${__target}:
-.endif	# make(${__target})
 .endfor	# __target in ${ALL_SUBDIR_TARGETS}
 
-.endif	# !target(_SUBDIR)
+# This is to support 'make includes' calling 'make buildincludes' and
+# 'make installincludes' in the proper order, and to support these
+# targets as SUBDIR_TARGETS.
+.for __target in files includes
+.for __stage in build install
+${__stage}${__target}:
+.if make(${__stage}${__target})
+${__stage}${__target}: _SUBDIR
+.endif
+.endfor
+.if !target(${__target})
+${__target}: .MAKE
+	${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
+.endif
+.endfor
+
+.endif
+
+.if !target(install)
+.if !target(beforeinstall)
+beforeinstall:
+.endif
+.if !target(afterinstall)
+afterinstall:
+.endif
+install: beforeinstall realinstall afterinstall
+.ORDER: beforeinstall realinstall afterinstall
+.endif
 
 .endif


More information about the svn-src-head mailing list