1# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91 2# $Id: bsd.doc.mk,v 1.16 1995/01/17 21:36:06 ache Exp $ 3 4PRINTER?= ps 5 6BIB?= bib 7EQN?= eqn -T${PRINTER} 8GREMLIN?= grn 9GRIND?= vgrind -f 10INDXBIB?= indxbib 11PIC?= pic 12REFER?= refer 13.if ${PRINTER} == "ascii" 14ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES} 15.else 16ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES} 17.endif 18SOELIM?= soelim 19TBL?= tbl 20 21DOC?= paper 22 23TRFLAGS+= -T${PRINTER} 24.if defined(USE_EQN) 25TRFLAGS+= -e 26.endif 27.if defined(USE_TBL) 28TRFLAGS+= -t 29.endif 30.if defined(USE_PIC) 31TRFLAGS+= -p 32.endif 33.if defined(USE_SOELIM) 34TRFLAGS+= -s 35.endif 36.if defined(USE_REFER) 37TRFALGS+= -R 38.endif 39 40PAGES?= 1- 41 42# Compatibility mode flag for groff. Use this when formatting documents with 43# Berkeley me macros. 44COMPAT?= -C 45 46.PATH: ${.CURDIR} ${SRCDIR} 47 48.MAIN: all 49all: ${DOC}.${PRINTER} 50 51.if !target(print) 52print: ${DOC}.${PRINTER} 53 lpr -P${PRINTER} ${DOC}.${PRINTER} 54.endif 55 56.if !target(obj) 57.if defined(NOOBJ) 58obj: 59.else 60obj: 61 @cd ${.CURDIR}; rm -f obj; \ 62 here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ 63 ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ 64 if test -d /usr/obj -a ! -d $$dest; then \ 65 mkdir -p $$dest; \ 66 else \ 67 true; \ 68 fi; 69.endif 70.endif 71 72clean: 73 rm -f ${DOC}.${PRINTER} ${DOC}.ps ${DOC}.ascii \ 74 [eE]rrs mklog ${CLEANFILES} 75 76cleandir: clean 77 cd ${.CURDIR}; rm -rf obj 78 79FILES?= ${SRCS} 80realinstall: 81 @if [ ! -d "${DESTDIR}${BINDIR}/${VOLUME}" ]; then \ 82 /bin/rm -f ${DESTDIR}${BINDIR}/${VOLUME} ; \ 83 mkdir -p ${DESTDIR}${BINDIR}/${VOLUME} ; \ 84 chown root.wheel ${DESTDIR}${BINDIR}/${VOLUME} ; \ 85 chmod 755 ${DESTDIR}${BINDIR}/${VOLUME} ; \ 86 else \ 87 true ; \ 88 fi 89 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 90 ${DOC}.${PRINTER} ${DESTDIR}${BINDIR}/${VOLUME} 91 92install: beforeinstall realinstall afterinstall 93 94.if !target(beforeinstall) 95beforeinstall: 96 97.endif 98.if !target(afterinstall) 99afterinstall: 100 101.endif 102 103DISTRIBUTION?= doc 104.if !target(distribute) 105distribute: 106 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${RELEASEDIR}/${DISTRIBUTION} SHARED=copies 107.endif 108 109spell: ${SRCS} 110 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \ 111 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell 112 113BINDIR?= /usr/share/doc 114BINMODE= 444 115 116SRCDIR?= ${.CURDIR} 117 118.if !target(${DOC}.${PRINTER}) 119CLEANFILES+= ${DOC}.${PRINTER}+ 120 121${DOC}.${PRINTER}: ${SRCS} 122 (cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) > ${.TARGET}+ 123 rm -f ${.TARGET} 124 mv ${.TARGET}+ ${.TARGET} 125.endif 126 127.if !target(depend) 128depend: 129 130.endif 131 132