-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
413 lines (325 loc) · 12.4 KB
/
Makefile
File metadata and controls
413 lines (325 loc) · 12.4 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# Author: Maurizio Loreti, aka MLO or (HAM) I3NOO
# Work: University of Padova - Department of Physics
# Via F. Marzolo, 8 - 35131 PADOVA - Italy
# Phone: +39 (049) 827-7216 FAX: +39 (049) 827-7102
# EMail: loreti@pd.infn.it
# WWW: http://www.pd.infn.it/~loreti/mlo.html
#
######################################################################
#
# USUAL TARGETS:
# ##############
#
# - make book.ps , make book.pdf : one-block version, 1-up
# - make book2up.ps , make book2up.pdf : one-block version, 2-up
# - make book , make pdf : 50-pages blocks, 1-up
# - make 2up , make pdf2up : 40-pages blocks, 2-up
#
# "make all" is equivalent to "make book pdf"
#
######################################################################
# $Id: Makefile,v 1.14 2006/11/08 11:00:56 loreti Exp $
######################################################################
# Building rules
# ##############
%.dvi:%.tex
latex $<
while grep Rerun $*.log ; do latex $< ; done
%.ps:%.dvi
dvips -o $@ $<
%.pdf:%.dvi
dvips <$< -f -q | ps2pdf - $@
%.eps.gz:%.eps
grep > $<.bb BoundingBox $<; gzip -fv9 $<
%.pstex:%.fig
fig2dev -L pstex -m 0.73 $< $@
fig2dev -L pstex_t -m 0.73 -p $@ $< $@_t
# Commands to build the index (1-up and 2-up versions)
# ####################################################
DOIDX = makeindex -s book.ist book.idx
DOIDX2UP = makeindex -s book.ist book2up.idx
# Commands to build tabout.tex (included in the Appendix F)
# #########################################################
# /usr/soft/include and /usr/soft/lib host the include files and
# libraries of the Gnu Scientific Library (GSL)
CC = gcc
CPPFLAGS = -std=c99 -pedantic -W -Wall -O2
CFLAGS = -I/usr/soft/include
LDFLAGS = -L/usr/soft/lib -lgsl -lgslcblas -lm
OBJS = table.o
# Style file dependencies
# #######################
STYS = bsheaders.sty book.ist Makefile
# .tex files needed (not "book.tex")
# ##################################
TEX0 = definitions.tex preambolo.tex prefazione.tex \
chapter1.tex chapter2.tex chapter3.tex chapter4.tex \
chapter5.tex chapter6.tex chapter7.tex chapter8.tex \
chapter9.tex chapter10.tex chapter11.tex chapter12.tex \
chapter13.tex chaptera.tex chapterb.tex chapterc.tex \
chapterd.tex chaptere.tex chapterf.tex tabelle.tex
TEXS = $(TEX0) tabout.tex
# Figure files
# ############
# - bo.eps has been scanned from a printed copy
# - all other figures are generated by xfig with LaTeX output; the
# original files or were produced directly using xfig, or were
# generated by paw kumac macros, then processed with:
# paw >/dev/null 2>&1 -b file.kumac # generate file.eps
# pstoedit -f fig file.eps file.fig # generate file.fig
# xfig file.fig # edit file.fig
# - in the last step all text has been changed to LaTeX default font
# with the 'special' flag set.
EGZS = bo.eps.gz
FIGS = isto.pstex cumul.pstex modes.pstex maxbol.pstex istgau.pstex \
polar.pstex riget.pstex gauss.pstex cauchy.pstex binom.pstex \
poisson.pstex lognor.pstex trigau.pstex tremis.pstex stime.pstex \
chi.pstex scat.pstex student.pstex duegau.pstex runfig.pstex \
bigau1.pstex bigau2.pstex bigau3.pstex poisint.pstex \
chicdf.pstex chirid.pstex
# PostScript files (1-up version): 50-page blocks
# ###############################################
PSS = book1.ps book2.ps book3.ps book4.ps book5.ps book6.ps book7.ps
# Postscript files (2-up version): 40-page blocks
# ###############################################
# The LaTeX main file for the 2-up version is book2up.tex and not
# book.tex; they differ in the values of \odd- and \evensidemargin,
# and for a blank page at the beginning (to print the front cover on
# the right side of the first sheet)
PSS2 = bup1.ps bup2.ps bup3.ps bup4.ps bup5.ps bup6.ps bup7.ps \
bup8.ps bup9.ps
# Phony targets
# #############
.PHONY: all clean veryclean brown install VERSION
# PostScript files, 1-up version
# ##############################
book: $(PSS)
touch book
book.ps: book.dvi
book1.ps: book.dvi
dvips -o $@ -p 1 -l 50 $<
book2.ps: book.dvi
dvips -o $@ -p 51 -n 50 $<
book3.ps: book.dvi
dvips -o $@ -p 101 -n 50 $<
book4.ps: book.dvi
dvips -o $@ -p 151 -n 50 $<
book5.ps: book.dvi
dvips -o $@ -p 201 -n 50 $<
book6.ps: book.dvi
dvips -o $@ -p 251 -n 50 $<
book7.ps: book.dvi
dvips -o $@ -p 301 $<
book.dvi: book.tex $(TEXS) $(STYS) $(EGZS) $(FIGS)
latex book.tex
$(DOIDX)
while grep Rerun book.log; do latex book.tex; $(DOIDX); done
latex book.tex
# PDF files, 1-up version
# #######################
book.pdf: book.dvi
pdf: book.dvi
dvips <$< -f -q -p 1 -l 50 | ps2pdf - book1.pdf
dvips <$< -f -q -p 51 -n 50 | ps2pdf - book2.pdf
dvips <$< -f -q -p 101 -n 50 | ps2pdf - book3.pdf
dvips <$< -f -q -p 151 -n 50 | ps2pdf - book4.pdf
dvips <$< -f -q -p 201 -n 50 | ps2pdf - book5.pdf
dvips <$< -f -q -p 251 -n 50 | ps2pdf - book6.pdf
dvips <$< -f -q -p 301 | ps2pdf - book7.pdf
touch pdf
# PostScript files, 2-up version
# ##############################
twoup: $(PSS2)
touch twoup
book2up.ps: book2up.dvi
dvips <$< -q -f | psnup >$@ -pa4 -2
bup1.ps: book2up.dvi
dvips <$< -n 40 -q -f | psnup >$@ -pa4 -2
bup2.ps: book2up.dvi
dvips <$< -n 40 -p =41 -q -f | psnup >$@ -pa4 -2
bup3.ps: book2up.dvi
dvips <$< -n 40 -p =81 -q -f | psnup >$@ -pa4 -2
bup4.ps: book2up.dvi
dvips <$< -n 40 -p =121 -q -f | psnup >$@ -pa4 -2
bup5.ps: book2up.dvi
dvips <$< -n 40 -p =161 -q -f | psnup >$@ -pa4 -2
bup6.ps: book2up.dvi
dvips <$< -n 40 -p =201 -q -f | psnup >$@ -pa4 -2
bup7.ps: book2up.dvi
dvips <$< -n 40 -p =241 -q -f | psnup >$@ -pa4 -2
bup8.ps: book2up.dvi
dvips <$< -n 40 -p =281 -q -f | psnup >$@ -pa4 -2
bup9.ps: book2up.dvi
dvips <$< -p =321 -q -f | psnup >$@ -pa4 -2
booklet.ps: book2up.dvi
dvips <$< -p 2 -q -f | psbook | psnup >$@ -pa4 -2
book2up.dvi: book2up.tex bsheaders.sty $(TEXS) $(STYS) $(EGZS) $(FIGS)
latex book2up.tex
$(DOIDX2UP)
while grep Rerun book2up.log; do latex book2up.tex; $(DOIDX2UP); done
latex book2up.tex
book2up.tex: book.tex 2up.awk
awk -f 2up.awk book.tex >$@
# PDF files, 2-up version
# #######################
book2up.pdf: book2up.dvi
dvips <$< -f -q | psnup -pa4 -2 -q | ps2pdf - $@
pdf2up: book2up.dvi
dvips <$< -f -q -n 40 | psnup -pa4 -2 -q | ps2pdf - bup1.pdf
dvips <$< -f -q -p =41 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup2.pdf
dvips <$< -f -q -p =81 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup3.pdf
dvips <$< -f -q -p =121 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup4.pdf
dvips <$< -f -q -p =161 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup5.pdf
dvips <$< -f -q -p =201 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup6.pdf
dvips <$< -f -q -p =241 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup7.pdf
dvips <$< -f -q -p =281 -n 40 | psnup -pa4 -2 -q | ps2pdf - bup8.pdf
dvips <$< -f -q -p =321 | psnup -pa4 -2 -q | ps2pdf - bup9.pdf
touch pdf2up
# "all": "book" && "pdf"
# ######################
all: book pdf
# Commands to build tabout.tex, i.e. the tables of the Appendix F,
# through the C program "table". The source file "table.c" uses the
# mathematical procedures of the GNU Scientific Library (GSL); for
# more informations, see http://www.gnu.org/software/gsl/ . If the
# GSL is not installed, I have left around the old version of the
# source code, "old_table.c", that do not need external libraries:
# just compile it first with the command
#
# gcc -std=c99 -pedantic -W -Wall -O2 -c -o table.o old_table.c
#
# before giving any "make" command. The "old" tables differ from the
# "new" ones only for two lines in one of the Fisher's tables.
# ####################################################################
tabout.tex: table
-rm tabout.tex
./table >tabout.tex
table: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
table.o: table.c
# Commands to build chicdf.kumac and chirid.kumac
# ###############################################
chicdf.kumac: chicdf
./chicdf >$@
chicdf: chicdf.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<
chirid.kumac: chirid
./chirid >$@
chirid: chirid.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $<
# xfig figures in LaTeX mode
# ##########################
poisint.pstex: poisint.fig
fig2dev -L pstex -m 1.0 $< $@
fig2dev -L pstex_t -m 1.0 -p $@ $< $@_t
polar.pstex: polar.fig
fig2dev -L pstex -m 0.48 $< $@
fig2dev -L pstex_t -m 0.48 -p $@ $< $@_t
runfig.pstex: runfig.fig
fig2dev -L pstex -m 0.52 $< $@
fig2dev -L pstex_t -m 0.52 -p $@ $< $@_t
scat.pstex: scat.fig
fig2dev -L pstex -m 1.0 $< $@
fig2dev -L pstex_t -m 1.0 -p $@ $< $@_t
# Cleanup
# #######
clean:
@rm -fv *.ps *.pdf book pdf twoup pdf2up last.* paw.* *.bak VERSION
@lintex
@rm -fv book2up.tex Makefile.html
veryclean:
make clean
@rm -rfv brown/
@rm -fv *.eps.bb $(PAWEPS) *.pstex*
@rm -fv tabout.tex table chicdf chirid tohtml *.o
@if [ "$$(find . -maxdepth 1 -name '*.eps.gz' | wc -l)" != "0" ]; \
then gzip -dv *.eps.gz; fi
# VERSION - The "VERSION" file, with last file revisions
# ######################################################
VERSION:
echo >$@ "Revision status as of `date '+%d-%b-%Y %H:%M'` :"
echo >>$@ ""
for f in Makefile book.tex $(TEX0) ; \
do grep '$$'"Id: " $${f} | awk -v file="$${f}" \
'{print file "\t\tRev. " $$4 "\t" $$5 " " $$6;}' >>$@ ; \
done
grep '$$'"Id: " table.c | awk \
'{print "table.c\t\t\tRev. " $$3 "\t" $$4 " " $$5;}' >> $@
grep '$$'"Id: " chicdf.c | awk \
'{print "chicdf.c\t\tRev. " $$3 "\t" $$4 " " $$5;}' >> $@
grep '$$'"Id: " chirid.c | awk \
'{print "chirid.c\t\tRev. " $$3 "\t" $$4 " " $$5;}' >> $@
grep '$$'"Id: " tohtml.c | awk \
'{print "tohtml.c\t\tRev. " $$3 "\t" $$4 " " $$5;}' >> $@
# Makefile.html - a syntax highlighted copy of Makefile. Needs
# "source-highlight", available under the URL
# http://www.gnu.org/software/src-highlite/source-highlight.html
# ##############################################################
Makefile.html: Makefile tohtml
./tohtml Makefile "wwwcdf.pd.infn.it/labo/Source" \
--lang-def makefile.lang
tohtml: tohtml.c
$(CC) $(CPPFLAGS) -o $@ $<
# Install - Copies the pdf and the source files on the Web
# ########################################################
install: book.pdf book2up.pdf pdf pdf2up VERSION Makefile.html
for f in bup*.pdf; do mv $$f $${f/bup/twoup}; done
scp *.pdf VERSION INDEX.html Makefile.html lx:/www/cdf/html/labo/
rm *.pdf VERSION pdf pdf2up
-scp `ls | grep -v INDEX.html` lx:/www/cdf/html/labo/Source/
make veryclean
make brown
make -C brown book.pdf book2up.pdf pdf pdf2up
for f in brown/bup*.pdf; do mv $$f $${f/bup/twoup}; done
scp brown/*.pdf lx:/www/cdf/html/labo/brown/
ssh lx "cd /www/cdf/html/labo && tar cvzf Source.tar.gz Source/"
ssh lx "cd /www/cdf/html/labo && tar cvjf Source.tar.bz2 Source/"
# Brown version
# #############
# "make brown" generates in a subdirectory ./brown versions of the TeX
# files and of all the figures suitable for printing in brown and not
# in black. The three macros BROWN1, BROWN2 and BROWN3 define the RGB
# components of the printing color (here, "SaddleBrown") in three
# different ways; BROWN4 and BROWN5 refer the to color shades
# corresponding to "gray96" and "gray61", roughly estimated from the
# expression C=C+(1.0-C)*G: where "C" is the R, G or B component of
# the printing color as given in BROWN3, and G is the grayscale factor
# (0.96 or 0.61).
#
# CAVEATS
# =======
#
# 1) The conversion from black to brown of the bo.eps file requires
# "convert", from the ImageMagick package, version *6* or later.
# 2) The conversion from black to brown of the .pstex and .pstex_t
# files depends from the syntax of the fig2dev output; this may
# change in the future.
BROWN1 = SaddleBrown
BROWN2 = 0.55,0.27,0.07
BROWN3 = 0.55 0.27 0.07
BROWN4 = 0.96 0.93 0.92
BROWN5 = 0.82 0.71 0.64
brown:
rm -rf brown/
mkdir brown
if [ -r bo.eps.gz ]; then gzip -dc bo.eps.gz > bo.eps; fi
convert bo.eps -fill $(BROWN1) -opaque Black brown/bo.eps
if [ -r bo.eps.gz ]; then rm -f bo.eps; fi
awk '{print} \
/\\begin{document}/ { \
print "\\renewcommand{\\normalcolor}{\\color[rgb]{$(BROWN2)}}"; \
print "\\normalcolor\n"}' book.tex > brown/book.tex
make tabout.tex $(FIGS)
cp *.c *.awk *.fig brown/
cp *.o brown/
cp table brown/
cp $(TEXS) $(STYS) brown/
for file in *.pstex; \
do sed -e "s/0.000 0.000 0.000/$(BROWN3)/" \
-e "s/0.00 setgray/col0/" \
-e "s/0.910 0.910 0.910/$(BROWN4)/" \
-e "s/0.608 0.608 0.608/$(BROWN5)/" \
$$file > brown/$$file; done
for file in *.pstex_t; \
do sed -e "s/\[rgb\]{0,0,0}/\[rgb\]{$(BROWN2)}/" \
$$file > brown/$$file; done