-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
108 lines (86 loc) · 3.45 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
# Prereqs:
# install node, ruby, wget, then:
#
# npm install -g pegjs
# npm install -g nodeunit
# gem install ruby2js
# https://github.com/tabatkins/bikeshed/blob/master/docs/install.md
#
# To run the reference-implementation cgi scripts:
#
# gem install wunderbar
all: spec test
clean:
rm -f url.html url.bs url.pegjson reference-implementation/url.js \
reference-implementation/urlparser.js \
reference-implementation/test/urlsettest.js
#
### specification
#
spec: url.html
url.html: url.bs
bikeshed spec
url.bs: json2bikeshed.rb url.pegjson url.pegjs url.src
ruby json2bikeshed.rb > $@
url.pegjson: peg2json.js parser.pegjs url.pegjs
node peg2json.js > $@
#
### test reference implementation
#
test: settest urltest
urltest: reference-implementation/punycode.js \
reference-implementation/unorm.js \
reference-implementation/idna.js \
reference-implementation/url.js \
reference-implementation/urlparser.js \
reference-implementation/test/urltest.js \
reference-implementation/test/urltestparser.js \
reference-implementation/test/urltestdata.txt \
reference-implementation/test/moretestdata.txt \
reference-implementation/test/patchtestdata.txt
node reference-implementation/test/urltest.js
reference-implementation/test/urlsettest.js: \
reference-implementation/test/urlsettest.yml \
reference-implementation/test/yml2test.rb
ruby reference-implementation/test/yml2test.rb > $@
reference-implementation/url.js: reference-implementation/ruby2js reference-implementation/url.rb
ruby reference-implementation/ruby2js reference-implementation/url.rb > $@
reference-implementation/urlparser.js: reference-implementation/pegcompile.js url.pegjs
node reference-implementation/pegcompile.js > $@
reference-implementation/idna.js: reference-implementation/idna2js.rb \
reference-implementation/IdnaMappingTable.txt
ruby reference-implementation/idna2js.rb > $@
settest: reference-implementation/test/urlsettest.js \
reference-implementation/punycode.js \
reference-implementation/unorm.js \
reference-implementation/idna.js \
reference-implementation/url.js \
reference-implementation/urlparser.js
nodeunit reference-implementation/test/urlsettest.js --reporter minimal
#
### Fetch files from other sources
#
clobber: clean
rm -f test/urltestdata.txt test/urltestparser.js parser.pegjs \
reference-implementation/test/urltestdata.txt \
reference-implementation/punycode.js \
reference-implementation/IdnaMappingTable.txt
fetch: clobber test/urltestdata.txt test/urltestparser.js parser.pegjs \
reference-implementation/punycode.js
reference-implementation/test/urltestdata.txt:
cd reference-implementation/test; \
wget https://raw.githubusercontent.com/w3c/web-platform-tests/master/url/urltestdata.txt
reference-implementation/test/urltestparser.js:
cd reference-implementation/test; \
wget https://raw.githubusercontent.com/w3c/web-platform-tests/master/url/urltestparser.js
parser.pegjs:
wget https://raw.githubusercontent.com/dmajda/pegjs/master/src/parser.pegjs
reference-implementation/punycode.js:
cd reference-implementation; \
wget https://raw.githubusercontent.com/bestiejs/punycode.js/master/punycode.js
reference-implementation/unorm.js:
cd reference-implementation; \
wget https://raw.githubusercontent.com/walling/unorm/master/lib/unorm.js
reference-implementation/IdnaMappingTable.txt:
cd reference-implementation; \
wget http://www.unicode.org/Public/idna/latest/IdnaMappingTable.txt