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
|
icons/ copyright default_settings.json manifest.json
|
21
|
|
22
|
|
23
|
metafiles = build.sh configure Makefile.in compute_scripts.awk README.txt \
|
24
|
re-generate_icons.sh shell_utils.sh upload_amo.sh write_makefile.sh
|
25
|
|
26
|
# Configuration gets included here by write_makefile.sh
|
27
|
|
28
|
# The default target: placed up here
|
29
|
default: $(default_target)
|
30
|
|
31
|
.PHONY: mozilla install-mozilla chromium install-chromium \
|
32
|
all all-unpacked default unpacked \
|
33
|
install install-html install-dvi install-pdf install-ps uninstall \
|
34
|
install-strip clean distclean mostlyclean maintainer-clean TAGS info \
|
35
|
dvi html pdf ps dist check installcheck installdirs \
|
36
|
test test-environment
|
37
|
|
38
|
# core files
|
39
|
icons/haketilo16.png: icons/haketilo.svg
|
40
|
cd "$(srcdir)" && ./re-generate_icons.sh
|
41
|
# Use haketilo16.png as an "index" for all the icon PNGs
|
42
|
|
43
|
# browser-specific targets
|
44
|
all: mozilla chromium
|
45
|
mozilla: mozilla-build.zip
|
46
|
chromium: chromium-build.zip
|
47
|
|
48
|
unpacked: $(default_target)-unpacked Makefile
|
49
|
all-unpacked: mozilla-unpacked chromium-unpacked
|
50
|
%-unpacked: $(extension_files) icons/haketilo16.png
|
51
|
"$(srcdir)/build.sh" $* $(srcdir) $(UPDATE_URL)
|
52
|
|
53
|
install install-strip: $(default_target)-unpacked
|
54
|
cp -R $(default_target)-unpacked \
|
55
|
"$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
|
56
|
|
57
|
uninstall:
|
58
|
rm -r "$(DESTDIR)/{6fe13369-88e9-440f-b837-5012fb3bedec}"
|
59
|
|
60
|
%-build.zip: %-unpacked Makefile
|
61
|
cd $< && zip -q -r ../$@ *
|
62
|
|
63
|
certs/:
|
64
|
mkdir $@
|
65
|
|
66
|
certs/%.key: | certs/
|
67
|
openssl genrsa -out $@ 2048
|
68
|
|
69
|
certs/rootCA.pem: certs/rootCA.key
|
70
|
openssl req -x509 -new -nodes -key $< -days 1024 -out $@ \
|
71
|
-subj "/CN=Haketilo Test"
|
72
|
|
73
|
pytest.ini: pytest.ini.in
|
74
|
sed "s|<<SRCDIR>>|$(srcdir)|" <$< > $@
|
75
|
|
76
|
test: certs/rootCA.pem certs/site.key $(default_target)-build.zip \
|
77
|
pytest.ini
|
78
|
PYTHONPYCACHEPREFIX=$$(pwd)/test__pycache__ MOZ_HEADLESS=whatever \
|
79
|
"$(PYTHON)" -m pytest
|
80
|
|
81
|
test-environment: certs/rootCA.pem certs/site.key
|
82
|
"$(PYTHON)" -m test
|
83
|
|
84
|
test-environment-with-haketilo: certs/rootCA.pem certs/site.key \
|
85
|
$(default_target)-build.zip
|
86
|
"$(PYTHON)" -m test --load-haketilo
|
87
|
|
88
|
# helper targets
|
89
|
clean mostlyclean:
|
90
|
rm -rf mozilla-unpacked chromium-unpacked haketilo-[1-9]*
|
91
|
rm -f mozilla-build.zip chromium-build.zip exports_init.js
|
92
|
rm -rf pytest.ini certs injected_scripts geckodriver.log
|
93
|
rm -rf certs/ test__pycache__/ .pytest_cache/
|
94
|
|
95
|
distclean: clean
|
96
|
rm -f Makefile config.status record.conf
|
97
|
|
98
|
maintainer-clean: distclean
|
99
|
@echo 'This command is intended for maintainers to use; it'
|
100
|
@echo 'deletes files that may need special tools to rebuild.'
|
101
|
rm -f "$(srcdir)"/icons/*.png
|
102
|
|
103
|
# Files for constructing the makefile
|
104
|
Makefile: config.status Makefile.in record.conf
|
105
|
./config.status
|
106
|
|
107
|
config.status: write_makefile.sh
|
108
|
cp "$(srcdir)"/write_makefile.sh config.status
|
109
|
|
110
|
# Unused GNU-specified targets
|
111
|
dist:
|
112
|
install-html:
|
113
|
install-dvi:
|
114
|
install-pdf:
|
115
|
install-ps:
|
116
|
TAGS:
|
117
|
info:
|
118
|
dvi:
|
119
|
html:
|
120
|
pdf:
|
121
|
ps:
|
122
|
check:
|
123
|
installcheck:
|
124
|
installdirs:
|