1994-08-04 23:09:27 +02:00
|
|
|
# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
|
1996-03-10 00:48:55 +01:00
|
|
|
# $Id: bsd.doc.mk,v 1.23 1995/11/29 16:05:08 bde Exp $
|
1994-08-04 23:09:27 +02:00
|
|
|
|
1995-10-15 17:14:42 +01:00
|
|
|
PRINTER?= ascii
|
1994-05-30 21:09:18 +02:00
|
|
|
|
|
|
|
BIB?= bib
|
1994-08-04 23:09:27 +02:00
|
|
|
EQN?= eqn -T${PRINTER}
|
1994-05-30 21:09:18 +02:00
|
|
|
GREMLIN?= grn
|
|
|
|
GRIND?= vgrind -f
|
|
|
|
INDXBIB?= indxbib
|
|
|
|
PIC?= pic
|
|
|
|
REFER?= refer
|
1995-01-17 22:27:30 +01:00
|
|
|
.if ${PRINTER} == "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
|
|
|
|
|
|
|
|
TRFLAGS+= -T${PRINTER}
|
|
|
|
.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)
|
|
|
|
TRFALGS+= -R
|
|
|
|
.endif
|
|
|
|
|
1995-07-26 15:51:46 +02:00
|
|
|
.if defined(NODOCCOMPRESS)
|
|
|
|
DFILE= ${DOC}.${PRINTER}
|
1995-07-27 17:03:27 +02:00
|
|
|
GZIPCMD= cat
|
1995-07-26 15:51:46 +02:00
|
|
|
.else
|
|
|
|
DFILE= ${DOC}.${PRINTER}.gz
|
1995-07-27 17:03:27 +02:00
|
|
|
GZIPCMD= gzip -c
|
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
|
|
|
|
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)
|
|
|
|
lpr -P${PRINTER} ${DFILE}
|
|
|
|
.else
|
1995-07-27 17:03:27 +02:00
|
|
|
${GZIPCMD} -d ${DFILE} | lpr -P${PRINTER}
|
1995-07-26 15:51:46 +02:00
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(obj)
|
1994-08-04 23:09:27 +02:00
|
|
|
.if defined(NOOBJ)
|
|
|
|
obj:
|
|
|
|
.else
|
1994-05-30 21:09:18 +02:00
|
|
|
obj:
|
1995-01-14 20:49:54 +01:00
|
|
|
@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; \
|
1994-08-04 23:09:27 +02:00
|
|
|
else \
|
1995-01-14 20:49:54 +01:00
|
|
|
true; \
|
1994-08-04 23:09:27 +02:00
|
|
|
fi;
|
1994-05-30 21:09:18 +02:00
|
|
|
.endif
|
1994-08-04 23:09:27 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
clean:
|
1995-01-11 20:58:03 +01:00
|
|
|
rm -f ${DOC}.${PRINTER} ${DOC}.ps ${DOC}.ascii \
|
1996-03-10 00:48:55 +01:00
|
|
|
${DOC}.ps.gz ${DOC}.ascii.gz Errs errs mklog ${CLEANFILES}
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1995-01-04 22:34:13 +01:00
|
|
|
cleandir: clean
|
1994-08-04 23:09:27 +02:00
|
|
|
cd ${.CURDIR}; rm -rf obj
|
1994-05-30 21:09:18 +02:00
|
|
|
|
|
|
|
FILES?= ${SRCS}
|
1995-01-11 03:27:01 +01:00
|
|
|
realinstall:
|
1994-08-04 23:09:27 +02:00
|
|
|
@if [ ! -d "${DESTDIR}${BINDIR}/${VOLUME}" ]; then \
|
|
|
|
/bin/rm -f ${DESTDIR}${BINDIR}/${VOLUME} ; \
|
|
|
|
mkdir -p ${DESTDIR}${BINDIR}/${VOLUME} ; \
|
|
|
|
chown root.wheel ${DESTDIR}${BINDIR}/${VOLUME} ; \
|
|
|
|
chmod 755 ${DESTDIR}${BINDIR}/${VOLUME} ; \
|
|
|
|
else \
|
|
|
|
true ; \
|
|
|
|
fi
|
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}
|
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:
|
1995-02-25 21:51:14 +01:00
|
|
|
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies
|
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})
|
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)
|
|
|
|
${SOELIMPP} ${ALLSRCS} | ${ROFF} | ${GZIPCMD} > ${.TARGET}
|
|
|
|
.else
|
1995-07-27 17:03:27 +02:00
|
|
|
(cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) | ${GZIPCMD} > ${.TARGET}
|
1995-11-29 17:05:08 +01:00
|
|
|
.endif
|
1995-07-26 15:51:46 +02:00
|
|
|
.else
|
|
|
|
.if !defined(NODOCCOMPRESS)
|
|
|
|
${DFILE}: ${DOC}.${PRINTER}
|
1995-07-27 17:03:27 +02:00
|
|
|
${GZIPCMD} ${DOC}.${PRINTER} > ${.TARGET}
|
1995-07-26 15:51:46 +02:00
|
|
|
.endif
|
1995-01-11 01:00:11 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.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
|