xref: /csrg-svn/old/lisp/PSD.doc/Makefile (revision 34676)
127613Scuccia#
227613Scuccia# Copyright (c) 1986 Regents of the University of California.
327613Scuccia# All rights reserved.  The Berkeley software License Agreement
427613Scuccia# specifies the terms and conditions for redistribution.
527613Scuccia#
6*34676Skarels#	@(#)Makefile	6.4 (Berkeley) 06/08/88
727613Scuccia#
827613Scuccia# $Header: Makefile 1.4 83/07/21 21:27:16 sklower Exp $
927613Scuccia#	makefile for the franz lisp manual
1027613Scuccia#
1128152Sbloom# sources: ${MacroSrc}: macros for the franz documents
1228152Sbloom#	   ${TMacSrc}: macros for typesetting franz documents
1327613Scuccia#	   ch1.n  intro and description of types
1427613Scuccia#	   ch2.n  data structure access
1527613Scuccia#	   ch3.n  on arithmetic functions.
1627613Scuccia#	   ch4.n  special functions.
1727613Scuccia#	   ch5.n  i/o
1827613Scuccia#	   ch6.n  system functions
1927613Scuccia#	   ch7.n  reader
2027613Scuccia#	   ch8.n  functions and macros
2127613Scuccia#	   ch9.n  arrays
2227613Scuccia#	   ch10.n exception handling
2327613Scuccia#	   ch11.n trace package
2427613Scuccia#	   ch12.n liszt
2527613Scuccia#	   ch13.n cmu top level
2627613Scuccia#	   ch14.n stepper
2727613Scuccia#	   ch15.n fixit package
2827613Scuccia#	   ch16.n lisp editor
2928150Sbloom#	   ch17.n hash tables
3027613Scuccia#	   chb.n special symbols
3127613Scuccia#	   chc.n  short subjects
3227613Scuccia
3327613Scuccia
3427613Scuccia.SUFFIXES: .n .t .x .v .r .rx .q .qx .sp
3527613Scuccia
3627613Scuccia# the syntax's have this meaning:
3727613Scuccia#  .n  nroff/troff source file
3827613Scuccia#  .t  troff output file, can be vpr -t 'ed
3927613Scuccia#  .x  index file from a troff run, when collected and run through troff
4027613Scuccia#	again, an index is produced.
4127613Scuccia#  .v  this file never exists, but asking for it will cause a .t file to
4227613Scuccia#	be created and then vpr'ed.  the .t file will not be deleted.
4327613Scuccia#  .p  this file also never exists, but asking for it will cause TROFF
4427613Scuccia#	(usually vtroff or itroff) to be run directly on the file, leaving
4527613Scuccia#	no .t around.  This is used in /usr/doc for people who want to
4627613Scuccia#	run off a manual and are too lazy to read this makefile.
4727613Scuccia#  .r  nroff output file.
4827613Scuccia#  .rx  special index output from nroff run.  These files should be catted
4927613Scuccia#       together and then left around for lisp to read when given the help
5027613Scuccia#	command.
5127613Scuccia#
5227613Scuccia#  .q  nroff output file compatible with model 37
5327613Scuccia#  .qx index file for .q files.
5427613Scuccia#
5527613Scuccia#  .sp spell errors
5627613Scuccia#
5727613Scuccia# make install will install the nroff versions of the manual in the
5827613Scuccia# directory (LibDir/manual) where the auxfns0.l help command can find them.
5927613Scuccia#
6027613ScucciaLibDir = /usr/lib/lisp
6127613ScucciaCcodeDir = ../franz
6227613ScucciaCopyTo = /dev/null
6327613ScucciaTROFF=	ditroff
6427613ScucciaTBL=	dtbl
6527613ScucciaNROFF=  nroff
6628150SbloomPRINTER = -Pdp
6728150SbloomO =
6827613ScucciaAppend = ${LibDir}/append
6927613Scuccia# Rmt = is unecessary; you can say, make rall NROFF="'dali nroff'".
7027613Scuccia# better to just copy the doc directory to the remote machine and
7127613Scuccia# run it all there.
7227613Scuccia
7327613Scuccia#--- Sources:
7427613Scuccia#	We use the suffixes to tell make how to make a file.  Thus
7527613Scuccia#  we only specify the root and let the append function add the
7627613Scuccia#  appropriate suffix.
7727613Scuccia
7827613ScucciaMacroSrc = lmacs
7928152SbloomTMacSrc = tmacs
8027613Scuccia
8127613ScucciaRootGenSrc = ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch61 ch7 ch8 \
8227613Scuccia      ch9 ch10 ch11 ch12 ch13 ch14 ch15 ch16 ch17 chb chc
8327613Scuccia
8428150SbloomDocSrc= ch0.n ch1.n ch2.n ch3.n ch4.n ch5.n ch6.n ch7.n ch8.n \
8528150Sbloom	ch9.n ch10.n ch11.n ch12.n ch13.n ch14.n ch15.n ch16.n ch17.n
8628150Sbloom
8728150SbloomDocApp= chb.n chc.n
8828150Sbloom
8927613ScucciaUtilSrc = Makefile indexsed mantags extrnames.awk fixmks.sed \
9027613Scuccia	franz.n
9127613Scuccia
9227613Scuccia#-- can't get a expression for all source at make read time. must use
9327613Scuccia#   append to add .n to RootGenSrc
9427613Scuccia
9527613Scuccia
9628150Sbloomdoc: paper app
9728150Sbloom
9828150Sbloompaper:	paper.${PRINTER}
9928150Sbloom	lpr ${PRINTER} -n paper.${PRINTER}
10028150Sbloom
10128152Sbloompaper.${PRINTER}: ${DocSrc} ${TMacSrc}
10228152Sbloom	${TBL} ${PRINTER} ${TMacSrc} ${DocSrc} | \
10328150Sbloom		${TROFF} -t -me 1> paper.${PRINTER} 2> tindex
10428150Sbloom
10528150Sbloomapp: app.${PRINTER}
10628150Sbloom	lpr ${PRINTER} -n app.${PRINTER}
10728150Sbloom
10828152Sbloomapp.${PRINTER}: tindex ${TMacSrc} ${DocApp}
10928150Sbloom	echo ".Ib" | sort +2 tindex - | sed -f indexsed | \
11028152Sbloom		${TROFF} -t -me ${TMacSrc} - ${DocApp} > app.${PRINTER}
11128150Sbloom
112*34676Skarelsall: rall
11327613Scuccia
11427613Scucciarall: ${Append}
11527613Scuccia	make NROFF=${NROFF} O=${O} `${Append} .r ${RootGenSrc}` helpindex
11627613Scuccia
11727613Scucciavall: ${Append}
11827613Scuccia	make TROFF=${TROFF} O=${O} `${Append} .v ${RootGenSrc}` index.v
11927613Scuccia
12027613Scucciatall: ${Append}
12127613Scuccia	make TROFF=${TROFF} O=${O} `${Append} .t ${RootGenSrc}` index.t
12227613Scuccia
12327613Scucciacctall:
12427613Scuccia	make TROFF="troff -s12" tall
12527613Scuccia
12627613Scucciapall: ${Append}
12727613Scuccia	make TROFF=${TROFF} O=${O} `${Append} .p ${RootGenSrc}` pindex
12827613Scuccia
12927613Scucciatroff: pall
13027613Scuccia
13127613Scucciaqall: ${Append}
13227613Scuccia	make NROFF=${NROFF} O=${O} `${Append} .q ${RootGenSrc}` index.t
13327613Scuccia
13427613Scucciaspall: ${Append}
13527613Scuccia	make TROFF=${TROFF} O=${O} `${Append} .q ${RootGenSrc}` index.t
13627613Scuccia
13727613Scuccia# only a few files describe functions which are indexed.
13827613Scuccia
13927613Scuccia.t.v:
14028150Sbloom	lpr ${PRINTER} -n $*.t
14127613Scuccia
14227613Scuccia.n.t:
14328152Sbloom	${TBL} ${PRINTER} ${MacroSrc} $*.n | \
14428150Sbloom		${TROFF} -me ${O} ${PRINTER} -t 1> $*.t 2> $*.x
14527613Scuccia
14627613Scuccia.n.p:
14728152Sbloom	${TBL} ${PRINTER} ${MacroSrc} $*.n | ${TROFF} -me ${O} ${PRINTER} 2> $*.x
14827613Scuccia
14927613Scuccia.n.x:
15028152Sbloom	${TBL} ${PRINTER} ${MacroSrc} $*.n | ${TROFF} -me ${O} ${PRINTER} -z 2> $*.x
15127613Scuccia
15227613Scuccia.n.r:
15328152Sbloom	tbl ${MacroSrc} $*.n | ${NROFF} -rb3 -me ${O} 1> $*.r 2> $*.rx
15427613Scuccia	rm -f helpindex
15527613Scuccia
15627613Scuccia.n.rx:
15728152Sbloom	tbl ${MacroSrc} $*.n | ${NROFF} -rb3 -me ${O} 1> $*.r 2> $*.rx
15827613Scuccia	rm -f helpindex
15927613Scuccia
16027613Scuccia.n.q:
16128152Sbloom	tbl ${MacroSrc} $*.n | ${NROFF} -me -T37 ${O} 2> $*.qx | col > $*.q
16227613Scuccia
16327613Scuccia.n.sp:
16427613Scuccia	spell $*.n > $*.sp
16527613Scuccia
166*34676Skarelsinstall: rall
167*34676Skarels	-mkdir ${LibDir}/manual
16827613Scuccia	cp `${Append} .r ${RootGenSrc}` helpindex ${LibDir}/manual
16927613Scuccia
17027613Scucciaclean:
17128150Sbloom	-rm -f paper.-[PT]* app.-[PT]* errs Errs make.out
17227613Scuccia	-rm -f *.r
17327613Scuccia	-rm -f *.rx
17427613Scuccia	-rm -f helpindex
17528150Sbloom	-rm -f tindex
17627613Scuccia	-rm -f *.t
17727613Scuccia	-rm -f *.q
17827613Scuccia	-rm -f *.x
17927613Scuccia
18027613Scuccia
18127613Scucciafindex:  ${Append}
18227613Scuccia	make `${Append} .x ${RootGenSrc}`
18327613Scuccia	echo ".Ib" > index
18427613Scuccia	sort +3 -o index index `${Append} .x ${RootGenSrc}`
18527613Scuccia	sed -f indexsed index > indexx
18628152Sbloom	${Rmt} ${TROFF} -me ${MacroSrc} indexx
18727613Scuccia
18827613Scucciaindex.t:
18927613Scuccia	make `${Append} .x ${RootGenSrc}`
19027613Scuccia	echo ".Ib" > index
19127613Scuccia	sort +3 -o index index `${Append} .x ${RootGenSrc}`
19227613Scuccia	sed -f indexsed index > indexx
19328152Sbloom	${TROFF} -me -x -t ${MacroSrc} indexx > index.t
19427613Scuccia
19527613Scucciapindex: ${Append}
19627613Scuccia	make `${Append} .x ${RootGenSrc}`
19727613Scuccia	echo ".Ib" > index
19827613Scuccia	sort +3 -o index index `${Append} .x ${RootGenSrc}`
19927613Scuccia	sed -f indexsed index > indexx
20028152Sbloom	${TROFF} -me ${MacroSrc} indexx
20127613Scuccia
20227613Scucciahelpindex: ${Append}
20327613Scuccia	make `${Append} .rx ${RootGenSrc}`
20427613Scuccia	cat `${Append} .rx ${RootGenSrc}` | tr '\227' ' ' > helpindex
20527613Scuccia
20627613Scucciatags:	/dev/tty ${Append}
20727613Scuccia	awk -f mantags `${Append} .n ${RootGenSrc}` | sort > tags
20827613Scuccia
20927613Scuccia
21027613Scuccia${Append}:
21127613Scuccia	(cd ../utils  ; make LibDir=${LibDir} ${Append})
21227613Scuccia
21327613Scuccia# to create a database for lxref to use:
21427613ScucciaC-database: ${CcodeDir}/sysat.c
21527613Scuccia	grep "^	MK" ${CcodeDir}/sysat.c > mks
21627613Scuccia	sed -f fixmks.sed < mks > mks.fixed
21727613Scuccia	(echo "(Chome)" ; cat mks.fixed ) > C-database
21827613Scuccia	rm -f mks mks.fixed
21927613Scuccia
22027613Scucciadoc-database:
22127613Scuccia	awk -f extrnames.awk `${Append} .n ${RootGenSrc}`\
22227613Scuccia 	   | sed -f fixmks.sed > doc-database
22327613Scuccia
22427613Scuccia
22527613Scucciabigxref: C-database doc-database
22627613Scuccia	${Append} -p ${LibDir}/ `(cd ${LibDir} ; make echorequired)` | \
22727613Scuccia		sed 's/\.l/.x/g' > lisplibfiles
22827613Scuccia	lxref doc-database  C-database  `cat lisplibfiles` > bigxref
22927613Scuccia
23027613Scuccia# simple table of contents, just a listing of which function is
23127613Scuccia# documented in which chapter
23227613Scucciatofc:
23327613Scuccia	egrep "^.Lc|^.Lf|^.Lx|^.sh" `${Append} .n  ${RootGenSrc}` > tofc
23427613Scuccia
23527613Scuccia
23627613Scucciacopysource:
23728152Sbloom	(tar cf - ${MacroSrc} ${TMacSrc} `${Append} .n ${RootGenSrc}` \
23828152Sbloom		${UtilSrc} | (cd ${CopyTo} ; tar xf -))
23927613Scuccia
24027613Scucciascriptcatall: ${AllSrc} ${Append}
24127613Scuccia	@(cd .. ; scriptcat doc doc ${MacroSrc} `${Append} .n ${RootGenSrc}` ${UtilSrc})
24227613Scuccia	@(cd .. ; scriptcat doc lisplib/manual \
24327613Scuccia	      `${Append} .r ${RootGenSrc}` helpindex)
24427613Scuccia
24527613Scucciacopymanual: ${Append}
24627613Scuccia	( cd ${FromDir}/manual ; \
24727613Scuccia	  cp `${Append} .r ${RootGenSrc}` helpindex ${CopyTo})
24827613Scuccia
24927613Scuccia
250