diff options
author | ru <ru@FreeBSD.org> | 2001-12-17 13:59:35 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-12-17 13:59:35 +0000 |
commit | bbef88e1a5535074053d60fa0fa2b5832f7de5ea (patch) | |
tree | 7fd7e5683e347709f8bd623688bd94074689c72a /share/mk | |
parent | 650091c3142d295b29e3809e946f4d064cc805a4 (diff) | |
download | FreeBSD-src-bbef88e1a5535074053d60fa0fa2b5832f7de5ea.zip FreeBSD-src-bbef88e1a5535074053d60fa0fa2b5832f7de5ea.tar.gz |
FILES support for bsd.prog.mk. See bsd.README for details.
Stolen from: NetBSD
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/Makefile | 3 | ||||
-rw-r--r-- | share/mk/bsd.README | 5 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 37 |
3 files changed, 38 insertions, 7 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile index e63005c..1c17e9a 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -8,10 +8,9 @@ FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk FILES+= bsd.prog.mk bsd.sgml.mk bsd.subdir.mk bsd.sys.mk FILES+= sys.mk NOOBJ= noobj +FILESDIR= ${BINDIR}/mk beforeinstall: - ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE} ${FILES} \ - ${DESTDIR}${BINDIR}/mk date '+%Y%m%d' > ${DESTDIR}/var/db/port.mkversion .include <bsd.prog.mk> diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 031d470..9a7140e 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -196,6 +196,11 @@ CLEANDIRS additional directories to remove during clean and cleandir COPTS Additional flags to the compiler when creating C objects. +FILES A list of non-executable files. + The installation is controlled by the FILESNAME, FILESOWN, + FILESGRP, FILESMODE, FILESDIR variables that can be + further specialized by FILES<VAR>_<file>. + HIDEGAME If HIDEGAME is defined, the binary is installed in /usr/games/hide, and a symbolic link is created to /usr/games/dm. diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 670f5a2b..31b3855 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -67,11 +67,11 @@ MAN1= ${MAN} .endif .MAIN: all +all: objwarn ${PROG} ${SCRIPTS} ${FILES} .if !defined(NOMAN) -all: objwarn ${PROG} ${SCRIPTS} all-man _SUBDIR -.else -all: objwarn ${PROG} ${SCRIPTS} _SUBDIR +all: all-man .endif +all: _SUBDIR CLEANFILES+= ${PROG} ${OBJS} @@ -150,8 +150,8 @@ SCRIPTSDIR_${script:T}?= ${SCRIPTSDIR} SCRIPTSOWN_${script:T}?= ${SCRIPTSOWN} SCRIPTSGRP_${script:T}?= ${SCRIPTSGRP} SCRIPTSMODE_${script:T}?= ${SCRIPTSMODE} -_scriptsinstall: SCRIPTSINS_${script:T} -SCRIPTSINS_${script:T}: ${script} +_scriptsinstall: _SCRIPTSINS_${script:T} +_SCRIPTSINS_${script:T}: ${script} ${INSTALL} ${COPY} -o ${SCRIPTSOWN_${.ALLSRC:T}} \ -g ${SCRIPTSGRP_${.ALLSRC:T}} -m ${SCRIPTSMODE_${.ALLSRC:T}} \ ${_INSTALLFLAGS} ${.ALLSRC} \ @@ -159,6 +159,33 @@ SCRIPTSINS_${script:T}: ${script} .endfor .endif +.if defined(FILES) && !empty(FILES) +realinstall: _filesinstall + +FILESDIR?= ${BINDIR} +FILESOWN?= ${SHAREOWN} +FILESGRP?= ${SHAREGRP} +FILESMODE?= ${SHAREMODE} + +.for file in ${FILES} +.if defined(FILESNAME) +FILESNAME_${file:T}?= ${FILESNAME} +.else +FILESNAME_${file:T}?= ${file:T} +.endif +FILESDIR_${file:T}?= ${FILESDIR} +FILESOWN_${file:T}?= ${FILESOWN} +FILESGRP_${file:T}?= ${FILESGRP} +FILESMODE_${file:T}?= ${FILESMODE} +_filesinstall: _FILESINS_${file:T} +_FILESINS_${file:T}: ${file} + ${INSTALL} ${COPY} -o ${FILESOWN_${.ALLSRC:T}} \ + -g ${FILESGRP_${.ALLSRC:T}} -m ${FILESMODE_${.ALLSRC:T}} \ + ${_INSTALLFLAGS} ${.ALLSRC} \ + ${DESTDIR}${FILESDIR_${.ALLSRC:T}}/${FILESNAME_${.ALLSRC:T}} +.endfor +.endif + install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall |