|
1 | 1 | # The top-level Makefile that is used to build the HTML5 specification |
2 | 2 | # |
3 | 3 | # Author: Manu Sporny |
4 | | -.PHONY: help all spec-rdfa-module spec-rdfa-complete directories |
| 4 | +.PHONY: help |
5 | 5 |
|
6 | 6 | BUILD_DIR := build |
| 7 | +CONFIG_DIR := configs |
7 | 8 | DIST_DIR := dist |
| 9 | +SOURCE_FILES := $(wildcard build/*) |
| 10 | +CONFIGS := $(wildcard ${CONFIG_DIR}/*.conf) |
| 11 | +SPEC_SPLIT_STAMP := ${BUILD_DIR}/spec-split.stamp |
| 12 | +SPECS := $(patsubst ${CONFIG_DIR}/%.conf, ${DIST_DIR}/%.html, $(CONFIGS)) |
8 | 13 |
|
9 | 14 | help: |
10 | | - @echo "Commands that you can use to build the HTML5 specification." |
| 15 | + @echo "Commands that you can use to build the various HTML5 specifications." |
11 | 16 | @echo "" |
12 | | - @echo " make whatwg-pull - Pull the latest updates from the WHAT WG repository" |
13 | | - @echo " make html5-hixie - Build the HTML5 specification" |
14 | | - @echo " make html5-rdfa - Build the RDFa specification module" |
15 | | - @echo " make rdfa-module - Build the HTML5+RDFa specification" |
| 17 | + @$(foreach spec,$(SPECS), echo " make $(spec)" &&) true |
16 | 18 | @echo " make clean - Cleans all of the build files" |
17 | 19 |
|
18 | | -whatwg-pull: |
| 20 | +html5-hixie/source: |
19 | 21 | @echo "Pulling latest changes from WHAT Working Group repository" |
20 | 22 | @@SVN@ co http://svn.whatwg.org/webapps html5-hixie |
21 | 23 |
|
22 | | -directories: |
23 | | - @mkdir -p ${BUILD_DIR} ${DIST_DIR} |
| 24 | +${BUILD_DIR} ${DIST_DIR}: |
| 25 | + @mkdir -p $@ |
24 | 26 |
|
25 | | -html5-hixie: directories ${DIST_DIR}/html5-hixie.html |
| 27 | +$(SPECS): ${SPEC_SPLIT_STAMP} ${BUILD_DIR} ${DIST_DIR} |
| 28 | + @echo "Building $(@F) specification..." |
| 29 | + @echo "Joining microsections into $(@F) specification..." |
| 30 | + @./bin/microjoin.py -d ${BUILD_DIR} -o tempspec-$(@F) ${CONFIG_DIR}/$(subst .html,.conf,$(@F)) |
| 31 | + @echo "Generating final document via Anolis (this may take 2-3 minutes)..." |
| 32 | + @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/tempspec-$(@F) $@ |
| 33 | + @sed -i "s/@SPEC_NAME@/$(@F)/g" $@ |
| 34 | + @echo "$(@F) spec written to: $@" |
26 | 35 |
|
27 | | -${DIST_DIR}/html5-hixie.html: headers/header-w3c-html5 html5-hixie/source |
28 | | - @echo "Building HTML5-hixie specification..." |
29 | | - @echo "Removing non-HTML5 sections..." |
| 36 | +${SPEC_SPLIT_STAMP}: html5-hixie/source |
| 37 | + @echo "Removing non-HTML5 sections before splitting spec..." |
30 | 38 | @perl -e '$$_ = join("", <>); s/<!--END html5-->.*?<!--START html5-->//gs; s/<!--(START|END).*?-->//g; print' html5-hixie/source > html5-hixie/source-html5 |
31 | | - @echo "Splitting html5-hixie into microsections..." |
| 39 | + @echo "Splitting source HTML5 document into microsections..." |
32 | 40 | @./bin/microsplit.py html5-hixie/source-html5 |
33 | | - @echo "Joining microsections into HTML5-hixie specification..." |
34 | | - @echo "include headers/header-w3c-html5" > build/html5-hixie.conf |
35 | | - @cat build/source-html5.conf >> build/html5-hixie.conf |
36 | | - @./bin/microjoin.py build/html5-hixie.conf |
37 | | - @echo "Generating final document via Anolis (this may take 2-3 minutes)..." |
38 | | - @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/specification.html ${DIST_DIR}/html5-hixie.html |
39 | | - @echo "HTML5-hixie spec written to: ${DIST_DIR}/html5-hixie.html" |
40 | | - |
41 | | -rdfa-module: directories ${DIST_DIR}/rdfa-module.html |
42 | | - |
43 | | -${DIST_DIR}/rdfa-module.html: headers/header-w3c-rdfa $(wildcard microsections/rdfa/*) |
44 | | - @echo "Building modularized RDFa specification..." |
45 | | - @echo "Joining RDFa microsections into RDFa module specification..." |
46 | | - @./bin/microjoin.py configs/rdfa-module.conf |
47 | | - @echo "Generating final HTML via Anolis..." |
48 | | - @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/specification.html ${DIST_DIR}/rdfa-module.html |
49 | | - @echo "RDFa module spec written to: ${DIST_DIR}/rdfa-module.html" |
50 | | - |
51 | | -html5-rdfa: directories ${DIST_DIR}/html5-rdfa.html |
52 | | - |
53 | | -html5-hixie/source: whatwg-pull |
54 | | - |
55 | | -${DIST_DIR}/html5-rdfa.html: headers/header-w3c-html5 html5-hixie/source $(wildcard microsections/rdfa/*) |
56 | | - @echo "Building HTML5+RDFa specification..." |
57 | | - @mkdir -p ${BUILD_DIR} ${DIST_DIR} |
58 | | - @echo "Joining RDFa microsections into RDFa module specification..." |
59 | | - @./bin/microjoin.py configs/html5-rdfa.conf |
60 | | - @echo "Generating final HTML via Anolis (this may take 2-3 minutes)..." |
61 | | - @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/specification.html ${DIST_DIR}/html5-rdfa.html |
62 | | - @echo "HTM5-RDFa spec written to: ${DIST_DIR}/html5-rdfa.html" |
63 | | - |
64 | | -html5-warnings: directories ${DIST_DIR}/html5-warnings.html |
65 | | - |
66 | | -${DIST_DIR}/html5-warnings.html: headers/header-w3c-msporny html5-hixie/source $(wildcard microsections/warnings/*) |
67 | | - @echo "Building HTML5-warnings specification..." |
68 | | - @mkdir -p ${BUILD_DIR} ${DIST_DIR} |
69 | | - @echo "Joining HTML5-warnings microsections into HTML5 specification..." |
70 | | - @./bin/microjoin.py configs/html5-warnings.conf |
71 | | - @echo "Replacing specification name links" |
72 | | - @sed -i "s/@SPEC_NAME@/html5-warnings/g" ${BUILD_DIR}/specification.html |
73 | | - @echo "Generating final HTML via Anolis (this may take 2-3 minutes)..." |
74 | | - @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/specification.html ${DIST_DIR}/html5-warnings.html |
75 | | - @echo "HTM5-warnings spec written to: ${DIST_DIR}/html5-warnings.html" |
76 | | - |
77 | | -html5-warnings-module: directories ${DIST_DIR}/html5-warnings-module.html |
78 | | - |
79 | | -${DIST_DIR}/html5-warnings-module.html: headers/header-w3c-msporny $(wildcard microsections/warnings/*) |
80 | | - @echo "Building modularized HTML5-warnings specification..." |
81 | | - @echo "Joining HTML5-warnings microsections into HTML5-warnings module specification..." |
82 | | - @./bin/microjoin.py configs/html5-warnings-module.conf |
83 | | - @echo "Replacing specification name links" |
84 | | - @sed -i "s/@SPEC_NAME@/html5-warnings/g" ${BUILD_DIR}/specification.html |
85 | | - @echo "Generating final HTML via Anolis..." |
86 | | - @@ANOLIS@ @ANOLIS_FLAGS@ ${BUILD_DIR}/specification.html ${DIST_DIR}/html5-warnings-module.html |
87 | | - @echo "HTML5-warnings module spec written to: ${DIST_DIR}/html5-warnings-module.html" |
| 41 | + @echo "include headers/header-w3c-html5" > ${CONFIG_DIR}/html5-hixie.conf |
| 42 | + @cat ${BUILD_DIR}/source-html5.conf >> ${CONFIG_DIR}/html5-hixie.conf |
| 43 | + @touch ${SPEC_SPLIT_STAMP} |
88 | 44 |
|
89 | 45 | clean: |
90 | 46 | @echo "Cleaning all build files and directories..." |
91 | 47 | @rm -rf html5-hixie |
92 | 48 | @rm -f *~ |
93 | | - @rm -rf configure config.status config.log Makefile autom4te.cache |
94 | 49 | @rm -rf ${BUILD_DIR} ${DIST_DIR} |
0 commit comments