summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.doc.mk
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1997-02-13 03:26:02 +0000
committerwosch <wosch@FreeBSD.org>1997-02-13 03:26:02 +0000
commit6fc3dd683cc9f9933e220c385c0c22fd4e2a7e9e (patch)
treeceda39446cccdf8add1dbdbd2029e4130314a833 /share/mk/bsd.doc.mk
parent9ae5ce6710fc3ba28b497f5bb111696553ba27bc (diff)
downloadFreeBSD-src-6fc3dd683cc9f9933e220c385c0c22fd4e2a7e9e.zip
FreeBSD-src-6fc3dd683cc9f9933e220c385c0c22fd4e2a7e9e.tar.gz
Support PRINTERDEVICE "html" using the troff translator unroff(1).
It works in most cases, but not all (e.g. nvi).
Diffstat (limited to 'share/mk/bsd.doc.mk')
-rw-r--r--share/mk/bsd.doc.mk29
1 files changed, 25 insertions, 4 deletions
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index 4912c28..9fd8d80 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -42,7 +42,7 @@ TRFLAGS+= -s
TRFALGS+= -R
.endif
-.if defined(NODOCCOMPRESS)
+.if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
DFILE= ${DOC}.${PRINTERDEVICE}
GZIPCMD= cat
.else
@@ -52,6 +52,13 @@ GZIPCMD= gzip -c
PAGES?= 1-
+UNROFF?= unroff
+HTML_SPLIT?= yes
+UNROFFFLAGS?= -ms -fhtml
+.if ${HTML_SPLIT} == "yes"
+UNROFFFLAGS+= split=1
+.endif
+
# Compatibility mode flag for groff. Use this when formatting documents with
# Berkeley me macros.
COMPAT?= -C
@@ -70,14 +77,22 @@ print: ${DFILE}
.endif
.endif
-clean:
- rm -f ${DOC}.${PRINTERDEVICE} ${DOC}.ps ${DOC}.ascii \
- ${DOC}.ps.gz ${DOC}.ascii.gz Errs errs mklog ${CLEANFILES}
+CLEANFILES+= ${DOC}.${PRINTERDEVICE} ${DOC}.${PRINTERDEVICE}.gz \
+ ${DOC}.ascii ${DOC}.ascii.gz \
+ ${DOC}.ps ${DOC}.ps.gz \
+ ${DOC}.html ${DOC}-*.html
+
FILES?= ${SRCS}
realinstall:
+.if ${PRINTERDEVICE} == "html"
+ cd ${SRCDIR}; \
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
+.else
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
+.endif
install: beforeinstall realinstall afterinstall
@@ -106,6 +121,11 @@ BINMODE= 444
SRCDIR?= ${.CURDIR}
.if !target(${DFILE})
+.if ${PRINTERDEVICE} == "html"
+${DFILE}: ${SRCS} ${EXTRA} ${OBJS}
+ cd ${SRCDIR}; ${UNROFF} ${UNROFFFLAGS} document=${DOC} ${.ALLSRC}
+.else
+
${DFILE}:: ${SRCS} ${EXTRA} ${OBJS}
# XXX ${.ALLSRC} doesn't work unless there are a lot of .PATH.foo statements.
ALLSRCS= ${SRCS:S;^;${SRCDIR}/;}
@@ -121,6 +141,7 @@ ${DFILE}: ${DOC}.${PRINTERDEVICE}
${GZIPCMD} ${DOC}.${PRINTERDEVICE} > ${.TARGET}
.endif
.endif
+.endif
.if !target(depend)
depend:
OpenPOWER on IntegriCloud