From 865b783eec56bcde5b1f272b4b441a7c6a6c10fa Mon Sep 17 00:00:00 2001 From: jmmv Date: Wed, 11 Dec 2013 03:41:07 +0000 Subject: [PATCH] Make bsd.progs.mk work in directories with SCRIPTS but no PROGS. This change fixes some cases where bsd.progs.mk would fail to handle directories with SCRIPTS but no PROGS. In particular, "install" did not handle such scripts nor dependent files when bsd.subdir.mk was added to the mix. This is "make tinderbox" clean. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) --- share/mk/bsd.progs.mk | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 2f3e9c68af3a..c5e8c3d85adc 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -73,7 +73,7 @@ UPDATE_DEPENDFILE = NO # handle being called [bsd.]progs.mk .include -.ifndef PROG +.ifndef _RECURSING_PROGS # tell progs.mk we might want to install things PROGS_TARGETS+= cleandepend cleandir cleanobj depend install @@ -84,11 +84,13 @@ x.$p= PROG_CXX=$p .endif $p ${p}_p: .PHONY .MAKE - (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p}) + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= PROG=$p ${x.$p}) .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE - (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p} ${@:E}) + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= PROG=$p ${x.$p} ${@:E}) .endfor .endfor @@ -96,4 +98,18 @@ $p.$t: .PHONY .MAKE $t: ${PROGS:%=%.$t} .endfor +SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install + +.for p in ${SCRIPTS} +.for t in ${SCRIPTS_TARGETS:O:u} +$p.$t: .PHONY .MAKE + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= SCRIPT=$p ${x.$p} ${@:E}) +.endfor +.endfor + +.for t in ${SCRIPTS_TARGETS:O:u} +$t: ${SCRIPTS:%=%.$t} +.endfor + .endif