make install' do not depend on make all'

Add some comments for variables and targets.
Include <bsd.obj.mk>, remove targets  obj, clean, cleandir.
Replace ${MAN*} with ${DOC*} variables.
Use a .for loop for undefined targets
This commit is contained in:
Wolfram Schneider 1996-05-27 23:12:15 +00:00
parent 5233f1c6ed
commit 187f8e98f5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15950

View File

@ -1,7 +1,50 @@
# bsd.sgml.mk - 8 Sep 1995 John Fieber
# This file is in the public domain.
#
# $Id: bsd.sgml.mk,v 1.3 1995/09/10 21:49:24 jfieber Exp $
# $Id: bsd.sgml.mk,v 1.7 1996/04/29 15:59:01 wosch Exp $
#
# The include file <bsd.sgml.mk> handles installing sgml documents.
# <bsd.prog.mk> includes the file named "../Makefile.inc" if it exists,
# as well as the include file <bsd.obj.mk>.
#
#
# +++ variables +++
#
# DISTRIBUTION Name of distribution. [doc]
#
# FORMATS Indicates which output formats will be generated
# (ascii, html, latex, nroff). [ascii html]
#
# LPR Printer command. [lpr]
#
# SGMLFLAGS Flags to sgmlfmt. [${SGMLOPTS}]
#
# SGMLFMT Format sgml files command. [sgmlfmt]
#
# Variables DOCOWN, DOCGRP, DOCMODE, DOCDIR, DESTDIR, DISTDIR are
# set by other Makefiles (e.g. bsd.own.mk)
#
#
# +++ targets +++
#
# all:
# Converts sgml files to the specified output format
# (see ${FORMATS}).
#
# distribute:
# This is a variant of install, which will
# put the stuff into the right "distribution".
#
# install:
# Install formated output.
#
# print:
# Print formated output.
#
#
# bsd.obj.mk: clean, cleandir, obj
#
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
@ -17,7 +60,6 @@ SGMLFLAGS+= ${SGMLOPTS}
VOLUME?= ${.CURDIR:T}
DOC?= ${.CURDIR:T}
BINDIR?= /usr/share/doc
SRCDIR?= ${.CURDIR}
DISTRIBUTION?= doc
SGMLFMT?= sgmlfmt
@ -33,43 +75,8 @@ all: ${DOCS}
${DOC}. install- print- clean-:
.endif
.if !target(obj)
.if defined(NOOBJ)
obj:
.else
obj:
@cd ${.CURDIR}; rm -f obj; \
here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
mkdir -p $$dest; \
else \
true; \
fi;
.endif
.endif
clean: ${FORMATS:S/^/clean-/g}
rm -f Errs errs mklog
cleandir: clean
cd ${.CURDIR}; rm -rf obj
install: beforeinstall realinstall afterinstall
.if !target(beforeinstall)
beforeinstall:
.endif
.if !target(afterinstall)
afterinstall:
.endif
.if !target(maninstall)
maninstall:
.endif
realinstall: ${FORMATS:S/^/install-/g}
.if !target(print)
@ -86,12 +93,6 @@ distribute:
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies
.endif
.if !target(depend)
depend:
.endif
# For each FORMATS type, define a build, install, clean and print target.
# Note that there is special case handling for html targets
# because the number of files generated is generally not possible
@ -118,14 +119,14 @@ print-${_FORMAT}: ${DOC}.${_FORMAT}
.if !target(install-${_FORMAT})
.if ${_FORMAT} == "html"
install-${_FORMAT}: ${DOC}.${_FORMAT}
${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
*.${.TARGET:S/install-//} ${DESTDIR}${BINDIR}/${VOLUME}
install-${_FORMAT}:
${INSTALL} ${COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
*.${.TARGET:S/install-//} ${DESTDIR}${DOCDIR}/${VOLUME}
.else
install-${_FORMAT}: ${DOC}.${_FORMAT}
${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
${DOC}.${.TARGET:S/install-//} ${DESTDIR}${BINDIR}/${VOLUME}
install-${_FORMAT}:
${INSTALL} ${COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
${DOC}.${.TARGET:S/install-//} ${DESTDIR}${DOCDIR}/${VOLUME}
.endif
.endif
@ -136,16 +137,19 @@ ${DOC}.${_FORMAT}: ${SRCS}
.endif
.if !target(clean-${_FORMAT})
.if ${_FORMAT} == "html"
clean-${_FORMAT}:
rm -f *.${.TARGET:S/clean-//}
CLEANFILES+= *.html
.else
clean-${_FORMAT}:
rm -f ${DOC}.${.TARGET:S/clean-//}
.endif
CLEANFILES+= ${DOC}.${_FORMAT}
.endif
.endfor
.for __target in beforeinstall afterinstall maninstall depend _SUBDIRUSE
.if !target(__target)
${__target}:
.endif
.endfor
.include <bsd.obj.mk>