-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
68 lines (53 loc) · 1.79 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
# -*- Mode: Makefile -*-
#
# Makefile for Undo Close Tab
#
FILES = manifest.json \
background.js \
contentscript.js \
default-preferences.json \
_globals.js \
options.html \
options.js \
options.css \
dataurlparser.js \
imagecomments.js \
utils/iconupdater.js \
utils/storage.js \
utils/html-i18n.js \
utils/options.css \
lib/crc32.js \
icons/savescreenshot.svg \
icons/info.svg \
$(wildcard popup/choose_format.*) \
$(wildcard _locales/*/messages.json)
ADDON = savescreenshot
VERSION = $(shell sed -n 's/^ "version": "\([^"]\+\).*/\1/p' manifest.json)
ANDROIDDEVICE = $(shell adb devices | cut -s -d$$'\t' -f1 | head -n1)
WEBEXT_UTILS_REPO = [email protected]:M-Reimer/webext-utils.git
trunk: $(ADDON)-trunk.xpi
release: $(ADDON)-$(VERSION).xpi
%.xpi: $(FILES) icons/$(ADDON)-light.svg
@zip -9 - $^ > $@
icons/$(ADDON)-light.svg: icons/$(ADDON).svg
@sed 's/:#0c0c0d/:#f9f9fa/g' $^ > $@
clean:
rm -f $(ADDON)-*.xpi
rm -f icons/$(ADDON)-light.svg
# Starts local debug session
run: icons/$(ADDON)-light.svg
web-ext run --pref=devtools.browserconsole.contentMessages=true --bc
# Starts debug session on connected Android device
arun: icons/$(ADDON)-light.svg
@if [ -z "$(ANDROIDDEVICE)" ]; then \
echo "No android devices found!"; \
else \
web-ext run --target=firefox-android --firefox-apk=org.mozilla.fenix --android-device="$(ANDROIDDEVICE)"; \
fi
# Subtree stuff for webext-utils
# Note to myself. Initial setup of subtree:
# git subtree add --prefix utils [email protected]:M-Reimer/webext-utils.git master
subtree-pull:
git subtree pull --prefix utils "$(WEBEXT_UTILS_REPO)" master
subtree-push:
git subtree push --prefix utils "$(WEBEXT_UTILS_REPO)" master