Add CONFIGFILES & CONFIGSYMLINKS; similar semantics to FILES & SYMLINKS

yet installed by 'configinstall' not 'install'.
(CONFIGFILES uses FILES{DIR,MODE,OWN,GRP,NAME}{,_*} as per FILES)
This commit is contained in:
lukem 2004-05-13 13:05:53 +00:00
parent d94ff45112
commit 95820dab0e
2 changed files with 50 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.files.mk,v 1.35 2004/03/29 22:26:21 jmc Exp $
# $NetBSD: bsd.files.mk,v 1.36 2004/05/13 13:05:53 lukem Exp $
.if !defined(_BSD_FILES_MK_)
_BSD_FILES_MK_=1
@ -19,6 +19,8 @@ FILESMODE?= ${NONBINMODE}
filesinstall:: # ensure existence
.PHONY: filesinstall
configfilesinstall:: .PHONY
__fileinstall: .USE
${_MKTARGET_INSTALL}
${INSTALL_FILE} \
@ -29,6 +31,7 @@ __fileinstall: .USE
.endif # !target(__fileinstall)
.for F in ${FILES:O:u}
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
@ -50,6 +53,33 @@ filesinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
#
# CONFIGFILES
#
configinstall: configfilesinstall
.for F in ${CONFIGFILES:O:u}
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
.if ${MKUPDATE} == "no"
${_F}! ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F})
${_F}! .MADE # no build at install
.endif
.else
${_F}: ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F})
${_F}: .MADE # no build at install
.endif
.endif
configfilesinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
.undef _FDIR
.undef _FNAME
.undef _F

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.links.mk,v 1.26 2004/01/29 01:48:45 lukem Exp $
# $NetBSD: bsd.links.mk,v 1.27 2004/05/13 13:05:53 lukem Exp $
.include <bsd.init.mk>
@ -42,4 +42,22 @@ linksinstall:: realinstall
done ; )
.endif
.if defined(CONFIGSYMLINKS) && !empty(CONFIGSYMLINKS)
configinstall: configlinksinstall
configlinksinstall:: .PHONY
@(set ${CONFIGSYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; shift; \
t=${DESTDIR}$$1; shift; \
if ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
[ "$$l" = "$$ttarg" ]; then \
continue ; \
fi ; \
${_MKSHMSG_INSTALL} $$t; \
${_MKSHECHO} ${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
done; )
.endif
.include <bsd.sys.mk>