-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathMakefile
More file actions
438 lines (360 loc) · 12.6 KB
/
Makefile
File metadata and controls
438 lines (360 loc) · 12.6 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
8000
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# Makefile to generate the CSS2 document based on its "source files"
# Arnaud Le Hors - lehors@w3.org
# $Id: Makefile,v 1.49 1997-11-27 03:08:44 ian Exp $
# what needs to be set for every new release:
THIS_VERSION= http://www.w3.org/Style/Group/9711/WD-css2-971127
THE_PREVIOUS_VERSION= http://www.w3.org/TR/WD-CSS2/
THE_LATEST_VERSION= http://www.w3.org/Style/Group/9711/WD-css2-971127
THE_DATE= 27-Nov-1997
THE_ID= WD-CSS20-971127
INSTALLDIR= /afs/w3.org/pub/WWW/Style/Group/9711/WD-css2-971127
CSSGROUPDIR = /afs/w3.org/pub/WWW/Style/Group/
ROOT = .
# the following files are part of the CSS specification
SRCS0 = \
$(ROOT)/cover.src
SRCS1 = \
about.src\
intro.src\
convent.src\
syndata.src\
selector.src\
cascade.src\
media.src\
flowobj.src\
flowobj2.src\
page.src\
colors.src\
fonts.src\
text.src\
lists.src\
tables.src\
ui.src\
aural.src
APPSRCS = \
sample.src\
changes.src\
notes.src\
grammar.src\
fontstuff.src
REFSRCS = \
refs.src
INDEXSRCS= \
indexlist.src
MAINSRCS = $(SRCS1)
MAINOBJS = \
cover.html\
about.html\
intro.html\
convent.html\
syndata.html\
selector.html\
cascade.html\
media.html\
flowobj.html\
flowobj2.html\
page.html\
colors.html\
fonts.html\
text.html\
lists.html\
tables.html\
ui.html\
aural.html
APPENDIXES= \
sample.html\
changes.html\
notes.html\
grammar.html\
fontstuff.html
REFS= \
refs.html
INDEXES= \
indexlist.html
SPECSRCS= $(SRCS0) $(MAINSRCS) $(APPSRCS)
SPECOBJS= $(MAINOBJS) $(APPENDIXES) $(REFS)
IMAGES = images/*.gif
STYLESHEETS= style/*.css
ALLOBJS= $(SPECOBJS) $(INDEXES) $(IMAGES) $(STYLESHEETS) translations.html
PROPSRC= properties/properties.db
DESCSRC= properties/descriptors.db
PROPBLKSDIR= build/properties
DESCBLKSDIR= build/descriptors
# dbase for property name anchors
PROPERTYDB= build/property.db
# dbase for descriptor name anchors
DESCRIPTORDB= build/descriptor.db
# dbase for value types
VALUEDB= build/value.db
# dbase for heading dbase
HEADINGDB= build/headings.db
SED = sed
PERL= perl5
NSGMLS=nsgmls
LINKLINT=$(PERL) bin/linklint
SPELL = ispell -l -p
# HTML include preprocessor (for includes)
HIPP= $(PERL) ./bin/hipp
# make depend utility for CSS source documents
HMKDEPEND= $(PERL) ./bin/hmkdep
# make value anchor database
MKANCHDB= $(PERL) ./bin/mkanchdb
# make property and descriptor anchor database
MKPANCHDB= $(PERL) ./bin/mkpanchdb
# add heading anchors
ADDHANCH= $(PERL) ./bin/addhanch
# add index anchors and generate related index database
ADDIDXANCH= $(PERL) ./bin/addianch
# add navigation bars
ADDNAVBAR= $(PERL) ./bin/addnavbar
# make CSS Index
MKIDX= $(PERL) ./bin/mkidx
# make table of contents and heading database
MKTOC= $(PERL) ./bin/mktoc
# HTML concate utility
HTMLCAT= $(PERL) ./bin/htmlcat
# trim utility to get rid of navbar sections
HTMLTRIM= $(PERL) ./bin/htmltrim
# make sub table of contents
MKSUBTOC=$(PERL) ./bin/mksubtoc
# insert subtoc
INSAFTER= $(PERL) ./bin/insafter
# add link
ADDLINKS= $(PERL) ./bin/addlinks
# extract properties from db.
PEXTR= $(PERL) ./bin/pextr
# extract descriptors from db.
DEXTR= $(PERL) ./bin/dextr
# extract issues from issues db.
ISSUES= bin/issues
# extract issues from todo db.
TODO= bin/todo
# check validity of sample style sheet
CHKSAMPLE= $(PERL) ./bin/chksample
# make database of references (reference.src)
MKREFDB = $(PERL) ./bin/mkrefdb
# check references.
CHKREFS= $(PERL) ./bin/chkrefs
# add reference normative/informative class info.
ADDREFCLASS= $(PERL) ./bin/addrefclass
# utility to generate the PostScript version
# -R seems broken for this spec.
HTML2PS= $(PERL) ./bin/html2ps -d -f html2psrc
# IDRAW -> PS -> GIF tools
#PSTOPNM = ./bin/mypstopnm -r 75
PSTOPNM = ./bin/mypstopnm -r 150
#PNMTOGIF_PIPE = ppmquant 256 | ppmtogif
PNMTOGIF_PIPE = pnmscale 0.5 | pnmgamma 1.8 | ppmquant 256 | ppmtogif
# include paths
INCLUDES= -Ibuild -I.
RM= rm -fr
CP= cp
TAR= tar
ZIP= zip
LN= ln
.SUFFIXES: .src .html .srb .idraw .gif .ps
.src.html:
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(HIPP) $(INCLUDES) $< - | $(ADDHANCH) -n -ml 3 -r $< - - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
.idraw.gif:
$(RM) $@
# $(PSTOPNM) $< | $(PPMQUANT) | $(PPMTOGIF) >$@
$(PSTOPNM) $< | $(PNMTOGIF_PIPE) >$@
all: blocks $(PROPERTYDB) $(DESCRIPTORDB) $(VALUEDB) $(HEADINGDB) $(SPECOBJS) $(INDEXES) \
$(IMAGES) issues.html DOC/TODO.html
install: all css2.tgz
@if [ -z "$(INSTALLDIR)" ]; then\
echo >&2;\
echo "*** No target directory specified" >&2;\
echo "*** Please use: make install INSTALLDIR=<target-dir>" >&2;\
exit 1;\
fi
@if [ ! -d $(INSTALLDIR) ]; then mkdir -p $(INSTALLDIR);fi
$(CP) css2.tgz $(INSTALLDIR)
(cd $(INSTALLDIR); zcat css2.tgz | $(TAR) xvf -)
-(cd $(CSSGROUPDIR); rm -f issues.html; \
$(LN) -s $(INSTALLDIR)/issues.html css2-issues.html)
$(CP) Overview.html html2psrc $(INSTALLDIR)
install-all: install css2.zip css2.ps css2.txt
$(CP) css2.zip css2.ps css2.txt $(INSTALLDIR)
#### Special section to build PS file and single plain text file
css2.ps ps: all
$(HTML2PS) $(MAINOBJS) $(APPENDIXES) $(REFS) $(INDEXES) > $@
css2.html html: all
$(HTMLCAT) - $(MAINOBJS) $(APPENDIXES) $(REFS) $(INDEXES) | \
$(HTMLTRIM) div navbar - $@
# the following requires to be on unix and have Netscape running...
css2.txt txt: css2.html
$(RM) css2.txt; \
netscape -remote "openFile(`pwd`/css2.html)" -remote "saveAs(`pwd`/css2.txt,Text)"
####
css2.tgz: $(ALLOBJS)
$(TAR) cf - $(ALLOBJS) | gzip >$@
css2.zip: $(ALLOBJS)
$(ZIP) $@ $(ALLOBJS)
#### Section generate property/descriptor tables from property database.
blocks: $(PROPBLKSDIR)/blocks.ok $(DESCBLKSDIR)/blocks.ok
$(PROPBLKSDIR)/blocks.ok: $(PROPSRC)
@if [ ! -d $(PROPBLKSDIR) ]; then mkdir -p $(PROPBLKSDIR);fi
$(PEXTR) $(PROPSRC) $(PROPBLKSDIR)
touch $@
$(DESCBLKSDIR)/blocks.ok: $(DESCSRC)
@if [ ! -d $(DESCBLKSDIR) ]; then mkdir -p $(DESCBLKSDIR);fi
$(DEXTR) $(DESCSRC) $(DESCBLKSDIR)
touch $@
$(PROPERTYDB): $(SPECSRCS)
@if [ ! -d build ]; then mkdir build;fi
$(MKPANCHDB) properties propdef - $(SPECSRCS) | $(SED) 's/\.src/\.html/' > $@
$(DESCRIPTORDB): $(SPECSRCS)
@if [ ! -d build ]; then mkdir build;fi
$(MKPANCHDB) descriptors descdef - $(SPECSRCS) | $(SED) 's/\.src/\.html/' > $@
$(VALUEDB): $(SPECSRCS)
$(MKANCHDB) value-def - $(SPECSRCS) | $(SED) 's/\.src/\.html/' > $@
indexlist.html: build/indexlist.srb
build/indexlist.srb: $(SPECOBJS)
$(MKIDX) $@ build/index/*
cover.html: cover.src build/contents.srb
$(SED) -e 's|_THIS_VERSION_|$(THIS_VERSION)|g' \
-e 's|_THE_PREVIOUS_VERSION_|$(THE_PREVIOUS_VERSION)|g' \
-e 's|_THE_LATEST_VERSION_|$(THE_LATEST_VERSION)|g' \
-e 's|_THE_DATE_|$(THE_DATE)|g' \
-e 's|_THE_ID_|$(THE_ID)|g' $< | \
$(HIPP) $(INCLUDES) - - | \
$(ADDNAVBAR) -hr -r $@ - $@ "table of contents" "#toc" index indexlist.html
build/contents.srb: $(MAINSRCS) $(INDEXSRCS) $(APPSRCS) $(REFSRCS)
$(MKTOC) -ml 5 $@ $(HEADINGDB) $(MAINSRCS) -ul -roman $(APPSRCS) \
-ol -none $(REFSRCS) $(INDEXSRCS)
$(ADDLINKS) -r $< $(HEADINGDB) $(HEADINGDB) propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB)
$(ADDLINKS) -r $< $@ $@ propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB)
$(HEADINGDB): build/contents.srb
# special rule with different numbering
about.html: about.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html >$@
# special rule with different numbering
sample.html: sample.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
changes.html: changes.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
notes.html: notes.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
grammar.html: grammar.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
refs.html: refs.src
@if [ ! -d build/index ]; then mkdir -p build/index; fi
echo "<div class=\"subtoc\"><p><strong>Contents</strong>" \
> build/subtoc.$$$$; \
$(MKSUBTOC) -r $@ -l 2 - $(HEADINGDB) $< >> build/subtoc.$$$$; \
echo "</div>" >> build/subtoc.$$$$; \
$(ADDHANCH) -n -l 2 -ml 4 $< - $(HEADINGDB) | \
$(ADDIDXANCH) -r $< - - build/index/$<.db | \
$(ADDLINKS) -r $< - - propinst $(PROPERTYDB) descinst $(DESCRIPTORDB) value-inst $(VALUEDB) | \
$(ADDNAVBAR) -r $@ - - contents "cover.html#toc" index indexlist.html| \
$(INSAFTER) - build/subtoc.$$$$ /H1 $@; \
$(RM) build/subtoc.$$$$
# simpler rules for special pages
indexlist.html: indexlist.src
$(HIPP) $(INCLUDES) $< - | \
$(ADDNAVBAR) -r $@ - $@ contents "cover.html#toc"
issues.html: issues.src build/issues.srb
$(HIPP) $(INCLUDES) issues.src $@
build/issues.srb: issues.db
$(ISSUES) -g >$@
DOC/TODO.html: DOC/TODO.src build/todo.srb
$(HIPP) $(INCLUDES) DOC/TODO.src $@
build/todo.srb: DOC/todo.db
$(TODO) -g >$@
### check on the document to see if it's valid
check: checkdoc checkrefs checkspell checksample checklnx
FILES= $(MAINOBJS) $(APPENDIXES) $(REFS) $(INDEXES)
checkdoc: all
@for i in $(FILES); \
do echo checking $$i...; \
$(NSGMLS) -s -c sgml/HTML4.cat $$i; done; \
echo checking done.
### check on the validity references in the document
checkrefs: build/refs.db
-@$(CHKREFS) build/refs.db $(SPECSRCS)
build/refs.db : $(SPECSRCS) $(REFSRCS)
-@$(RM) -f build/refs.db
-@$(MKREFDB) $(REFSRCS) build/refs.db
### Spell check, using a "CSS" personal dictionary.
checkspell:
-@for i in $(SPECSRCS); \
do\
echo "Checking spelling in $$i.";\
cat $$i | $(SPELL) css.dico;\
done;
### check the sample style sheet.
checksample: sample.src $(PROPSRC)
@$(CHKSAMPLE) sample.src $(PROPSRC)
### check links
checklnx: all
-@$(RM) linklint
$(LINKLINT) -doc linklint $(FILES)
# get cvs logs
FROMDATE=1 week ago
log:
@for i in `cat DOC/FILES` ; \
do cvs log -d ">$(FROMDATE)" $$i >/tmp/log; \
grep "selected revisions: 0" /tmp/log >/dev/null || cat /tmp/log; \
done; rm /tmp/log
clean:
$(RM) $(SPECOBJS) $(SPECIALOBJS) $(INDEXES) $(PROPBLKSDIR)/* \
$(DESCBLKSDIR)/* build/* css2.* linklint
realclean: clean
depend:
$(HMKDEPEND) $(SPECOBJS) $(SPECIALOBJS)
##### The following is automatically generated. Do not edit!! ####