forked from hpi-swa-lab/SqueakByExample-english
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
128 lines (102 loc) · 3.33 KB
/
Makefile
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
# --------------------------------------------------------------------------------
# $Id$
# --------------------------------------------------------------------------------
# export TEXINPUTS:=.:local
export TEXINPUTS:=./local//:../local//:
C = Preface QuickTour FirstApp Syntax Messages \
Model Environment SUnit BasicClasses Collections Streams Morphic \
Metaclasses
PDFLATEX = pdflatex -file-line-error
BIBTEX=bibtex
BOOK=SBE
ETC=SBE-etc
# --------------------------------------------------------------------------------
all : book
# NB: be sure to use texlive and to set the TEXINPUTS variable accordingly
# See README.txt
book : clean examples listings
time ${PDFLATEX} ${BOOK}
time ${BIBTEX} ${BOOK}
time ${PDFLATEX} ${BOOK}
time ${PDFLATEX} ${BOOK} | tee warnings.txt
# Filter out blank lines and bogus warnings
perl -pi \
-e '$$/ = "";' \
-e 's/[\n\r]+/\n/g;' \
-e 's/LaTeX Warning: Label `\w*:defaultlabel'\'' multiply defined.[\n\r]*//g;' \
-e 's/Package wrapfig Warning: wrapfigure used inside a conflicting environment[\n\r]*//g;' \
warnings.txt
# We need a makefile rule to generate the index as well ...
index :
makeindex ${BOOK}
complete : book index
time ${PDFLATEX} ${BOOK}
etc :
time ${PDFLATEX} ${ETC}
makeindex ${ETC}
time ${PDFLATEX} ${ETC}
time ${PDFLATEX} ${ETC}
open ${ETC}.pdf
examples :
./examples.rb $C > [email protected]
listings :
rm -r ListingSources ||:
cp -fR SmalltalkSources ListingSources
./annotate-listings.rb
fun :
time ./examples.rb $C > [email protected]
# Requires Gnu Smalltalk 2.95c with scripting support:
time ./examples.st $C > [email protected]
# --------------------------------------------------------------------------------
# MAINTENANCE
# Adapt this rule to find anything (such as duplicate labels)
find :
find . -name \*.tex | \
xargs egrep '\\atsign'
# Search for any figure files with non-unique names
duplicates :
ls figures */figures | sort | uniq -d
# look for bad usages of see index (with ! in second arg)
badsee :
find . -name \*.tex | \
xargs egrep '\\seeindex\{.*}{.*!.*}'
badindex :
find . -name \*.tex | \
xargs egrep '\\index\{.*}{'
# Check for duplicate labels
checkLabels :
find . -name \*.tex | \
xargs perl -p -e 's/\%.*//;' | \
fgrep '\label' | \
perl -p -e 's/.*\\label{([^}]*)}.*/$$1/;' | \
sort | uniq -d
# Count deprecated stuff:
deprecated :
# @ echo "OLDscript:"
# @find . -name \*.tex | xargs fgrep '{OLDscript}' | sed 's/:.*//' | sort | uniq -c
@ echo "doublebox:"
@find . -name \*.tex | xargs fgrep 'doublebox' | sed 's/:.*//' | sort | uniq -c
munge :
find . -name \*.tex | \
xargs perl -pi \
-e 's/{Chapter summary}/{Chapter Summary}/g;'
keys :
find . -name \*.tex -or -name \*.txt | \
xargs svn propset svn:keywords "Date Author Id Log"
# Fix the mime types of all pdf files
ps :
find . -name \*.pdf | \
xargs svn ps svn:mime-type application/octet-stream
# --------------------------------------------------------------------------------
clean :
-rm -f *.aux *.log *.out *.glo *.toc *.ilg *.blg *.idx
-rm -f */*.aux */*.log */*.out
-rm -f .DS_Store */.DS_Store
-rm -f common*.url common*.pdf SBE.url
-rm -f test.*
bare : clean
mv figures/squeak-logo.pdf figures/squeak-logo.pdfSAVE
-rm -f ${BOOK}.pdf */*.pdf
mv figures/squeak-logo.pdfSAVE figures/squeak-logo.pdf
# --------------------------------------------------------------------------------