2002-10-22 22:48:27 +04:00
|
|
|
# $NetBSD: bsd.files.mk,v 1.20 2002/10/22 18:48:27 perry Exp $
|
1999-02-11 16:25:42 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.if !target(__fileinstall)
|
|
|
|
##### Basic targets
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: filesinstall
|
1997-05-09 17:25:46 +04:00
|
|
|
realinstall: filesinstall
|
1997-03-27 20:33:34 +03:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Default values
|
|
|
|
FILESDIR?= ${BINDIR}
|
|
|
|
FILESOWN?= ${BINOWN}
|
|
|
|
FILESGRP?= ${BINGRP}
|
|
|
|
FILESMODE?= ${NONBINMODE}
|
2000-06-06 09:40:47 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Install rules
|
|
|
|
filesinstall:: # ensure existence
|
2000-06-06 09:40:47 +04:00
|
|
|
|
2000-06-06 13:53:29 +04:00
|
|
|
__fileinstall: .USE
|
2001-11-02 08:21:47 +03:00
|
|
|
${INSTALL_FILE} \
|
2000-06-10 18:12:03 +04:00
|
|
|
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
|
|
|
|
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
|
|
|
|
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
|
2002-10-22 22:48:27 +04:00
|
|
|
${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
|
2000-06-06 13:53:29 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.endif # !target(__fileinstall)
|
|
|
|
|
2001-05-08 07:19:51 +04:00
|
|
|
.for F in ${FILES:O:u}
|
2001-11-02 08:21:47 +03:00
|
|
|
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
|
|
|
|
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
|
|
|
|
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
|
|
|
|
2002-02-12 00:14:58 +03:00
|
|
|
.if !defined(UPDATE)
|
|
|
|
${_F}! ${F} __fileinstall # install rule
|
|
|
|
.if !defined(BUILD) && !make(all) && !make(${F})
|
|
|
|
${_F}! .MADE # no build at install
|
|
|
|
.endif
|
|
|
|
.else
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: ${F} __fileinstall # install rule
|
1999-09-05 01:48:33 +04:00
|
|
|
.if !defined(BUILD) && !make(all) && !make(${F})
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: .MADE # no build at install
|
1997-03-27 20:33:34 +03:00
|
|
|
.endif
|
2002-02-12 00:14:58 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
filesinstall:: ${_F}
|
|
|
|
.PRECIOUS: ${_F} # keep if install fails
|
1997-03-27 20:33:34 +03:00
|
|
|
.endfor
|
1997-05-07 19:53:28 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.undef _FDIR
|
|
|
|
.undef _FNAME
|
|
|
|
.undef _F
|