Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 2019 19:05:01 +0000 (UTC)
From:      "Simon J. Gerraty" <sjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351954 - head/share/mk
Message-ID:  <201909061905.x86J51Qk049476@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sjg
Date: Fri Sep  6 19:05:01 2019
New Revision: 351954
URL: https://svnweb.freebsd.org/changeset/base/351954

Log:
  Use file destdir for stage_as sets
  
  We cannot use file (without :T) to name targets
  but we can use the destination directory (with / replaced by _)
  This has the benefit of minimizing the targets created.
  
  Reviewed by:	bdrewery
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org//D21283

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

Modified: head/share/mk/bsd.files.mk
==============================================================================
--- head/share/mk/bsd.files.mk	Fri Sep  6 18:51:41 2019	(r351953)
+++ head/share/mk/bsd.files.mk	Fri Sep  6 19:05:01 2019	(r351954)
@@ -101,11 +101,16 @@ ${group}NAME_${file}?=	${${group}NAME}
 .else
 ${group}NAME_${file}?=	${file:T}
 .endif # defined(${group}NAME)
-STAGE_AS_SETS+=	${file}
 STAGE_AS_${file}= ${${group}NAME_${file}}
-# XXX {group}OWN,GRP,MODE
-STAGE_DIR.${file}= ${STAGE_OBJTOP}${${_${group}DIR_${file}}}
-stage_as.${file}: ${file}
+# we cannot use file safely as a set name
+# since we cannot? apply :T
+# but we can use the ${group}DIR_${file}
+# as a set - meta.stage.mk will :O:u for us
+# we need to expand ${group}DIR_${file} and replace
+# all '/' and '*' with '_' to make a safe target name.
+STAGE_AS_SETS+=	${${_${group}DIR_${file}}:C,[/*],_,g}
+STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR_${file}}
+stage_as.${${_${group}DIR_${file}}:C,[/*],_,g}: ${file}
 
 installfiles-${group}: _${group}INS1_${file}
 _${group}INS1_${file}: installdirs-${_${group}DIR_${file}} _${group}INS_${file}
@@ -122,12 +127,16 @@ realinstall: installfiles
 .ORDER: beforeinstall installfiles
 
 .if ${MK_STAGING} != "no"
+.if ${FILESGROUPS:@g@${$g}@} != ""
 .if !empty(STAGE_SETS)
 buildfiles: stage_files
 STAGE_TARGETS+= stage_files
+stage_files:
 .if !empty(STAGE_AS_SETS)
 buildfiles: stage_as
 STAGE_TARGETS+= stage_as
+stage_as:
+.endif
 .endif
 .endif
 .endif



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