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