NetBSD/share/mk/bsd.files.mk
mycroft 750b27b82a Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).
2000-06-10 14:12:03 +00:00

41 lines
1.3 KiB
Makefile

# $NetBSD: bsd.files.mk,v 1.14 2000/06/10 14:12:03 mycroft Exp $
# This file can be included multiple times. It clears the definition of
# FILES at the end so that this is possible.
.PHONY: filesinstall
realinstall: filesinstall
.if defined(FILES) && !empty(FILES)
FILESDIR?=${BINDIR}
FILESOWN?=${BINOWN}
FILESGRP?=${BINGRP}
FILESMODE?=${NONBINMODE}
filesinstall:: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
.PRECIOUS: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
.if !defined(UPDATE)
.PHONY: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
.endif
__fileinstall: .USE
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
${.ALLSRC} ${.TARGET}
.for F in ${FILES}
.if !defined(BUILD) && !make(all) && !make(${F})
${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: .MADE
.endif
${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: ${F} __fileinstall
.endfor
.endif
.if !target(filesinstall)
filesinstall::
.endif
FILES:=