]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.doc.mk
This commit was generated by cvs2svn to compensate for changes in r53910,
[FreeBSD/FreeBSD.git] / share / mk / bsd.doc.mk
1 #       from: @(#)bsd.doc.mk    5.3 (Berkeley) 1/2/91
2 # $FreeBSD$
3 #
4 # The include file <bsd.doc.mk> handles installing BSD troff documents.
5 #
6 #
7 # +++ variables +++
8 #
9 # LPR           Printer command. [lpr]
10 #
11 #       [incomplete]
12 #
13 # +++ targets +++
14 #
15 #       [incomplete]
16
17 .if !target(__initialized__)
18 __initialized__:
19 .if exists(${.CURDIR}/../Makefile.inc)
20 .include "${.CURDIR}/../Makefile.inc"
21 .endif
22 .endif
23
24 PRINTERDEVICE?= ascii
25
26 BIB?=           bib
27 EQN?=           eqn -T${PRINTERDEVICE}
28 GREMLIN?=       grn
29 GRIND?=         vgrind -f
30 INDXBIB?=       indxbib
31 PIC?=           pic
32 REFER?=         refer
33 .if ${PRINTERDEVICE} == "ascii"
34 ROFF?=          groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
35 .else
36 ROFF?=          groff ${TRFLAGS} ${MACROS} -o${PAGES}
37 .endif
38 SOELIM?=        soelim
39 SOELIMPP=       sed ${SOELIMPPARGS}
40 SOELIMPPARGS0=  ${SRCS} ${EXTRA}
41 SOELIMPPARGS1=  ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\       ][\\ \\ ]*\)\(/}
42 SOELIMPPARGS2=  ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
43 SOELIMPPARGS=   ${SOELIMPPARGS2:S/\\'/'/g}
44 TBL?=           tbl
45
46 DOC?=           paper
47 LPR?=           lpr
48
49 TRFLAGS+=       -T${PRINTERDEVICE}
50 .if defined(USE_EQN)
51 TRFLAGS+=       -e
52 .endif
53 .if defined(USE_TBL)
54 TRFLAGS+=       -t
55 .endif
56 .if defined(USE_PIC)
57 TRFLAGS+=       -p
58 .endif
59 .if defined(USE_SOELIM)
60 TRFLAGS+=       -s
61 .endif
62 .if defined(USE_REFER)
63 TRFLAGS+=       -R
64 .endif
65
66 DCOMPRESS_EXT?= ${COMPRESS_EXT}
67 .if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
68 DFILE=  ${DOC}.${PRINTERDEVICE}
69 DCOMPRESS_CMD=  cat
70 .else
71 DFILE=  ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
72 DCOMPRESS_CMD?= ${COMPRESS_CMD}
73 .endif
74
75 PAGES?=         1-
76
77 UNROFF?=        unroff
78 HTML_SPLIT?=    yes
79 UNROFFFLAGS?=   -fhtml
80 .if ${HTML_SPLIT} == "yes"
81 UNROFFFLAGS+=   split=1
82 .endif
83
84 # Compatibility mode flag for groff.  Use this when formatting documents with
85 # Berkeley me macros.
86 COMPAT?=        -C
87
88 .PATH: ${.CURDIR} ${SRCDIR}
89
90 .MAIN:  all
91 all:    ${DFILE}
92
93 .if !target(print)
94 print: ${DFILE}
95 .if defined(NODOCCOMPRESS)
96         ${LPR} ${DFILE}
97 .else
98         ${DCOMPRESS_CMD} -d ${DFILE} | ${LPR}
99 .endif
100 .endif
101
102 .if ${PRINTERDEVICE} != "ascii" && ${PRINTERDEVICE} != "ps"
103 CLEANFILES+=    ${DOC}.${PRINTERDEVICE} ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
104 .endif
105 CLEANFILES+=    ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
106                 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
107                 ${DOC}.html ${DOC}-*.html
108
109 FILES?= ${SRCS}
110 realinstall:
111 .if ${PRINTERDEVICE} == "html"
112         cd ${SRCDIR}; \
113                 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
114                 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
115 .else
116         ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
117                 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
118 .endif
119
120 install:        beforeinstall realinstall afterinstall
121
122 .if !target(beforeinstall)
123 beforeinstall:
124
125 .endif
126 .if !target(afterinstall)
127 afterinstall:
128
129 .endif
130
131 DISTRIBUTION?=  doc
132 .if !target(distribute)
133 distribute:
134 .for dist in ${DISTRIBUTION}
135         cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
136 .endfor
137 .endif
138
139 spell: ${SRCS}
140         (cd ${.CURDIR};  spell ${SRCS} ) | sort | \
141                 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
142
143 BINDIR?=        /usr/share/doc
144 BINMODE=        444
145
146 SRCDIR?=        ${.CURDIR}
147
148 .if !target(${DFILE})
149 _stamp.extraobjs: ${EXTRA} ${OBJS}
150         touch ${.TARGET}
151 CLEANFILES+=    _stamp.extraobjs
152 ${DFILE}: ${SRCS} _stamp.extraobjs
153 .if ${PRINTERDEVICE} == "html"
154         cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
155             document=${DOC} ${SRCS}
156 .elif defined(USE_SOELIMPP)
157         ${SOELIMPP} ${.ALLSRC:N_stamp.extraobjs} | ${ROFF} | \
158             ${DCOMPRESS_CMD} > ${.TARGET}
159 .else
160         (cd ${SRCDIR}; ${ROFF} ${.ALLSRC:N_stamp.extraobjs}) | \
161             ${DCOMPRESS_CMD} > ${.TARGET}
162 .endif
163 .endif
164
165 .if !target(maninstall)
166 maninstall:
167 .endif
168
169 .if !target(regress)
170 regress:
171 .endif
172
173 .include <bsd.obj.mk>