-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
111 lines (87 loc) · 3.34 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
# Prereqs:
# install jdk, rust, cargo, pel
# gem install addressable
# cpan URI JSON
# clean make in parent directory
all: useragent-results/index testdata uri_validate.js
testdata: \
urlsettest.json
urlsettest.json: ../reference-implementation/test/yml2test.rb \
../reference-implementation/test/urlsettest.yml
ruby ../reference-implementation/test/yml2test.rb --json > $@
useragent-results/index: resultindex.rb \
useragent-results/addressable \
useragent-results/csharp \
useragent-results/galimatias \
useragent-results/nodejs \
useragent-results/perl \
useragent-results/python \
useragent-results/ruby \
useragent-results/rusturl \
useragent-results/refimpl
ruby resultindex.rb > $@
softerror: softerror.rb \
useragent-results/galimatias \
useragent-results/refimpl
ruby softerror.rb
clean:
rm -rf target *.class Cargo.lock urltestdata.json urlsettest.json \
uri_validate.py uri_validate.js \
useragent-results/index \
useragent-results/addressable \
useragent-results/galimatias \
useragent-results/nodejs \
useragent-results/perl \
useragent-results/python \
useragent-results/rusturl \
useragent-results/refimpl
# useragent-results/csharp \
clobber: clean
rm -f *.jar
urltestdata.json: urltesttojson.js \
../reference-implementation/test/urltestparser.js \
../reference-implementation/test/urltestdata.txt
node urltesttojson.js > $@
useragent-results/refimpl: testrefimpl.js \
../reference-implementation/url.js \
../reference-implementation/urlparser.js \
../reference-implementation/test/urltestdata.txt
node testrefimpl.js > $@
useragent-results/perl: testuri.pl urltestdata.json
perl testuri.pl > $@
useragent-results/python: testurllib.py urltestdata.json
python3 testurllib.py > $@
useragent-results/ruby: testuri.rb urltestdata.json
ruby testuri.rb > $@
useragent-results/addressable: testaddressable.rb urltestdata.json
ruby testaddressable.rb > $@
testuri.exe: testuri.cs
mcs testuri.cs /reference:/usr/lib/cli/Newtonsoft.Json-5.0/Newtonsoft.Json.dll
# useragent-results/csharp: testuri.exe urltestdata.json
# ./testuri.exe urltestdata.json > $@
testgalimatias.class: testgalimatias.java \
icu4j-54.1.1.jar galimatias-0.2.0.jar json-20140107.jar
export CLASSPATH=.:icu4j-54.1.1.jar:galimatias-0.2.0.jar:json-20140107.jar; \
javac testgalimatias.java
useragent-results/galimatias: testgalimatias.class urltestdata.json
export CLASSPATH=.:icu4j-54.1.1.jar:galimatias-0.2.0.jar:json-20140107.jar; \
java testgalimatias >> $@
useragent-results/nodejs: testnodejs.js \
../reference-implementation/test/urltestparser.js \
../reference-implementation/test/urltestdata.txt
node testnodejs.js > $@
target/test_rust_url: Cargo.toml src/main.rs \
../reference-implementation/test/urltestdata.txt
cargo build
useragent-results/rusturl: target/test_rust_url
export USERAGENT="$(shell grep rust-url Cargo.lock | cut -d '"' -f 2 | head -1)"; \
target/test_rust_url | \
ruby -r json -e "puts JSON.pretty_generate(JSON.parse(STDIN.read))" > $@
icu4j-54.1.1.jar:
wget http://central.maven.org/maven2/com/ibm/icu/icu4j/54.1.1/icu4j-54.1.1.jar
galimatias-0.2.0.jar:
wget http://central.maven.org/maven2/io/mola/galimatias/galimatias/0.2.0/galimatias-0.2.0.jar
json-20140107.jar:
wget http://central.maven.org/maven2/org/json/json/20140107/json-20140107.jar
uri_validate.js: uriv-py2js.rb
ruby uriv-py2js.rb > $@