xref: /original-bsd/old/lisp/PSD.doc/Makefile (revision 2008b8f0)
1#
2# Copyright (c) 1986 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)Makefile	6.4 (Berkeley) 06/08/88
7#
8# $Header: Makefile 1.4 83/07/21 21:27:16 sklower Exp $
9#	makefile for the franz lisp manual
10#
11# sources: ${MacroSrc}: macros for the franz documents
12#	   ${TMacSrc}: macros for typesetting franz documents
13#	   ch1.n  intro and description of types
14#	   ch2.n  data structure access
15#	   ch3.n  on arithmetic functions.
16#	   ch4.n  special functions.
17#	   ch5.n  i/o
18#	   ch6.n  system functions
19#	   ch7.n  reader
20#	   ch8.n  functions and macros
21#	   ch9.n  arrays
22#	   ch10.n exception handling
23#	   ch11.n trace package
24#	   ch12.n liszt
25#	   ch13.n cmu top level
26#	   ch14.n stepper
27#	   ch15.n fixit package
28#	   ch16.n lisp editor
29#	   ch17.n hash tables
30#	   chb.n special symbols
31#	   chc.n  short subjects
32
33
34.SUFFIXES: .n .t .x .v .r .rx .q .qx .sp
35
36# the syntax's have this meaning:
37#  .n  nroff/troff source file
38#  .t  troff output file, can be vpr -t 'ed
39#  .x  index file from a troff run, when collected and run through troff
40#	again, an index is produced.
41#  .v  this file never exists, but asking for it will cause a .t file to
42#	be created and then vpr'ed.  the .t file will not be deleted.
43#  .p  this file also never exists, but asking for it will cause TROFF
44#	(usually vtroff or itroff) to be run directly on the file, leaving
45#	no .t around.  This is used in /usr/doc for people who want to
46#	run off a manual and are too lazy to read this makefile.
47#  .r  nroff output file.
48#  .rx  special index output from nroff run.  These files should be catted
49#       together and then left around for lisp to read when given the help
50#	command.
51#
52#  .q  nroff output file compatible with model 37
53#  .qx index file for .q files.
54#
55#  .sp spell errors
56#
57# make install will install the nroff versions of the manual in the
58# directory (LibDir/manual) where the auxfns0.l help command can find them.
59#
60LibDir = /usr/lib/lisp
61CcodeDir = ../franz
62CopyTo = /dev/null
63TROFF=	ditroff
64TBL=	dtbl
65NROFF=  nroff
66PRINTER = -Pdp
67O =
68Append = ${LibDir}/append
69# Rmt = is unecessary; you can say, make rall NROFF="'dali nroff'".
70# better to just copy the doc directory to the remote machine and
71# run it all there.
72
73#--- Sources:
74#	We use the suffixes to tell make how to make a file.  Thus
75#  we only specify the root and let the append function add the
76#  appropriate suffix.
77
78MacroSrc = lmacs
79TMacSrc = tmacs
80
81RootGenSrc = ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch61 ch7 ch8 \
82      ch9 ch10 ch11 ch12 ch13 ch14 ch15 ch16 ch17 chb chc
83
84DocSrc= ch0.n ch1.n ch2.n ch3.n ch4.n ch5.n ch6.n ch7.n ch8.n \
85	ch9.n ch10.n ch11.n ch12.n ch13.n ch14.n ch15.n ch16.n ch17.n
86
87DocApp= chb.n chc.n
88
89UtilSrc = Makefile indexsed mantags extrnames.awk fixmks.sed \
90	franz.n
91
92#-- can't get a expression for all source at make read time. must use
93#   append to add .n to RootGenSrc
94
95
96doc: paper app
97
98paper:	paper.${PRINTER}
99	lpr ${PRINTER} -n paper.${PRINTER}
100
101paper.${PRINTER}: ${DocSrc} ${TMacSrc}
102	${TBL} ${PRINTER} ${TMacSrc} ${DocSrc} | \
103		${TROFF} -t -me 1> paper.${PRINTER} 2> tindex
104
105app: app.${PRINTER}
106	lpr ${PRINTER} -n app.${PRINTER}
107
108app.${PRINTER}: tindex ${TMacSrc} ${DocApp}
109	echo ".Ib" | sort +2 tindex - | sed -f indexsed | \
110		${TROFF} -t -me ${TMacSrc} - ${DocApp} > app.${PRINTER}
111
112all: rall
113
114rall: ${Append}
115	make NROFF=${NROFF} O=${O} `${Append} .r ${RootGenSrc}` helpindex
116
117vall: ${Append}
118	make TROFF=${TROFF} O=${O} `${Append} .v ${RootGenSrc}` index.v
119
120tall: ${Append}
121	make TROFF=${TROFF} O=${O} `${Append} .t ${RootGenSrc}` index.t
122
123cctall:
124	make TROFF="troff -s12" tall
125
126pall: ${Append}
127	make TROFF=${TROFF} O=${O} `${Append} .p ${RootGenSrc}` pindex
128
129troff: pall
130
131qall: ${Append}
132	make NROFF=${NROFF} O=${O} `${Append} .q ${RootGenSrc}` index.t
133
134spall: ${Append}
135	make TROFF=${TROFF} O=${O} `${Append} .q ${RootGenSrc}` index.t
136
137# only a few files describe functions which are indexed.
138
139.t.v:
140	lpr ${PRINTER} -n $*.t
141
142.n.t:
143	${TBL} ${PRINTER} ${MacroSrc} $*.n | \
144		${TROFF} -me ${O} ${PRINTER} -t 1> $*.t 2> $*.x
145
146.n.p:
147	${TBL} ${PRINTER} ${MacroSrc} $*.n | ${TROFF} -me ${O} ${PRINTER} 2> $*.x
148
149.n.x:
150	${TBL} ${PRINTER} ${MacroSrc} $*.n | ${TROFF} -me ${O} ${PRINTER} -z 2> $*.x
151
152.n.r:
153	tbl ${MacroSrc} $*.n | ${NROFF} -rb3 -me ${O} 1> $*.r 2> $*.rx
154	rm -f helpindex
155
156.n.rx:
157	tbl ${MacroSrc} $*.n | ${NROFF} -rb3 -me ${O} 1> $*.r 2> $*.rx
158	rm -f helpindex
159
160.n.q:
161	tbl ${MacroSrc} $*.n | ${NROFF} -me -T37 ${O} 2> $*.qx | col > $*.q
162
163.n.sp:
164	spell $*.n > $*.sp
165
166install: rall
167	-mkdir ${LibDir}/manual
168	cp `${Append} .r ${RootGenSrc}` helpindex ${LibDir}/manual
169
170clean:
171	-rm -f paper.-[PT]* app.-[PT]* errs Errs make.out
172	-rm -f *.r
173	-rm -f *.rx
174	-rm -f helpindex
175	-rm -f tindex
176	-rm -f *.t
177	-rm -f *.q
178	-rm -f *.x
179
180
181findex:  ${Append}
182	make `${Append} .x ${RootGenSrc}`
183	echo ".Ib" > index
184	sort +3 -o index index `${Append} .x ${RootGenSrc}`
185	sed -f indexsed index > indexx
186	${Rmt} ${TROFF} -me ${MacroSrc} indexx
187
188index.t:
189	make `${Append} .x ${RootGenSrc}`
190	echo ".Ib" > index
191	sort +3 -o index index `${Append} .x ${RootGenSrc}`
192	sed -f indexsed index > indexx
193	${TROFF} -me -x -t ${MacroSrc} indexx > index.t
194
195pindex: ${Append}
196	make `${Append} .x ${RootGenSrc}`
197	echo ".Ib" > index
198	sort +3 -o index index `${Append} .x ${RootGenSrc}`
199	sed -f indexsed index > indexx
200	${TROFF} -me ${MacroSrc} indexx
201
202helpindex: ${Append}
203	make `${Append} .rx ${RootGenSrc}`
204	cat `${Append} .rx ${RootGenSrc}` | tr '\227' ' ' > helpindex
205
206tags:	/dev/tty ${Append}
207	awk -f mantags `${Append} .n ${RootGenSrc}` | sort > tags
208
209
210${Append}:
211	(cd ../utils  ; make LibDir=${LibDir} ${Append})
212
213# to create a database for lxref to use:
214C-database: ${CcodeDir}/sysat.c
215	grep "^	MK" ${CcodeDir}/sysat.c > mks
216	sed -f fixmks.sed < mks > mks.fixed
217	(echo "(Chome)" ; cat mks.fixed ) > C-database
218	rm -f mks mks.fixed
219
220doc-database:
221	awk -f extrnames.awk `${Append} .n ${RootGenSrc}`\
222 	   | sed -f fixmks.sed > doc-database
223
224
225bigxref: C-database doc-database
226	${Append} -p ${LibDir}/ `(cd ${LibDir} ; make echorequired)` | \
227		sed 's/\.l/.x/g' > lisplibfiles
228	lxref doc-database  C-database  `cat lisplibfiles` > bigxref
229
230# simple table of contents, just a listing of which function is
231# documented in which chapter
232tofc:
233	egrep "^.Lc|^.Lf|^.Lx|^.sh" `${Append} .n  ${RootGenSrc}` > tofc
234
235
236copysource:
237	(tar cf - ${MacroSrc} ${TMacSrc} `${Append} .n ${RootGenSrc}` \
238		${UtilSrc} | (cd ${CopyTo} ; tar xf -))
239
240scriptcatall: ${AllSrc} ${Append}
241	@(cd .. ; scriptcat doc doc ${MacroSrc} `${Append} .n ${RootGenSrc}` ${UtilSrc})
242	@(cd .. ; scriptcat doc lisplib/manual \
243	      `${Append} .r ${RootGenSrc}` helpindex)
244
245copymanual: ${Append}
246	( cd ${FromDir}/manual ; \
247	  cp `${Append} .r ${RootGenSrc}` helpindex ${CopyTo})
248
249
250