forked from polcak/jsrestrictor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (53 loc) · 1.51 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
# SPDX-FileCopyrightText: 2019 Martin Timko
# SPDX-FileCopyrightText: 2019-2021 Libor Polčák
# SPDX-FileCopyrightText: 2020 Peter Horňák
# SPDX-FileCopyrightText: 2021 Giorgio Maone
#
# SPDX-License-Identifier: GPL-3.0-or-later
DEBUG=0
all: firefox chrome
.PHONY: firefox chrome clean get_csv docs
firefox: firefox_JSR.zip
chrome: chrome_JSR.zip
COMMON_FILES = $(shell find common/) \
LICENSES/ \
Makefile \
$(shell find firefox/) \
$(shell find chrome/)
PROJECT_NAME = $(shell grep ^PROJECT_NAME doxyfile | cut -f2 -d'"')
debug=1
get_csv:
wget -q -N https://www.iana.org/assignments/locally-served-dns-zones/ipv4.csv
cp ipv4.csv common/ipv4.dat
wget -q -N https://www.iana.org/assignments/locally-served-dns-zones/ipv6.csv
cp ipv6.csv common/ipv6.dat
submodules:
git submodule init
git submodule update
%_JSR.zip: $(COMMON_FILES) get_csv submodules
@rm -rf $*_JSR/ $@
@cp -r common/ $*_JSR/
@cp -r $*/* $*_JSR/
@cp -r LICENSES $*_JSR/
@./fix_manifest.sh $*_JSR/manifest.json
@nscl/include.sh $*_JSR
@if [ $(DEBUG) -eq 0 ]; \
then \
find $*_JSR/ -type f -name "*.js" -exec sed -i '/console\.debug/d' {} + ; \
fi
@rm -f $*_JSR/.*.sw[pno]
@rm -f $*_JSR/img/makeicons.sh
@find $*_JSR/ -name '*.license' -delete
@cd $*_JSR/ && zip -q -r ../$@ ./* --exclude \*.sw[pno]
debug: DEBUG=1
debug: all
clean:
rm -rf firefox_JSR.zip
rm -rf firefox_JSR
rm -rf chrome_JSR.zip
rm -rf chrome_JSR
rm -rf common/ipv4.dat
rm -rf common/ipv6.dat
rm -rf ipv4.csv
rm -rf ipv6.csv
rm -rf doxygen/