NetBSD/share/mk/bsd.files.mk

50 lines
1.2 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.files.mk,v 1.19 2002/04/24 08:18:52 lukem Exp $
.if !target(__fileinstall)
##### Basic targets
1997-05-07 00:54:31 +04:00
.PHONY: filesinstall
realinstall: filesinstall
##### Default values
FILESDIR?= ${BINDIR}
FILESOWN?= ${BINOWN}
FILESGRP?= ${BINGRP}
FILESMODE?= ${NONBINMODE}
##### Install rules
filesinstall:: # ensure existence
2000-06-06 13:53:29 +04:00
__fileinstall: .USE
${INSTALL_FILE} \
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
2000-06-06 13:53:29 +04:00
${.ALLSRC} ${.TARGET}
.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
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
.if !defined(UPDATE)
${_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
filesinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
1997-05-07 19:53:28 +04:00
.undef _FDIR
.undef _FNAME
.undef _F