Deleted Added
full compact
bsd.doc.mk (290773) bsd.doc.mk (296121)
1# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
1# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
2# $FreeBSD: head/share/mk/bsd.doc.mk 290773 2015-11-13 17:27:23Z bdrewery $
2# $FreeBSD: head/share/mk/bsd.doc.mk 296121 2016-02-26 22:13:48Z bdrewery $
3#
4# The include file <bsd.doc.mk> handles installing BSD troff documents.
5#
6#
7# +++ variables +++
8#
9# DCOMPRESS_CMD Program to compress troff documents. Output is to stdout.
10# [${COMPRESS_CMD}]
11#
12# DESTDIR Change the tree where the documents get installed. [not set]
13#
14# DOC Document name. [paper]
15#
16# EXTRA Extra files (not SRCS) that make up the document. [not set]
17#
18# LPR Printer command. [lpr]
19#
20# MACROS Macro packages used to build the document. [not set]
21#
22# WITHOUT_DOCCOMPRESS If you do not want formatted troff documents to be
23# compressed when they are installed. [not set]
24#
25# PRINTERDEVICE Indicates which output formats will be generated
26# (ascii, ps, html). [ascii]
27#
28# SRCDIR Directory where source files live. [${.CURDIR}]
29#
30# SRCS List of source files. [not set]
31#
32# TRFLAGS Additional flags to groff(1). [not set]
33#
34# USE_EQN If set, preprocess with eqn(1). [not set]
35#
36# USE_PIC If set, preprocess with pic(1). [not set]
37#
38# USE_REFER If set, preprocess with refer(1). [not set]
39#
40# USE_SOELIM If set, preprocess with soelim(1). [not set]
41#
42# USE_TBL If set, preprocess with tbl(1). [not set]
43#
44# VOLUME Volume the document belongs to. [not set]
45
46.include <bsd.init.mk>
47
48PRINTERDEVICE?= ascii
49
50BIB?= bib
51GREMLIN?= grn
52GRIND?= vgrind -f
53INDXBIB?= indxbib
54PIC?= pic
55REFER?= refer
56.for _dev in ${PRINTERDEVICE:Mascii}
57ROFF.ascii?= groff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
58.endfor
59.for _dev in ${PRINTERDEVICE:Nascii}
60ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
61.endfor
62SOELIM?= soelim
63TBL?= tbl
64
65DOC?= paper
66LPR?= lpr
67
68.if defined(USE_EQN)
69TRFLAGS+= -e
70.endif
71.if defined(USE_PIC)
72TRFLAGS+= -p
73.endif
74.if defined(USE_REFER)
75TRFLAGS+= -R
76.endif
77.if defined(USE_SOELIM)
78TRFLAGS+= -I${.CURDIR}
79.endif
80.if defined(USE_TBL)
81TRFLAGS+= -t
82.endif
83
84DCOMPRESS_EXT?= ${COMPRESS_EXT}
85DCOMPRESS_CMD?= ${COMPRESS_CMD}
86.for _dev in ${PRINTERDEVICE:Mhtml}
87DFILE.html= ${DOC}.html
88.endfor
89.for _dev in ${PRINTERDEVICE:Nhtml}
90.if ${MK_DOCCOMPRESS} == "no"
91DFILE.${_dev}= ${DOC}.${_dev}
92.else
93DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT}
94.endif
95.endfor
96
97UNROFF?= unroff
98HTML_SPLIT?= yes
99UNROFFFLAGS?= -fhtml
100.if ${HTML_SPLIT} == "yes"
101UNROFFFLAGS+= split=1
102.endif
103
104# Compatibility mode flag for groff. Use this when formatting documents with
105# Berkeley me macros (orig_me(7)).
106COMPAT?= -C
107
108.PATH: ${.CURDIR} ${SRCDIR}
109
3#
4# The include file <bsd.doc.mk> handles installing BSD troff documents.
5#
6#
7# +++ variables +++
8#
9# DCOMPRESS_CMD Program to compress troff documents. Output is to stdout.
10# [${COMPRESS_CMD}]
11#
12# DESTDIR Change the tree where the documents get installed. [not set]
13#
14# DOC Document name. [paper]
15#
16# EXTRA Extra files (not SRCS) that make up the document. [not set]
17#
18# LPR Printer command. [lpr]
19#
20# MACROS Macro packages used to build the document. [not set]
21#
22# WITHOUT_DOCCOMPRESS If you do not want formatted troff documents to be
23# compressed when they are installed. [not set]
24#
25# PRINTERDEVICE Indicates which output formats will be generated
26# (ascii, ps, html). [ascii]
27#
28# SRCDIR Directory where source files live. [${.CURDIR}]
29#
30# SRCS List of source files. [not set]
31#
32# TRFLAGS Additional flags to groff(1). [not set]
33#
34# USE_EQN If set, preprocess with eqn(1). [not set]
35#
36# USE_PIC If set, preprocess with pic(1). [not set]
37#
38# USE_REFER If set, preprocess with refer(1). [not set]
39#
40# USE_SOELIM If set, preprocess with soelim(1). [not set]
41#
42# USE_TBL If set, preprocess with tbl(1). [not set]
43#
44# VOLUME Volume the document belongs to. [not set]
45
46.include <bsd.init.mk>
47
48PRINTERDEVICE?= ascii
49
50BIB?= bib
51GREMLIN?= grn
52GRIND?= vgrind -f
53INDXBIB?= indxbib
54PIC?= pic
55REFER?= refer
56.for _dev in ${PRINTERDEVICE:Mascii}
57ROFF.ascii?= groff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
58.endfor
59.for _dev in ${PRINTERDEVICE:Nascii}
60ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
61.endfor
62SOELIM?= soelim
63TBL?= tbl
64
65DOC?= paper
66LPR?= lpr
67
68.if defined(USE_EQN)
69TRFLAGS+= -e
70.endif
71.if defined(USE_PIC)
72TRFLAGS+= -p
73.endif
74.if defined(USE_REFER)
75TRFLAGS+= -R
76.endif
77.if defined(USE_SOELIM)
78TRFLAGS+= -I${.CURDIR}
79.endif
80.if defined(USE_TBL)
81TRFLAGS+= -t
82.endif
83
84DCOMPRESS_EXT?= ${COMPRESS_EXT}
85DCOMPRESS_CMD?= ${COMPRESS_CMD}
86.for _dev in ${PRINTERDEVICE:Mhtml}
87DFILE.html= ${DOC}.html
88.endfor
89.for _dev in ${PRINTERDEVICE:Nhtml}
90.if ${MK_DOCCOMPRESS} == "no"
91DFILE.${_dev}= ${DOC}.${_dev}
92.else
93DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT}
94.endif
95.endfor
96
97UNROFF?= unroff
98HTML_SPLIT?= yes
99UNROFFFLAGS?= -fhtml
100.if ${HTML_SPLIT} == "yes"
101UNROFFFLAGS+= split=1
102.endif
103
104# Compatibility mode flag for groff. Use this when formatting documents with
105# Berkeley me macros (orig_me(7)).
106COMPAT?= -C
107
108.PATH: ${.CURDIR} ${SRCDIR}
109
110.if !defined(_SKIP_BUILD)
110.for _dev in ${PRINTERDEVICE}
111all: ${DFILE.${_dev}}
112.endfor
111.for _dev in ${PRINTERDEVICE}
112all: ${DFILE.${_dev}}
113.endfor
114.endif
113
114.if !target(print)
115.for _dev in ${PRINTERDEVICE}
116print: ${DFILE.${_dev}}
117.endfor
118print:
119.for _dev in ${PRINTERDEVICE}
120.if ${MK_DOCCOMPRESS} == "no"
121 ${LPR} ${DFILE.${_dev}}
122.else
123 ${DCOMPRESS_CMD} -d ${DFILE.${_dev}} | ${LPR}
124.endif
125.endfor
126.endif
127
128.for _dev in ${PRINTERDEVICE:Nascii:Nps:Nhtml}
129CLEANFILES+= ${DOC}.${_dev} ${DOC}.${_dev}${DCOMPRESS_EXT}
130.endfor
131CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
132 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
133 ${DOC}.html ${DOC}-*.html
134
135realinstall:
136.if ${PRINTERDEVICE:Mhtml}
137 cd ${SRCDIR}; \
138 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
139 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}/
140.endif
141.for _dev in ${PRINTERDEVICE:Nhtml}
142 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
143 ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}/
144.endfor
145
146spell: ${SRCS}
147 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \
148 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
149
150BINDIR?= /usr/share/doc
151BINMODE= 444
152
153SRCDIR?= ${.CURDIR}
154
155.if defined(EXTRA) && !empty(EXTRA)
156_stamp.extra: ${EXTRA}
157 touch ${.TARGET}
158.endif
159
160CLEANFILES+= _stamp.extra
161.for _dev in ${PRINTERDEVICE:Nhtml}
162.if !target(${DFILE.${_dev}})
163.if target(_stamp.extra)
164${DFILE.${_dev}}: _stamp.extra
165.endif
166${DFILE.${_dev}}: ${SRCS}
167.if ${MK_DOCCOMPRESS} == "no"
168 ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} > ${.TARGET}
169.else
170 ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET}
171.endif
172.endif
173.endfor
174
175.for _dev in ${PRINTERDEVICE:Mhtml}
176.if !target(${DFILE.html})
177.if target(_stamp.extra)
178${DFILE.html}: _stamp.extra
179.endif
180${DFILE.html}: ${SRCS}
181.if defined(MACROS) && !empty(MACROS)
182 cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
183 document=${DOC} ${SRCS}
184.else # unroff(1) requires a macro package as an argument
185 cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
186 document=${DOC} ${SRCS}
187.endif
188.endif
189.endfor
190
191DISTRIBUTION?= doc
192
193.include <bsd.obj.mk>
115
116.if !target(print)
117.for _dev in ${PRINTERDEVICE}
118print: ${DFILE.${_dev}}
119.endfor
120print:
121.for _dev in ${PRINTERDEVICE}
122.if ${MK_DOCCOMPRESS} == "no"
123 ${LPR} ${DFILE.${_dev}}
124.else
125 ${DCOMPRESS_CMD} -d ${DFILE.${_dev}} | ${LPR}
126.endif
127.endfor
128.endif
129
130.for _dev in ${PRINTERDEVICE:Nascii:Nps:Nhtml}
131CLEANFILES+= ${DOC}.${_dev} ${DOC}.${_dev}${DCOMPRESS_EXT}
132.endfor
133CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
134 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
135 ${DOC}.html ${DOC}-*.html
136
137realinstall:
138.if ${PRINTERDEVICE:Mhtml}
139 cd ${SRCDIR}; \
140 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
141 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}/
142.endif
143.for _dev in ${PRINTERDEVICE:Nhtml}
144 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
145 ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}/
146.endfor
147
148spell: ${SRCS}
149 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \
150 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
151
152BINDIR?= /usr/share/doc
153BINMODE= 444
154
155SRCDIR?= ${.CURDIR}
156
157.if defined(EXTRA) && !empty(EXTRA)
158_stamp.extra: ${EXTRA}
159 touch ${.TARGET}
160.endif
161
162CLEANFILES+= _stamp.extra
163.for _dev in ${PRINTERDEVICE:Nhtml}
164.if !target(${DFILE.${_dev}})
165.if target(_stamp.extra)
166${DFILE.${_dev}}: _stamp.extra
167.endif
168${DFILE.${_dev}}: ${SRCS}
169.if ${MK_DOCCOMPRESS} == "no"
170 ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} > ${.TARGET}
171.else
172 ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET}
173.endif
174.endif
175.endfor
176
177.for _dev in ${PRINTERDEVICE:Mhtml}
178.if !target(${DFILE.html})
179.if target(_stamp.extra)
180${DFILE.html}: _stamp.extra
181.endif
182${DFILE.html}: ${SRCS}
183.if defined(MACROS) && !empty(MACROS)
184 cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
185 document=${DOC} ${SRCS}
186.else # unroff(1) requires a macro package as an argument
187 cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
188 document=${DOC} ${SRCS}
189.endif
190.endif
191.endfor
192
193DISTRIBUTION?= doc
194
195.include <bsd.obj.mk>