From cb56d4a8510b2125cd80d954d5d017a25af3b8fc Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Fri, 25 Oct 2013 05:11:10 +0000 Subject: [PATCH] Allow mixing bsd.files.mk with bsd.subdir.mk. If a single Makefile wants to recurse into subdirectories and also wants to install files, bsd.files.mk's targets would get ignored in favor of those defined by bsd.subdir.mk because installfiles would not get defined in bsd.files.mk. Prevent this from happening by defining the targets in bsd.files.mk with auxiliary names and listing them as dependencies of installfiles instead. This is required by bsd.test.mk, which needs to install a Kyuafile in pretty much all cases but may also need to recurse into subdirectories for build purposes. Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks --- share/mk/bsd.files.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index 240f958f1a9b..2397005e9477 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -14,9 +14,9 @@ buildfiles: ${${group}} all: buildfiles -.if !target(installfiles) .for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) +installfiles: installfiles-${group} ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} @@ -37,7 +37,7 @@ ${group}NAME_${file:T}?= ${${group}NAME} .else ${group}NAME_${file:T}?= ${file:T} .endif -installfiles: _${group}INS_${file:T} +installfiles-${group}: _${group}INS_${file:T} _${group}INS_${file:T}: ${file} ${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ @@ -48,7 +48,7 @@ _${group}FILES+= ${file} .endif .endfor .if !empty(_${group}FILES) -installfiles: _${group}INS +installfiles-${group}: _${group}INS _${group}INS: ${_${group}FILES} .if defined(${group}NAME) ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \ @@ -63,7 +63,5 @@ _${group}INS: ${_${group}FILES} .endif # defined(${group}) && !empty(${group}) .endfor -.endif # !target(installfiles) - realinstall: installfiles .ORDER: beforeinstall installfiles