-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
112 lines (84 loc) · 3.25 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
all: build data-url-samples
clean: build-clean
WGET = wget
CURL = curl
GIT = git
PERL = ./perl
updatenightly: clean local/bin/pmbp.pl deps all
$(GIT) add data
$(CURL) -s -S -L https://gist.githubusercontent.com/wakaba/34a71d3137a52abb562d/raw/gistfile1.txt | sh
$(GIT) add modules
perl local/bin/pmbp.pl --update
$(GIT) add config
$(CURL) -sSLf https://raw.githubusercontent.com/wakaba/ciconfig/master/ciconfig | RUN_GIT=1 REMOVE_UNUSED=1 perl
## ------ Setup ------
deps: git-submodules pmbp-install
git-submodules:
$(GIT) submodule update --init
PMBP_OPTIONS=
local/bin/pmbp.pl:
mkdir -p local/bin
$(CURL) -s -S -L https://raw.githubusercontent.com/wakaba/perl-setupenv/master/bin/pmbp.pl > $@
pmbp-upgrade: local/bin/pmbp.pl
perl local/bin/pmbp.pl $(PMBP_OPTIONS) --update-pmbp-pl
pmbp-update: git-submodules pmbp-upgrade
perl local/bin/pmbp.pl $(PMBP_OPTIONS) --update
pmbp-install: pmbp-upgrade
perl local/bin/pmbp.pl $(PMBP_OPTIONS) --install \
--create-perl-command-shortcut @perl \
--create-perl-command-shortcut @prove
## ------ Build ------
SAVE = $(WGET) -O
build: data
data: data-deps data-main
data-deps: deps
data-main: data/firefox-versions.json data/firefox-locales.json \
data/firefox-latest.txt \
data/geckodriver-latest.txt
build-clean:
rm -fr local/*.html
data/firefox-versions.json: bin/firefox-versions.pl \
local/firefox-releases.html
$(PERL) $< > $@
data/firefox-locales.json: bin/firefox-locales.pl \
local/firefox-locales.html
$(PERL) $< > $@
data/firefox-latest.txt: data/firefox-versions.json local/bin/jq
local/bin/jq '.latest' -r data/firefox-versions.json > $@
data/geckodriver-latest.txt: bin/geckodriver-latest.pl \
local/geckodriver-latest.html
$(PERL) $< > $@
local/firefox-releases.html:
$(SAVE) $@ https://archive.mozilla.org/pub/firefox/releases/
local/firefox-locales.html: data/firefox-latest.txt
$(SAVE) $@ https://archive.mozilla.org/pub/firefox/releases/`cat data/firefox-latest.txt`/linux-x86_64/
local/firefox-blocklist.xml:
$(SAVE) $@ https://raw.githubusercontent.com/mozilla/gecko-dev/master/browser/app/blocklist.xml
local/geckodriver-latest.html:
$(SAVE) $@ https://github.com/mozilla/geckodriver/releases/latest
local/bin/jq:
mkdir -p local/bin
$(WGET) -O $@ https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64
chmod u+x $@
local/psl.dat:
$(WGET) -O $@ https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat
local/psl.txt: local/psl.dat bin/psl.pl
$(PERL) bin/psl.pl > $@
## OBSOLETE
data/firefox-blocklisted-certs.json: bin/firefox-blocklisted-certs.pl \
local/firefox-blocklist.xml
$(PERL) $< > $@
data-url-samples:
## OBSOLETE
data-url-samples-brank: bin/parse-brank.pl bin/url-samples.pl local/psl.txt
$(PERL) bin/parse-brank.pl > local/brank-urls.txt
$(PERL) bin/url-samples.pl < local/brank-urls.txt > data/url-samples/brank/`perl -e '@time=gmtime;printf "%04d%02d",$$time[5]+1900,$$time[4]+1'`.txt
## ------ Tests ------
PROVE = ./prove
test: test-deps test-main
test-deps: deps local/bin/jq
test-main:
$(PROVE) t/*.t
## Per CC0 <https://creativecommons.org/publicdomain/zero/1.0/>, to
## the extent possible under law, the author of this file has waived
## all copyright and related or neighboring rights to the file.