File: Makefile-csug.in

package info (click to toggle)
chezscheme 9.5.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 61,640 kB
  • sloc: ansic: 17,508; sh: 759; makefile: 509; csh: 423
file content (159 lines) | stat: -rw-r--r-- 4,938 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
m = $(m)
Scheme=../$m/bin/$m/scheme -b ../$m/boot/$m/petite.boot -b ../$m/boot/$m/scheme.boot
STEXLIB=../stex
installdir=/tmp/csug9.5
INSTALL=../$m/installsh

x = csug
latex = pdflatex
stexmacrofiles = tspl4-prep
bib = $(x).bib
index=yes
TSPL=tspl4
DIR=$(shell basename `pwd`)

target: logcheck1 logcheck2 checklibs $(x).html $(x).pdf

install: target
	$(INSTALL) -m 2755 -d $(installdir)
	$(INSTALL) -m 0644 --ifdiff *.html *.css $(installdir)
	$(INSTALL) -m 0644 --ifdiff csug.pdf $(installdir)/csug9_5.pdf
	$(INSTALL) -m 2755 -d $(installdir)/canned
	$(INSTALL) -m 0644 --ifdiff canned/* $(installdir)/canned
	$(INSTALL) -m 2755 -d $(installdir)/gifs
	$(INSTALL) -m 0644 --ifdiff gifs/*.gif $(installdir)/gifs
	$(INSTALL) -m 2755 -d $(installdir)/$(mathdir)
	$(INSTALL) -m 0644 --ifdiff $(mathdir)/*.gif $(installdir)/$(mathdir)
	(cd $(installdir); ln -s -f $(x).html index.html)

# thrice is not enough when starting from scratch
logcheck1: $(x).thirdrun
	@if [ -n "`grep 'Warning: Label(s) may have changed' $(x).log`" ] ; then\
            /bin/rm -f $(x).thirdrun ;\
            $(MAKE) $(x).thirdrun;\
         fi

rerun: $(x).thirdrun

logcheck2: $(x).thirdrun
	@if [ -n "`grep Warning $(x).log | grep -v pdftex.map`" ] ; then\
            echo "`grep Warning $(x).log | grep -v pdftex.map`";\
            false;\
         fi
	@if [ -n "`grep Overfull $(x).log | grep -v pdftex.map`" ] ; then\
            echo "`grep Overfull $(x).log | grep -v pdftex.map`";\
            false;\
         fi

include $(STEXLIB)/Mf-stex

stexsrc = csug.stex title.stex copyright.stex contents.stex\
 preface.stex intro.stex use.stex expeditor.stex debug.stex foreign.stex\
 binding.stex control.stex objects.stex numeric.stex io.stex\
 libraries.stex syntax.stex system.stex smgmt.stex threads.stex\
 compat.stex bibliography.stex summary.stex
texsrc = ${stexsrc:%.stex=%.tex}

title.tex contents.tex bibliography.tex:
	/bin/rm -f $*.tex
	echo "%%% DO NOT EDIT THIS FILE" > $*.tex
	echo "%%% Edit the .stex version instead" >> $*.tex
	echo "" >> $*.tex
	cat $*.stex >> $*.tex
	chmod -w $*.tex
title.tex: title.stex
contents.tex: contents.stex
bibliography.tex: bibliography.stex

$(x).firstrun: $(x).prefirstrun
$(x).prefirstrun: tspl.aux tspl.rfm tspl.idx
	touch $x.sfm
	cat tspl.aux > $x.aux
	cat tspl.rfm > $x.rfm
	cat tspl.idx > $x.idx
	touch $(x).prefirstrun

$(x).secondrun: $(x).presecondrun
$(x).presecondrun: $(x).firstrun
	cat tspl.aux >> $x.aux
	cat tspl.rfm >> $x.rfm
	echo '(summary-make "$x")' | $(Scheme) setup.ss summary.ss
	cat tspl.idx >> $x.idx
	touch $(x).presecondrun

$(x).thirdrun: $(x).prethirdrun
$(x).prethirdrun: $(x).secondrun
	cat tspl.aux >> $x.aux
	cat tspl.rfm >> $x.rfm
	echo '(summary-make "$x")' | $(Scheme) setup.ss summary.ss
	cat tspl.idx >> $x.idx
	touch $(x).prethirdrun

$(x).hfirstrun: $(x).hprefirstrun csug8.hcls
$(x).hprefirstrun: $(x).thirdrun tspl.haux in.hidx
	cat tspl.aux >> $x.aux
	cat tspl.rfm >> $x.rfm
	cat tspl.idx >> $x.idx
	cat tspl.haux > $x.haux
	touch $(x).hprefirstrun

$(x).hsecondrun: $(x).hpresecondrun
$(x).hpresecondrun: $(x).hfirstrun
	cat tspl.haux >> $x.haux
	touch $(x).hpresecondrun

$(x).hthirdrun: $(x).hprethirdrun
$(x).hprethirdrun: $(x).hsecondrun
	cat tspl.haux >> $x.haux
	touch $(x).hprethirdrun

$(x).prefirstrun: $(texsrc) csug8.cls csug810.clo

$(x).firstrun: scheme.sty

tspl.aux: ${TSPL}/tspl.aux
	cat ${TSPL}/*.aux | grep '\\newlabel' | \
         sed -e 's/\\newlabel{\(.*\){\([^}]*\)}}/\\newlabel{TSPL:\1{t\2}}/' > tspl.aux

tspl.haux: ${TSPL}/tspl.haux
	sed -e 's/(putprop (quote /(putprop (quote |TSPL|:/' ${TSPL}/tspl.haux | \
         sed -e 's;url) ";url) "http://scheme.com/${TSPL}/;' > tspl.haux

tspl.rfm: ${TSPL}/tspl.rfm
	sed -e 's/\\pageref{/\\pageref{TSPL:/' ${TSPL}/tspl.rfm > tspl.rfm

# this version leaves tspl entries out of the printed index
#tspl.idx:
#	echo -n > tspl.idx

# this version includes tspl entries in the printed index
tspl.idx: ${TSPL}/tspl.idx
	sed -e 's/{\([1-9][0-9]*\)}$$/{t\1}/' ${TSPL}/tspl.idx | \
         sed -e 's/{\([ivx][ivx]*\)}$$/{t\1}/' > tspl.idx

in.hidx: ${TSPL}/out.hidx
	sed -e 's;"\(.*\)\.html#;"http://scheme.com/${TSPL}/\1.html#;' ${TSPL}/out.hidx | \
         sed -e 's/"")$$/"t")/' > in.hidx

$(texsrc): tspl4-prep.stex priminfo.ss ../s/primdata.ss

checklibs: $(x).thirdrun
	sort libsrecorded | uniq > libsrecorded.sort
	sort libslisted | uniq > libslisted.sort
	diff libsrecorded.sort libslisted.sort

code: $(stexsrc)
	extract.pl $(stexsrc) > code
	echo '(load "code" pretty-print)' | $(Scheme) -q

$(x).clean:
	-/bin/rm -f $(x).rfm $(x).sfm $(x).prefirstrun $(x).presecondrun\
                    $(x).prethirdrun $(x).ans\
                    $(x).hprefirstrun $(x).hpresecondrun $(x).hprethirdrun\
                    tspl.aux tspl.haux tspl.rfm tspl.idx in.hidx\
                    libsrecorded{,.sort} libslisted{,.sort}\
                    code

$(x).reallyclean:

$(x).reallyreallyclean: