1# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91 2# $Id: bsd.doc.mk,v 1.27 1996/12/19 22:40:43 mpp Exp $ 3 4PRINTERDEVICE?= ascii 5 6BIB?= bib 7EQN?= eqn -T${PRINTERDEVICE} 8GREMLIN?= grn 9GRIND?= vgrind -f 10INDXBIB?= indxbib 11PIC?= pic 12REFER?= refer 13.if ${PRINTERDEVICE} == "ascii" 14ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES} 15.else 16ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES} 17.endif 18SOELIM?= soelim 19SOELIMPP= sed ${SOELIMPPARGS} 20SOELIMPPARGS0= ${SRCS} ${EXTRA} 21SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/} 22SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/} 23SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g} 24TBL?= tbl 25 26DOC?= paper 27 28TRFLAGS+= -T${PRINTERDEVICE} 29.if defined(USE_EQN) 30TRFLAGS+= -e 31.endif 32.if defined(USE_TBL) 33TRFLAGS+= -t 34.endif 35.if defined(USE_PIC) 36TRFLAGS+= -p 37.endif 38.if defined(USE_SOELIM) 39TRFLAGS+= -s 40.endif 41.if defined(USE_REFER) 42TRFALGS+= -R 43.endif 44 45.if defined(NODOCCOMPRESS) 46DFILE= ${DOC}.${PRINTERDEVICE} 47GZIPCMD= cat 48.else 49DFILE= ${DOC}.${PRINTERDEVICE}.gz 50GZIPCMD= gzip -c 51.endif 52 53PAGES?= 1- 54 55# Compatibility mode flag for groff. Use this when formatting documents with 56# Berkeley me macros. 57COMPAT?= -C 58 59.PATH: ${.CURDIR} ${SRCDIR} 60 61.MAIN: all 62all: ${DFILE} 63 64.if !target(print) 65print: ${DFILE} 66.if defined(NODOCCOMPRESS) 67 lpr ${DFILE} 68.else 69 ${GZIPCMD} -d ${DFILE} | lpr 70.endif 71.endif 72 73clean: 74 rm -f ${DOC}.${PRINTERDEVICE} ${DOC}.ps ${DOC}.ascii \ 75 ${DOC}.ps.gz ${DOC}.ascii.gz Errs errs mklog ${CLEANFILES} 76 77FILES?= ${SRCS} 78realinstall: 79 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 80 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME} 81 82install: beforeinstall realinstall afterinstall 83 84.if !target(beforeinstall) 85beforeinstall: 86 87.endif 88.if !target(afterinstall) 89afterinstall: 90 91.endif 92 93DISTRIBUTION?= doc 94.if !target(distribute) 95distribute: 96 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies 97.endif 98 99spell: ${SRCS} 100 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \ 101 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell 102 103BINDIR?= /usr/share/doc 104BINMODE= 444 105 106SRCDIR?= ${.CURDIR} 107 108.if !target(${DFILE}) 109${DFILE}:: ${SRCS} ${EXTRA} ${OBJS} 110# XXX ${.ALLSRC} doesn't work unless there are a lot of .PATH.foo statements. 111ALLSRCS= ${SRCS:S;^;${SRCDIR}/;} 112${DFILE}:: ${SRCS} 113.if defined(USE_SOELIMPP) 114 ${SOELIMPP} ${ALLSRCS} | ${ROFF} | ${GZIPCMD} > ${.TARGET} 115.else 116 (cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) | ${GZIPCMD} > ${.TARGET} 117.endif 118.else 119.if !defined(NODOCCOMPRESS) 120${DFILE}: ${DOC}.${PRINTERDEVICE} 121 ${GZIPCMD} ${DOC}.${PRINTERDEVICE} > ${.TARGET} 122.endif 123.endif 124 125.if !target(depend) 126depend: 127.endif 128 129.if !target(maninstall) 130maninstall: 131.endif 132 133.include <bsd.dep.mk> 134.include <bsd.obj.mk> 135