1
|
# This file is part of Haketilo
|
2
|
#
|
3
|
# Copyright (C) 2021 jahoti
|
4
|
# Copyright (C) 2021, 2022 Wojtek Kosior
|
5
|
#
|
6
|
# This program is free software: you can redistribute it and/or modify
|
7
|
# it under the terms of the CC0 1.0 Universal License as published by
|
8
|
# the Creative Commons Corporation.
|
9
|
#
|
10
|
# This program is distributed in the hope that it will be useful,
|
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
# CC0 1.0 Universal License for more details.
|
14
|
|
15
|
SHELL = /bin/sh
|
16
|
VPATH = <<VPATH>>
|
17
|
|
18
|
version = <<VERSION>>
|
19
|
extension_files = background/ common/ content/ html/ licenses/ \
|
20
|
copyright default_settings.json manifest.json
|
21
|
|
22
|
metafiles = build.sh configure Makefile.in process_html_file.sh README.txt \
|
23
|
re-generate_icons.sh shell_utils.sh upload_amo.sh write_makefile.sh
|
24
|
|
25
|
# Configuration gets included here by write_makefile.sh
|
26
|
|
27
|
# The default target: placed up here
|
28
|
default: $(default_target)
|
29
|
|
30
|
.PHONY: mozilla install-mozilla chromium install-chromium \
|
31
|
all all-unpacked default unpacked \
|
32
|
install install-html install-dvi install-pdf install-ps uninstall \
|
33
|
install-strip clean distclean mostlyclean maintainer-clean TAGS info \
|
34
|
dvi html pdf ps dist check installcheck installdirs \
|
35
|
test test-environment
|
36
|
|
37
|
# core files
|
38
|
icons/haketilo16.png: icons/haketilo.svg
|
39
|
cd "$(srcdir)" && ./re-generate_icons.sh
|
40
|
# Use haketilo16.png as an "index" for all the icon PNGs
|
41
|
|
42
|
# browser-specific targets
|
43
|
all: mozilla chromium
|
44
|
mozilla: mozilla-build.zip
|
45
|
chromium: chromium-build.zip
|
46
|
|
47
|
unpacked: $(default_target)-unpacked Makefile
|
48
|
all-unpacked: mozilla-unpacked chromium-unpacked
|
49
|
%-unpacked: $(extension_files) icons/haketilo16.png
|
50
|
$(srcdir)/build.sh $* $(srcdir) $(UPDATE_URL)
|
51
|
|
52
|
install install-strip: $(default_target)-unpacked
|
53
|
cp -R $(default_target)-unpacked \
|
54
|
"$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
|
55
|
|
56
|
uninstall:
|
57
|
rm -r "$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
|
58
|
|
59
|
%-build.zip: %-unpacked Makefile
|
60
|
cd $< && zip -q -r ../$@ *
|
61
|
|
62
|
test/:
|
63
|
mkdir $@
|
64
|
|
65
|
test/certs/: | test/
|
66
|
mkdir $@
|
67
|
|
68
|
test/certs/%.key: | test/certs/
|
69
|
openssl genrsa -out $@ 2048
|
70
|
|
71
|
test/certs/rootCA.pem: test/certs/rootCA.key
|
72
|
openssl req -x509 -new -nodes -key $< -days 1024 -out $@ \
|
73
|
-subj "/CN=Haketilo Test"
|
74
|
|
75
|
test: test/certs/rootCA.pem test/certs/site.key $(default_target)-build.zip
|
76
|
MOZ_HEADLESS=whatever $(PYTHON) -m pytest
|
77
|
|
78
|
test-environment: test/certs/rootCA.pem test/certs/site.key
|
79
|
python3 -m test
|
80
|
|
81
|
test-environment-with-haketilo: test/certs/rootCA.pem test/certs/site.key \
|
82
|
$(default_target)-build.zip
|
83
|
python3 -m test --load-haketilo
|
84
|
|
85
|
# helper targets
|
86
|
clean mostlyclean:
|
87
|
rm -rf mozilla-unpacked chromium-unpacked haketilo-[1-9]*
|
88
|
rm -f mozilla-build.zip chromium-build.zip exports_init.js
|
89
|
rm -rf test/certs
|
90
|
rm -rf $$(find . -name geckodriver.log)
|
91
|
rm -rf $$(find . -type d -name __pycache__)
|
92
|
rm -rf $$(find . -type d -name injected_scripts)
|
93
|
|
94
|
distclean: clean
|
95
|
rm -f Makefile config.status record.conf
|
96
|
|
97
|
maintainer-clean: distclean
|
98
|
@echo 'This command is intended for maintainers to use; it'
|
99
|
@echo 'deletes files that may need special tools to rebuild.'
|
100
|
rm -f "$(srcdir)"/icons/*.png
|
101
|
|
102
|
dist: $(extension_files) $(metafiles) icons/haketilo16.png
|
103
|
test -d haketilo-$(version) || mkdir haketilo-$(version)
|
104
|
for file in $(extension_files) $(metafiles) icons/; do \
|
105
|
cp -R "$(srcdir)"/$$file haketilo-$(version); \
|
106
|
done
|
107
|
tar cf haketilo-$(version).tar haketilo-$(version)
|
108
|
gzip haketilo-$(version).tar
|
109
|
|
110
|
# Files for constructing the makefile
|
111
|
Makefile: config.status Makefile.in record.conf
|
112
|
./config.status
|
113
|
|
114
|
config.status: write_makefile.sh
|
115
|
cp "$(srcdir)"/write_makefile.sh config.status
|
116
|
|
117
|
# Unused GNU-specified targets
|
118
|
install-html:
|
119
|
install-dvi:
|
120
|
install-pdf:
|
121
|
install-ps:
|
122
|
TAGS:
|
123
|
info:
|
124
|
dvi:
|
125
|
html:
|
126
|
pdf:
|
127
|
ps:
|
128
|
check:
|
129
|
installcheck:
|
130
|
installdirs:
|