Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2015 19:13:36 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r289051 - stable/10/share/mk
Message-ID:  <201510081913.t98JDaCj073743@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Oct  8 19:13:36 2015
New Revision: 289051
URL: https://svnweb.freebsd.org/changeset/base/289051

Log:
  MFC r288158:
  
    Fix most cases of bsd.progs.mk running duplicate or missing commands.

Modified:
  stable/10/share/mk/bsd.prog.mk
  stable/10/share/mk/bsd.progs.mk
  stable/10/share/mk/bsd.test.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.prog.mk
==============================================================================
--- stable/10/share/mk/bsd.prog.mk	Thu Oct  8 19:10:51 2015	(r289050)
+++ stable/10/share/mk/bsd.prog.mk	Thu Oct  8 19:13:36 2015	(r289051)
@@ -252,7 +252,7 @@ realinstall: _maninstall
 .ORDER: beforeinstall _maninstall
 .endif
 
-.endif
+.endif	# !target(install)
 
 .if !target(lint)
 lint: ${SRCS:M*.c}

Modified: stable/10/share/mk/bsd.progs.mk
==============================================================================
--- stable/10/share/mk/bsd.progs.mk	Thu Oct  8 19:10:51 2015	(r289050)
+++ stable/10/share/mk/bsd.progs.mk	Thu Oct  8 19:13:36 2015	(r289051)
@@ -66,25 +66,27 @@ UPDATE_DEPENDFILE ?= NO
 DEPENDFILE?= .depend.${PROG}
 # prog.mk will do the rest
 .else
-all: ${FILES} ${PROGS} ${SCRIPTS}
+all: ${PROGS}
 
 # We cannot capture dependencies for meta mode here
 UPDATE_DEPENDFILE = NO
 # nor can we safely run in parallel.
 .NOTPARALLEL:
 .endif
-.endif
+.endif	# PROGS || PROGS_CXX
 
-# The non-recursive call to bsd.progs.mk will handle FILES; NUL out
-# FILESGROUPS so recursive calls don't duplicate the work
+# These are handled by the main make process.
 .ifdef _RECURSING_PROGS
-FILESGROUPS=
+_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS
+.for v in ${_PROGS_GLOBAL_VARS}
+$v =
+.endfor
 .endif
 
 # handle being called [bsd.]progs.mk
 .include <bsd.prog.mk>
 
-.ifndef _RECURSING_PROGS
+.if !empty(PROGS) && !defined(_RECURSING_PROGS)
 # tell progs.mk we might want to install things
 PROGS_TARGETS+= checkdpadd clean cleandepend cleandir cleanobj depend install
 
@@ -94,12 +96,14 @@ PROGS_TARGETS+= checkdpadd clean cleande
 x.$p= PROG_CXX=$p
 .endif
 
+# Main PROG target
 $p ${p}_p: .PHONY .MAKE
 	(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
 	    SUBDIR= PROG=$p \
 	    DEPENDFILE=.depend.$p .MAKE.DEPENDFILE=.depend.$p \
 	    ${x.$p})
 
+# Pseudo targets for PROG, such as 'install'.
 .for t in ${PROGS_TARGETS:O:u}
 $p.$t: .PHONY .MAKE
 	(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
@@ -109,21 +113,8 @@ $p.$t: .PHONY .MAKE
 .endfor
 .endfor
 
-.if !empty(PROGS)
+# Depend main pseudo targets on all PROG.pseudo targets too.
 .for t in ${PROGS_TARGETS:O:u}
 $t: ${PROGS:%=%.$t}
 .endfor
 .endif
-
-.if empty(PROGS) && !empty(SCRIPTS)
-
-.for t in ${PROGS_TARGETS:O:u}
-scripts.$t: .PHONY .MAKE
-	(cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} SUBDIR= _RECURSING_PROGS= \
-	    $t)
-$t: scripts.$t
-.endfor
-
-.endif
-
-.endif

Modified: stable/10/share/mk/bsd.test.mk
==============================================================================
--- stable/10/share/mk/bsd.test.mk	Thu Oct  8 19:10:51 2015	(r289050)
+++ stable/10/share/mk/bsd.test.mk	Thu Oct  8 19:13:36 2015	(r289051)
@@ -99,10 +99,6 @@ test: beforetest realtest
 test: aftertest
 .endif
 
-.if !empty(SUBDIR)
-.include <bsd.subdir.mk>
-.endif
-
 .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS)
 .include <bsd.progs.mk>
 .endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510081913.t98JDaCj073743>