1994-08-04 23:09:27 +02:00
|
|
|
# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
|
1997-11-09 16:03:15 +01:00
|
|
|
# $Id: bsd.doc.mk,v 1.40 1997/11/02 18:50:53 wosch Exp $
|
1997-05-11 12:42:00 +02:00
|
|
|
#
|
|
|
|
# The include file <bsd.doc.mk> handles installing BSD troff documents.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ variables +++
|
|
|
|
#
|
|
|
|
# LPR Printer command. [lpr]
|
|
|
|
#
|
|
|
|
# [incomplete]
|
|
|
|
#
|
|
|
|
# +++ targets +++
|
|
|
|
#
|
|
|
|
# [incomplete]
|
1994-08-04 23:09:27 +02:00
|
|
|
|
1997-11-02 19:50:53 +01:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
1996-12-19 23:40:43 +01:00
|
|
|
PRINTERDEVICE?= ascii
|
1994-05-30 21:09:18 +02:00
|
|
|
|
|
|
|
BIB?= bib
|
1996-12-19 23:40:43 +01:00
|
|
|
EQN?= eqn -T${PRINTERDEVICE}
|
1994-05-30 21:09:18 +02:00
|
|
|
GREMLIN?= grn
|
|
|
|
GRIND?= vgrind -f
|
|
|
|
INDXBIB?= indxbib
|
|
|
|
PIC?= pic
|
|
|
|
REFER?= refer
|
1996-12-19 23:40:43 +01:00
|
|
|
.if ${PRINTERDEVICE} == "ascii"
|
1995-01-17 23:04:38 +01:00
|
|
|
ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
|
1995-01-17 22:27:30 +01:00
|
|
|
.else
|
1995-01-11 01:00:11 +01:00
|
|
|
ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES}
|
1995-01-17 22:27:30 +01:00
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
SOELIM?= soelim
|
1995-11-29 17:05:08 +01:00
|
|
|
SOELIMPP= sed ${SOELIMPPARGS}
|
|
|
|
SOELIMPPARGS0= ${SRCS} ${EXTRA}
|
|
|
|
SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/}
|
|
|
|
SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
|
|
|
|
SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g}
|
1994-05-30 21:09:18 +02:00
|
|
|
TBL?= tbl
|
|
|
|
|
1995-01-11 01:00:11 +01:00
|
|
|
DOC?= paper
|
1997-05-11 12:42:00 +02:00
|
|
|
LPR?= lpr
|
1995-01-11 01:00:11 +01:00
|
|
|
|
1996-12-19 23:40:43 +01:00
|
|
|
TRFLAGS+= -T${PRINTERDEVICE}
|
1995-01-11 01:00:11 +01:00
|
|
|
.if defined(USE_EQN)
|
|
|
|
TRFLAGS+= -e
|
|
|
|
.endif
|
|
|
|
.if defined(USE_TBL)
|
|
|
|
TRFLAGS+= -t
|
|
|
|
.endif
|
|
|
|
.if defined(USE_PIC)
|
|
|
|
TRFLAGS+= -p
|
|
|
|
.endif
|
|
|
|
.if defined(USE_SOELIM)
|
|
|
|
TRFLAGS+= -s
|
|
|
|
.endif
|
|
|
|
.if defined(USE_REFER)
|
1997-04-04 03:25:32 +02:00
|
|
|
TRFLAGS+= -R
|
1995-01-11 01:00:11 +01:00
|
|
|
.endif
|
|
|
|
|
1997-03-09 00:46:56 +01:00
|
|
|
DCOMPRESS_EXT?= ${COMPRESS_EXT}
|
1997-02-13 04:26:02 +01:00
|
|
|
.if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
|
1996-12-19 23:40:43 +01:00
|
|
|
DFILE= ${DOC}.${PRINTERDEVICE}
|
1997-03-09 00:46:56 +01:00
|
|
|
DCOMPRESS_CMD= cat
|
1995-07-26 15:51:46 +02:00
|
|
|
.else
|
1997-03-09 00:46:56 +01:00
|
|
|
DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
|
|
|
|
DCOMPRESS_CMD?= ${COMPRESS_CMD}
|
1995-07-26 15:51:46 +02:00
|
|
|
.endif
|
|
|
|
|
1994-08-04 23:09:27 +02:00
|
|
|
PAGES?= 1-
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1997-02-13 04:26:02 +01:00
|
|
|
UNROFF?= unroff
|
|
|
|
HTML_SPLIT?= yes
|
1997-02-16 23:23:44 +01:00
|
|
|
UNROFFFLAGS?= -fhtml
|
1997-02-13 04:26:02 +01:00
|
|
|
.if ${HTML_SPLIT} == "yes"
|
|
|
|
UNROFFFLAGS+= split=1
|
|
|
|
.endif
|
|
|
|
|
1994-08-04 23:09:27 +02:00
|
|
|
# Compatibility mode flag for groff. Use this when formatting documents with
|
|
|
|
# Berkeley me macros.
|
|
|
|
COMPAT?= -C
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1995-01-11 01:00:11 +01:00
|
|
|
.PATH: ${.CURDIR} ${SRCDIR}
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1995-01-11 03:41:09 +01:00
|
|
|
.MAIN: all
|
1995-07-26 15:51:46 +02:00
|
|
|
all: ${DFILE}
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1994-08-04 23:09:27 +02:00
|
|
|
.if !target(print)
|
1995-07-26 15:51:46 +02:00
|
|
|
print: ${DFILE}
|
|
|
|
.if defined(NODOCCOMPRESS)
|
1997-05-11 12:42:00 +02:00
|
|
|
${LPR} ${DFILE}
|
1995-07-26 15:51:46 +02:00
|
|
|
.else
|
1997-05-11 12:42:00 +02:00
|
|
|
${DCOMPRESS_CMD} -d ${DFILE} | ${LPR}
|
1995-07-26 15:51:46 +02:00
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
.endif
|
|
|
|
|
1997-03-09 00:46:56 +01:00
|
|
|
CLEANFILES+= ${DOC}.${PRINTERDEVICE} \
|
|
|
|
${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT} \
|
|
|
|
${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
|
|
|
|
${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
|
1997-02-13 04:26:02 +01:00
|
|
|
${DOC}.html ${DOC}-*.html
|
|
|
|
|
1994-05-30 21:09:18 +02:00
|
|
|
|
|
|
|
FILES?= ${SRCS}
|
1995-01-11 03:27:01 +01:00
|
|
|
realinstall:
|
1997-02-13 04:26:02 +01:00
|
|
|
.if ${PRINTERDEVICE} == "html"
|
1997-11-01 20:45:02 +01:00
|
|
|
cd ${SRCDIR}; \
|
|
|
|
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
1997-03-02 16:52:34 +01:00
|
|
|
${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
|
1997-02-13 04:26:02 +01:00
|
|
|
.else
|
1995-01-04 23:43:52 +01:00
|
|
|
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
1995-07-26 15:51:46 +02:00
|
|
|
${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
|
1997-02-13 04:26:02 +01:00
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1995-01-11 03:27:01 +01:00
|
|
|
install: beforeinstall realinstall afterinstall
|
|
|
|
|
|
|
|
.if !target(beforeinstall)
|
|
|
|
beforeinstall:
|
|
|
|
|
|
|
|
.endif
|
|
|
|
.if !target(afterinstall)
|
|
|
|
afterinstall:
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
1995-01-14 08:51:10 +01:00
|
|
|
DISTRIBUTION?= doc
|
1994-11-13 22:05:28 +01:00
|
|
|
.if !target(distribute)
|
|
|
|
distribute:
|
1997-06-21 17:40:34 +02:00
|
|
|
.for dist in ${DISTRIBUTION}
|
|
|
|
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
|
|
|
|
.endfor
|
1994-11-13 22:05:28 +01:00
|
|
|
.endif
|
|
|
|
|
1994-05-30 21:09:18 +02:00
|
|
|
spell: ${SRCS}
|
1994-08-04 23:09:27 +02:00
|
|
|
(cd ${.CURDIR}; spell ${SRCS} ) | sort | \
|
|
|
|
comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
|
1994-05-30 21:09:18 +02:00
|
|
|
|
|
|
|
BINDIR?= /usr/share/doc
|
1995-01-04 23:43:52 +01:00
|
|
|
BINMODE= 444
|
1995-01-11 01:00:11 +01:00
|
|
|
|
|
|
|
SRCDIR?= ${.CURDIR}
|
|
|
|
|
1995-07-26 15:51:46 +02:00
|
|
|
.if !target(${DFILE})
|
1997-02-13 04:26:02 +01:00
|
|
|
.if ${PRINTERDEVICE} == "html"
|
|
|
|
${DFILE}: ${SRCS} ${EXTRA} ${OBJS}
|
1997-02-16 23:23:44 +01:00
|
|
|
cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
|
1997-11-01 20:45:02 +01:00
|
|
|
document=${DOC} ${SRCS}
|
1997-02-13 04:26:02 +01:00
|
|
|
.else
|
|
|
|
|
1995-11-29 17:05:08 +01:00
|
|
|
${DFILE}:: ${SRCS} ${EXTRA} ${OBJS}
|
|
|
|
# XXX ${.ALLSRC} doesn't work unless there are a lot of .PATH.foo statements.
|
|
|
|
ALLSRCS= ${SRCS:S;^;${SRCDIR}/;}
|
|
|
|
${DFILE}:: ${SRCS}
|
|
|
|
.if defined(USE_SOELIMPP)
|
1997-03-09 00:46:56 +01:00
|
|
|
${SOELIMPP} ${ALLSRCS} | ${ROFF} | ${DCOMPRESS_CMD} > ${.TARGET}
|
1995-11-29 17:05:08 +01:00
|
|
|
.else
|
1997-03-09 00:46:56 +01:00
|
|
|
(cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) | ${DCOMPRESS_CMD} > ${.TARGET}
|
1995-11-29 17:05:08 +01:00
|
|
|
.endif
|
1995-07-26 15:51:46 +02:00
|
|
|
.else
|
|
|
|
.if !defined(NODOCCOMPRESS)
|
1996-12-19 23:40:43 +01:00
|
|
|
${DFILE}: ${DOC}.${PRINTERDEVICE}
|
1997-03-09 00:46:56 +01:00
|
|
|
${DCOMPRESS_CMD} ${DOC}.${PRINTERDEVICE} > ${.TARGET}
|
1995-07-26 15:51:46 +02:00
|
|
|
.endif
|
1995-01-11 01:00:11 +01:00
|
|
|
.endif
|
1997-02-13 04:26:02 +01:00
|
|
|
.endif
|
1995-01-11 01:00:11 +01:00
|
|
|
|
|
|
|
.if !target(depend)
|
|
|
|
depend:
|
|
|
|
.endif
|
1995-01-11 03:06:58 +01:00
|
|
|
|
1995-03-10 09:54:42 +01:00
|
|
|
.if !target(maninstall)
|
|
|
|
maninstall:
|
|
|
|
.endif
|
1996-06-24 06:26:21 +02:00
|
|
|
|
|
|
|
.include <bsd.dep.mk>
|
|
|
|
.include <bsd.obj.mk>
|