make rules update:

- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation
This commit is contained in:
christos 1997-03-24 21:54:12 +00:00
parent 6962daa0f8
commit 25f6ec749f
11 changed files with 434 additions and 188 deletions

View File

@ -1,13 +1,12 @@
# $NetBSD: Makefile,v 1.14 1996/10/18 05:58:40 thorpej Exp $
# $NetBSD: Makefile,v 1.15 1997/03/24 21:54:12 christos Exp $
# @(#)Makefile 5.3 (Berkeley) 6/22/90
FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.kmod.mk bsd.lib.mk bsd.man.mk \
bsd.nls.mk bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk bsd.sys.mk \
sys.mk
FILESDIR=/usr/share/mk
NOOBJ= noobj
install:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
${DESTDIR}${BINDIR}/mk
BINMODE=444
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.20 1997/03/22 22:33:53 perry Exp $
# $NetBSD: bsd.README,v 1.21 1997/03/24 21:54:13 christos Exp $
# @(#)bsd.README 5.1 (Berkeley) 5/11/90
This is the README file for the new make "include" files for the BSD
@ -56,7 +56,19 @@ the tree where the file gets installed.
The profiled libraries are no longer built in a different directory than
the regular libraries. A new suffix, ".po", is used to denote a profiled
object.
object, and ".so" denotes a shared (position-independent) object.
There are two variables that control how things are made/installed that
are not set by default:
BUILD If set 'make install' checks that the targets in the source
directories are up-to-date and remakes them if they
are out of date, instead of blindly trying to install
out of date or non-existant targets.
UPDATE 'make install' only installs targets that are more recently
modified in the source directories that their installed
counterparts.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@ -68,10 +80,12 @@ environment or otherwise. You probably don't want to touch this file.
The include file <bsd.man.mk> handles installing manual pages and their
links.
It has a single target:
It has a two targets:
maninstall:
Install the manual pages and their links.
Install the manual page sources and their links.
catinstall:
Install the preformatted manual pages and their links.
It sets/uses the following variables:
@ -111,6 +125,8 @@ is included. These files may define any of the variables described below.
bsd.own.mk sets the following variables, if they are not already defined
(defaults are in brackets):
BSDSRCDIR The real path to the system sources, so that 'make obj'
will work correctly. [/usr/src]
@ -133,6 +149,8 @@ MANOWN Manual owner. [bin]
MANMODE Manual mode. [${NONBINMODE}]
MANINSTALL Manual installation type: maninstall, catinstall, or both
LIBDIR Base path for library installation. [/usr/lib]
LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
@ -277,6 +295,9 @@ MAN Manual pages (should end in .1 - .9). If no MAN variable is
PROG The name of the program to build. If not supplied, nothing
is built.
PROGNAME The name that the above program will be installed as, if
different from ${PROG}.
SRCS List of source files to build the program. If PROG is not
defined, it's assumed to be ${PROG}.c.
@ -288,23 +309,36 @@ DPADD Additional dependencies for the program. Usually used for
The following libraries are predefined for DPADD:
LIBC /lib/libc.a
LIBCOMPAT /usr/lib/libcompat.a
LIBCRYPT /usr/lib/libcrypt.a
LIBCURSES /usr/lib/libcurses.a
LIBDBM /usr/lib/libdbm.a
LIBDES /usr/lib/libdes.a
LIBL /usr/lib/libl.a
LIBKDB /usr/lib/libkdb.a
LIBKRB /usr/lib/libkrb.a
LIBKVM /usr/lib/libkvm.a
LIBM /usr/lib/libm.a
LIBMP /usr/lib/libmp.a
LIBPC /usr/lib/libpc.a
LIBPLOT /usr/lib/libplot.a
LIBRPC /usr/lib/sunrpc.a
LIBTERM /usr/lib/libterm.a
LIBUTIL /usr/lib/libutil.a
LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
LIBC?= ${DESTDIR}/usr/lib/libc.a
LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
LIBDES?= ${DESTDIR}/usr/lib/libdes.a
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
LIBL?= ${DESTDIR}/usr/lib/libl.a
LIBM?= ${DESTDIR}/usr/lib/libm.a
LIBMP?= ${DESTDIR}/usr/lib/libmp.a
LIBPC?= ${DESTDIR}/usr/lib/libpc.a
LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a
LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
LIBY?= ${DESTDIR}/usr/lib/liby.a
LIBZ?= ${DESTDIR}/usr/lib/libz.a
SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
strings, using xstr(1). Note that this will not work with
@ -317,6 +351,17 @@ SUBDIR A list of subdirectories that should be built as well.
Each of the targets will execute the same target in the
subdirectories.
SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
These are installed exactly like programs.
SCRIPTSNAME The name that the above program will be installed as, if
different from ${SCRIPTS}. These can be further specialized
by setting SCRIPTSNAME_<script>.
FILES A list of files to install. The installation is controlled
by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
variables that can be further specialized by FILES<VAR>_<file>
The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
if it exists, as well as the include file <bsd.man.mk>.
@ -352,6 +397,19 @@ the variable SUBDIRS.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The include file <bsd.links.mk> handles the LINKS and SYMLINKS targets.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The include file <bsd.inc.mk> defines the includes target and uses two
variables:
INCS The list of include files
INCSDIR The location to install the include files.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
<bsd.lib.mk>. It contains overrides that are used when building
the NetBSD source tree. For instance, if "PARALLEL" is defined by

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.doc.mk,v 1.22 1997/01/17 01:15:55 perry Exp $
# $NetBSD: bsd.doc.mk,v 1.23 1997/03/24 21:54:14 christos Exp $
# @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
BIB?= bib
@ -12,6 +12,14 @@ ROFF?= groff -M/usr/share/tmac ${MACROS} ${PAGES}
SOELIM?= soelim
TBL?= tbl
BINDIR?= /usr/share/doc
BINGRP?= bin
BINOWN?= bin
BINMODE?= 444
.include <bsd.own.mk>
.PATH: ${.CURDIR}
.if !target(all)
@ -40,21 +48,27 @@ obj:
clean cleandir:
rm -f paper.* [eE]rrs mklog ${CLEANFILES}
.if defined(NODOC)
install:
.else
.if !defined(NODOC)
FILES?= ${SRCS}
install:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
Makefile ${FILES} ${EXTRA} ${DESTDIR}${BINDIR}/${DIR}
.for F in ${FILES} ${EXTRA} Makefile
docinstall:: ${DESTDIR}${BINDIR}/${DIR}/${F}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${BINDIR}/${DIR}/${F}
.endif
.if !defined(BUILD)
${DESTDIR}${BINDIR}/${DIR}/${F}: .MADE
.endif
${DESTDIR}${BINDIR}/${DIR}/${F}: ${F}
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} \
${.TARGET}
.endfor
.else
docinstall::
.endif
install: docinstall
spell: ${SRCS}
spell ${SRCS} | sort | comm -23 - spell.ok > paper.spell
BINDIR?= /usr/share/doc
BINGRP?= bin
BINOWN?= bin
BINMODE?= 444
.include <bsd.own.mk>

19
share/mk/bsd.inc.mk Normal file
View File

@ -0,0 +1,19 @@
# $NetBSD: bsd.inc.mk,v 1.1 1997/03/24 21:54:15 christos Exp $
.if !target(includes)
.if defined(INCS) && !empty(INCS)
.for I in ${INCS}
inclinstall:: ${DESTDIR}${INCSDIR}/$I
${DESTDIR}${INCSDIR}/$I: $I
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
(echo "${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
${.ALLSRC} ${.TARGET}" && \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
${.ALLSRC} ${.TARGET})
.endfor
includes: inclinstall
.else
includes:
.endif
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.kmod.mk,v 1.9 1997/03/22 22:33:56 perry Exp $
# $NetBSD: bsd.kmod.mk,v 1.10 1997/03/24 21:54:16 christos Exp $
S!= cd ${.CURDIR}/..;pwd
@ -68,38 +68,22 @@ afterinstall:
.endif
.if !target(realinstall)
realinstall:
realinstall: ${DESTDIR}${KMODDIR}/${PROG}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${KMODDIR}/${PROG}
.endif
.if !defined(BUILD)
${DESTDIR}${KMODDIR}/${PROG}: .MADE
.endif
${DESTDIR}${KMODDIR}/${PROG}: ${PROG}
${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
${PROG} ${DESTDIR}${KMODDIR}
${.ALLSRC} ${.TARGET}
.endif
install: maninstall _SUBDIRUSE
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
done; true
.endif
.if defined(SYMLINKS) && !empty(SYMLINKS)
@set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
rm -f $$t; \
ln -s $$l $$t; \
done; true
.endif
install: ${MANINSTALL} _SUBDIRUSE linksinstall
maninstall: afterinstall
${MANINSTALL}: afterinstall
afterinstall: realinstall
realinstall: beforeinstall
.endif
@ -128,6 +112,7 @@ unload: ${PROG}
.endif
.include <bsd.obj.mk>
.include <bsd.links.mk>
.include <bsd.dep.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.lib.mk,v 1.88 1997/03/23 00:52:20 cgd Exp $
# $NetBSD: bsd.lib.mk,v 1.89 1997/03/24 21:54:17 christos Exp $
# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
.if exists(${.CURDIR}/../Makefile.inc)
@ -156,25 +156,27 @@ all: ${_LIBS} _SUBDIRUSE
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
lib${LIB}.a:: ${OBJS}
__achivebuild: .USE
@rm -f ${.TARGET}
@${AR} cq ${.TARGET} `lorder ${.ALLSRC} | tsort -q`
${RANLIB} ${.TARGET}
__archiveinstall: .USE
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 ${.ALLSRC} \
${.TARGET}
${RANLIB} -t ${.TARGET}
chmod ${LIBMODE} ${.TARGET}
lib${LIB}.a:: ${OBJS} __archivebuild
@echo building standard ${LIB} library
@rm -f lib${LIB}.a
@${AR} cq lib${LIB}.a `lorder ${OBJS} | tsort -q`
${RANLIB} lib${LIB}.a
POBJS+= ${OBJS:.o=.po}
lib${LIB}_p.a:: ${POBJS}
lib${LIB}_p.a:: ${POBJS} __archivebuild
@echo building profiled ${LIB} library
@rm -f lib${LIB}_p.a
@${AR} cq lib${LIB}_p.a `lorder ${POBJS} | tsort -q`
${RANLIB} lib${LIB}_p.a
SOBJS+= ${OBJS:.o=.so}
lib${LIB}_pic.a:: ${SOBJS}
lib${LIB}_pic.a:: ${SOBJS} __archivebuild
@echo building shared object ${LIB} library
@rm -f lib${LIB}_pic.a
@${AR} cq lib${LIB}_pic.a `lorder ${SOBJS} | tsort -q`
${RANLIB} lib${LIB}_pic.a
lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD} \
${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
@ -182,9 +184,9 @@ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}_pic.a ${DPADD} \
@rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
.if (${SHLIB_TYPE} == "a.out")
$(LD) -x -Bshareable -Bforcearchive \
-o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib${LIB}_pic.a ${LDADD}
-o ${.TARGET} lib${LIB}_pic.a ${LDADD}
.elif (${SHLIB_TYPE} == "ELF")
$(LD) -x -shared -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
$(LD) -x -shared -o ${.TARGET} \
-soname lib${LIB}.so.${SHLIB_SOVERSION} ${SHLIB_LDSTARTFILE} \
--whole-archive lib${LIB}_pic.a --no-whole-archive ${LDADD} \
${SHLIB_LDENDFILE}
@ -224,29 +226,52 @@ afterdepend: .depend
beforeinstall:
.endif
realinstall:
# ranlib lib${LIB}.a
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 lib${LIB}.a \
${DESTDIR}${LIBDIR}
${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}.a
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
.endif
.if !defined(BUILD)
${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
.if !defined(NOPROFILE)
# ranlib lib${LIB}_p.a
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \
lib${LIB}_p.a ${DESTDIR}${LIBDIR}
${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.endif
.if !defined(BUILD)
${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
.endif
.if !defined(NOPIC)
# ranlib lib${LIB}_pic.a
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \
lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.endif
.if !defined(BUILD)
${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
.endif
.if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR}
libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
.endif
.if !defined(BUILD)
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: .MADE
.endif
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} \
${.TARGET}
.if (${SHLIB_TYPE} == "ELF")
rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
ln -s lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
@ -256,37 +281,26 @@ realinstall:
${DESTDIR}${LIBDIR}/lib${LIB}.so
.endif
.endif
.if !defined(NOLINT)
libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
.endif
.if !defined(BUILD)
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
.endif
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln llib-l${LIB}.ln
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
.endif
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
done; true
.endif
.if defined(SYMLINKS) && !empty(SYMLINKS)
@set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo $$t -\> $$l; \
rm -f $$t; \
ln -s $$l $$t; \
done; true
.endif
install: maninstall _SUBDIRUSE
maninstall: afterinstall
libinstall:: linksinstall
realinstall: libinstall
install: ${MANINSTALL} _SUBDIRUSE
${MANINSTALL}: afterinstall
afterinstall: realinstall
realinstall: beforeinstall
.endif
@ -300,6 +314,8 @@ realinstall: beforeinstall
.endif
.include <bsd.obj.mk>
.include <bsd.links.mk>
.include <bsd.inc.mk>
.include <bsd.dep.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>

50
share/mk/bsd.links.mk Normal file
View File

@ -0,0 +1,50 @@
# $NetBSD: bsd.links.mk,v 1.1 1997/03/24 21:54:18 christos Exp $
.if defined(SYMLINKS) && !empty(SYMLINKS)
linksinstall::
@set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo ".include <bsd.own.mk>"; \
echo "all:: $$t"; \
echo ".if !defined(BUILD)"; \
echo "$$t: .MADE"; \
echo ".endif"; \
echo ".if !defined(UPDATE)"; \
echo ".PHONY: $$t"; \
echo ".endif"; \
echo "$$t: $$l"; \
echo " @echo \"$$t -> $$l\""; \
echo " @rm -f $$t"; \
echo " @ln -s $$l $$t"; \
done | make -f -
.endif
.if defined(LINKS) && !empty(LINKS)
linksinstall::
@set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo ".include <bsd.own.mk>"; \
echo "all:: $$t"; \
echo ".if !defined(BUILD)"; \
echo "$$t: .MADE"; \
echo ".endif"; \
echo ".if !defined(UPDATE)"; \
echo ".PHONY: $$t"; \
echo ".endif"; \
echo "$$t: $$l"; \
echo " @echo \"$$t -> $$l\""; \
echo " @rm -f $$t"; \
echo " @ln $$l $$t"; \
done | make -f -
.endif
.if !target(linksinstall)
linksinstall:
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.man.mk,v 1.24 1996/10/18 02:34:44 thorpej Exp $
# $NetBSD: bsd.man.mk,v 1.25 1997/03/24 21:54:19 christos Exp $
# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
MANTARGET?= cat
@ -12,62 +12,116 @@ NROFF?= nroff
.MAIN: all
.endif
.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 \
.cat7 .cat8 .cat9
.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
.cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9
.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1:
@echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
@${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || ( rm -f ${.TARGET} ; false )
@${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
(rm -f ${.TARGET}; false)
.if defined(MAN) && !empty(MAN)
MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.4$/.cat4/g:S/.5$/.cat5/g:S/.6$/.cat6/g:S/.7$/.cat7/g:S/.8$/.cat8/g:S/.9$/.cat9/g}
MANPAGES= ${MAN}
CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
.endif
MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
.if defined(MANZ)
# chown and chmod are done afterward automatically
MCOMPRESS= gzip -cf
MCOMPRESSSUFFIX= .gz
.endif
maninstall:
.if defined(MANALL)
@for page in ${MANALL}; do \
dir=${DESTDIR}${MANDIR}$${page##*.cat}; \
instpage=$${dir}${MANSUBDIR}/$${page%.*}.0${MCOMPRESSSUFFIX}; \
if [ X"${MCOMPRESS}" = X ]; then \
echo ${MINSTALL} $$page $$instpage; \
${MINSTALL} $$page $$instpage; \
else \
rm -f $$instpage; \
echo ${MCOMPRESS} $$page \> $$instpage; \
${MCOMPRESS} $$page > $$instpage; \
chown ${MANOWN}:${MANGRP} $$instpage; \
chmod ${MANMODE} $$instpage; \
fi \
done
catinstall: catlinks
maninstall: manlinks
__installpage: .USE
.if defined(MCOMPRESS) && !empty(MCOMPRESS)
@rm -f ${.TARGET}
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
@chown ${MANOWN}:${MANGRP} ${.TARGET}
@chmod ${MANMODE} ${.TARGET}
.else
${MINSTALL} ${.ALLSRC} ${.TARGET}
.endif
# Rules for source page installation
.if defined(MANPAGES) && !empty(MANPAGES)
. for P in ${MANPAGES}
manpages:: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
. if !defined(UPDATE)
.PHONY: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
. endif
${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
. endfor
.else
manpages::
.endif
# Rules for cat'ed man page installation
.if defined(CATPAGES) && !empty(CATPAGES)
. for P in ${CATPAGES}
catpages:: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
. if !defined(UPDATE)
.PHONY: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
. endif
. if !defined(BUILD)
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
. endif
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
. endfor
.else
catpages::
.endif
catlinks: catpages
.if defined(MLINKS) && !empty(MLINKS)
@set ${MLINKS}; \
while test $$# -ge 2; do \
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}$${name##*.}; \
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}$${name##*.}; \
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
if [ ! -f $$t -o -z "${UPDATE}" ]; then \
echo $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
fi; \
done
.endif
.if defined(MANALL)
all: ${MANALL}
manlinks: manpages
.if defined(MLINKS) && !empty(MLINKS)
@set ${MLINKS}; \
while test $$# -ge 2; do \
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
name=$$1; \
shift; \
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
if [ ! -f $$t -o -z "${UPDATE}" ]; then \
echo $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
fi; \
done
.endif
.if defined(CATPAGES)
all: ${CATPAGES}
cleandir: cleanman
cleanman:
rm -f ${MANALL}
rm -f ${CATPAGES}
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.30 1997/02/23 20:53:56 cgd Exp $
# $NetBSD: bsd.own.mk,v 1.31 1997/03/24 21:54:19 christos Exp $
.if defined(MAKECONF) && exists(${MAKECONF})
.include "${MAKECONF}"
@ -28,10 +28,11 @@ NONBINMODE?= 444
# Define MANZ to have the man pages compressed (gzip)
#MANZ= 1
MANDIR?= /usr/share/man/cat
MANDIR?= /usr/share/man
MANGRP?= bin
MANOWN?= bin
MANMODE?= ${NONBINMODE}
MANINSTALL?= catinstall
LIBDIR?= /usr/lib
LINTLIBDIR?= /usr/libdata/lint

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.prog.mk,v 1.62 1997/03/22 22:34:02 perry Exp $
# $NetBSD: bsd.prog.mk,v 1.63 1997/03/24 21:54:20 christos Exp $
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.if exists(${.CURDIR}/../Makefile.inc)
@ -13,6 +13,7 @@ CFLAGS+= ${COPTS}
LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
LIBC?= ${DESTDIR}/usr/lib/libc.a
LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
@ -20,6 +21,7 @@ LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
LIBDES?= ${DESTDIR}/usr/lib/libdes.a
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
@ -33,6 +35,7 @@ LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
LIBY?= ${DESTDIR}/usr/lib/liby.a
@ -116,43 +119,86 @@ afterinstall:
.endif
.if !target(realinstall)
realinstall:
.if defined(PROG)
${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${PROG} ${DESTDIR}${BINDIR}
PROGNAME?= ${PROG}
proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
.endif
.if !defined(BUILD)
${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
.endif
${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}
${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.ALLSRC} ${.TARGET}
.if defined(HIDEGAME)
(cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG})
.endif
.endif
install: maninstall _SUBDIRUSE
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo $$t -\> $$l; \
rm -f $$t; \
ln $$l $$t; \
done; true
.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
.if defined(SYMLINKS) && !empty(SYMLINKS)
@set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo $$t -\> $$l; \
rm -f $$t; \
ln -s $$l $$t; \
done; true
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
maninstall: afterinstall
${DESTDIR}${FILESDIR_${F}}/${FILESNAME_${F}}: ${F}
${INSTALL} ${COPY} -o ${FILESOWN_${F}} -g ${FILESGRP_${F}} \
-m ${FILESMODE_${F}} ${.ALLSRC} ${.TARGET}
.endfor
.endif
.if defined(SCRIPTS)
.for S in ${SCRIPTS}
.if defined(SCRIPTSNAME)
SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}
.else
SCRIPTSNAME_${S} ?= ${S:T:R}
.endif
proginstall:: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}
.endif
.if !defined(BUILD)
${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}: .MADE
.endif
${DESTDIR}${BINDIR}/${SCRIPTSNAME_${S}}: ${S}
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${.ALLSRC} ${.TARGET}
.endfor
.endif
.if target(proginstall)
realinstall: proginstall
.else
realinstall:
.endif
.endif
install: ${MANINSTALL} _SUBDIRUSE linksinstall
${MANINSTALL}: afterinstall
afterinstall: realinstall
realinstall: beforeinstall
.endif
@ -173,6 +219,8 @@ lint: ${LOBJS}
.endif
.include <bsd.obj.mk>
.include <bsd.links.mk>
.include <bsd.inc.mk>
.include <bsd.dep.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>

View File

@ -1,6 +1,8 @@
# $NetBSD: bsd.subdir.mk,v 1.12 1997/03/21 00:53:02 cgd Exp $
# $NetBSD: bsd.subdir.mk,v 1.13 1997/03/24 21:54:22 christos Exp $
# @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
.include <bsd.own.mk>
.if !target(.MAIN)
.MAIN: all
.endif
@ -49,8 +51,8 @@ beforeinstall:
.if !target(afterinstall)
afterinstall:
.endif
install: maninstall
maninstall: afterinstall
install: ${MANINSTALL}
${MANINSTALL}: afterinstall
afterinstall: realinstall
realinstall: beforeinstall _SUBDIRUSE
.endif