summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-05-27 23:12:15 +0000
committerwosch <wosch@FreeBSD.org>1996-05-27 23:12:15 +0000
commitf2d4e834375d48321028a7f0d0796019497930ab (patch)
tree21baa42a53850ae0d5955f7a03330680ba85f2ad /share
parent8ee889e2bc3c9da6f79a9403dfdcd83e9928bc0d (diff)
downloadFreeBSD-src-f2d4e834375d48321028a7f0d0796019497930ab.zip
FreeBSD-src-f2d4e834375d48321028a7f0d0796019497930ab.tar.gz
`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
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.sgml.mk120
1 files changed, 62 insertions, 58 deletions
diff --git a/share/mk/bsd.sgml.mk b/share/mk/bsd.sgml.mk
index 01920bb..db32879 100644
--- a/share/mk/bsd.sgml.mk
+++ b/share/mk/bsd.sgml.mk
@@ -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,34 +119,37 @@ 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
.if !target(${DOC}.${_FORMAT})
-${DOC}.${_FORMAT}: ${SRCS}
+${DOC}.${_FORMAT}: ${SRCS}
${SGMLFMT} -f ${.TARGET:S/${DOC}.//} ${SGMLFLAGS} ${.CURDIR}/${DOC}.sgml
.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>
OpenPOWER on IntegriCloud