forked from RussianSmalltalk/pharo-by-example-ru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
183 lines (142 loc) · 5.1 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
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
# $Id: Makefile 14612 2007-12-22 18:31:43Z oscar $
# --------------------------------------------------------------------------------
# NB: There is no separate rule for running bibtex, though perhaps there should be.
# The idea is that there should be only very few references, so bibtex can be run
# manually. The generated .bbl file should be part of the subversion repository,
# so it will always be up-to-date, and bibtex should not need to be run unless
# new references are added.
# The source bib file is in a separate repository, as described in the README file.
# --------------------------------------------------------------------------------
# export TEXINPUTS:=.:local
export TEXINPUTS:=./local//:../local//:
EG1 = Preface QuickTour FirstApp Syntax Messages \
Model Environment SUnit BasicClasses Collections Streams Morphic \
Metaclasses Seaside Reflection
EG2 = Seaside
PDFLATEX = pdflatex -file-line-error
# TO-DO: add rules for BOOK1?
BOOK1=PBE1
BOOK2=PBE2
OMNIBUS=PBE-Omnibus
# --------------------------------------------------------------------------------
all : omnibus
# NB: be sure to use texlive and to set the TEXINPUTS variable accordingly
# See README.txt
OMNIBUS : clean examples examples2
time ${PDFLATEX} ${OMNIBUS}
time ${PDFLATEX} ${OMNIBUS} | 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
BOOK1 : clean examples
time ${PDFLATEX} ${BOOK1}
time ${PDFLATEX} ${BOOK1} | 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
BOOK2 : clean examples2
time ${PDFLATEX} ${BOOK2}
time ${PDFLATEX} ${BOOK2} | 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 ...
index1 :
makeindex ${BOOK1}
pbe1 : BOOK1 index1
time ${PDFLATEX} ${BOOK1}
# We need a makefile rule to generate the index as well ...
index2 :
makeindex ${BOOK2}
pbe2 : BOOK2 index2
time ${PDFLATEX} ${BOOK2}
# We need a makefile rule to generate the index as well ...
index :
makeindex ${OMNIBUS}
omnibus : OMNIBUS index
time ${PDFLATEX} ${OMNIBUS}
examples :
./examples.rb ${EG1} > pbe1-examples.txt
examples2 :
./examples.rb ${EG2} > pbe2-examples.txt
fun :
time ./examples.rb $C > [email protected]
# Requires Gnu Smalltalk 2.95c with scripting support:
time ./examples.st $C > [email protected]
# --------------------------------------------------------------------------------
# MAINTENANCE
graffleDirs :
find . -name \*.graffle -type d
# To do items are tags that look like this "%:===> ...."
todo :
fgrep '%:=' *.tex */*.tex
history :
sh history.sh > history.txt
# report tex files missing HISTORY
missinghistory :
find . -name \*.tex | \
xargs fgrep -L HISTORY
# 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 ${BOOK2}.pdf */*.pdf
mv figures/squeak-logo.pdfSAVE figures/squeak-logo.pdf
# --------------------------------------------------------------------------------