Put the FILES generated rules in a separate .mk file since both bsd.prog.mk

and bsd.lib.mk use them.
This commit is contained in:
christos 1997-03-27 17:33:34 +00:00
parent cc117ae3ac
commit cef52070f9
4 changed files with 48 additions and 37 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.22 1997/03/27 09:10:09 mycroft Exp $
# $NetBSD: bsd.README,v 1.23 1997/03/27 17:33:35 christos Exp $
# @(#)bsd.README 5.1 (Berkeley) 5/11/90
This is the README file for the new make "include" files for the BSD
@ -393,7 +393,13 @@ the variable SUBDIRS.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The include file <bsd.links.mk> handles the LINKS and SYMLINKS targets.
The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
and is included from from bsd.lib.mk and bsd.prog.mk.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The include file <bsd.files.mk> handles the FILES variables and is included
from bsd.lib.mk and bsd.prog.mk.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

33
share/mk/bsd.files.mk Normal file
View File

@ -0,0 +1,33 @@
# $NetBSD: bsd.files.mk,v 1.1 1997/03/27 17:33:36 christos Exp $
.if defined(FILES)
FILESDIR?=${BINDIR}
FILESOWN?=${BINOWN}
FILESGRP?=${BINGRP}
FILESMODE?=${NONBINMODE}
.for F in ${FILES}
FILESDIR_${F}?=${FILESDIR}
FILESOWN_${F}?=${FILESOWN}
FILESGRP_${F}?=${FILESGRP}
FILESMODE_${F}?=${FILESMODE}
.if defined(FILESNAME)
FILESNAME_${F} ?= ${FILESNAME}
.else
FILESNAME_${F} ?= ${F:T}
.endif
FILESDIR_${F} ?= ${FILESDIR}
filesinstall:: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
.endif
.if !defined(BUILD)
${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: .MADE
.endif
${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: ${F}
${INSTALL} ${COPY} -o ${FILESOWN_${F}} -g ${FILESGRP_${F}} \
-m ${FILESMODE_${F}} ${.ALLSRC} ${.TARGET}
.endfor
.else
filesinstall::
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.lib.mk,v 1.90 1997/03/24 23:19:12 christos Exp $
# $NetBSD: bsd.lib.mk,v 1.91 1997/03/27 17:33:34 christos Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
.if exists(${.CURDIR}/../Makefile.inc)
@ -297,7 +297,7 @@ ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln llib-l${LIB}.ln
.endif
libinstall:: linksinstall
realinstall: libinstall
realinstall: libinstall filesinstall
install: ${MANINSTALL} _SUBDIRUSE
${MANINSTALL}: afterinstall
@ -315,6 +315,7 @@ realinstall: beforeinstall
.include <bsd.obj.mk>
.include <bsd.links.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>
.include <bsd.dep.mk>
.include <bsd.subdir.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.prog.mk,v 1.65 1997/03/27 11:05:32 mycroft Exp $
# $NetBSD: bsd.prog.mk,v 1.66 1997/03/27 17:33:37 christos Exp $
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.if exists(${.CURDIR}/../Makefile.inc)
@ -135,36 +135,6 @@ ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
${.ALLSRC} ${.TARGET}
.endif
.if defined(FILES)
FILESDIR?=${BINDIR}
FILESOWN?=${BINOWN}
FILESGRP?=${BINGRP}
FILESMODE?=${NONBINMODE}
.for F in ${FILES}
FILESDIR_${F}?=${FILESDIR}
FILESOWN_${F}?=${FILESOWN}
FILESGRP_${F}?=${FILESGRP}
FILESMODE_${F}?=${FILESMODE}
.if defined(FILESNAME)
FILESNAME_${F} ?= ${FILESNAME}
.else
FILESNAME_${F} ?= ${F:T}
.endif
FILESDIR_${F} ?= ${FILESDIR}
proginstall:: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}
.endif
.if !defined(BUILD)
${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: .MADE
.endif
${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: ${F}
${INSTALL} ${COPY} -o ${FILESOWN_${F}} -g ${FILESGRP_${F}} \
-m ${FILESMODE_${F}} ${.ALLSRC} ${.TARGET}
.endfor
.endif
.if defined(SCRIPTS)
SCRIPTSDIR?=${BINDIR}
SCRIPTSOWN?=${BINOWN}
@ -196,9 +166,9 @@ ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}
.endif
.if target(proginstall)
realinstall: proginstall
realinstall: proginstall filesinstall
.else
realinstall:
realinstall: filesinstall
.endif
.endif
@ -226,6 +196,7 @@ lint: ${LOBJS}
.include <bsd.obj.mk>
.include <bsd.links.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>
.include <bsd.dep.mk>
.include <bsd.subdir.mk>