-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
91 lines (62 loc) · 1.73 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
JQ := jq
ifeq (, $(shell which $(JQ)))
$(error "$(JQ)" executable not found)
endif
GETTEXT_DOMAIN := $(shell $(JQ) -r '.["gettext-domain"]' metadata.json)
PACKAGE := $(shell $(JQ) -r ".name" metadata.json)
SETTINGS_SCHEMA := $(shell $(JQ) -r '.["settings-schema"]' metadata.json)
URL := $(shell $(JQ) -r '.url' metadata.json)
UUID := $(shell $(JQ) -r ".uuid" metadata.json)
ZIP_FILE := $(UUID).shell-extension.zip
POT_FILE := po/$(GETTEXT_DOMAIN).pot
PO_FILES := $(wildcard po/*.po)
SOURCES := extension.js prefs.js
EXTRA_SOURCES := \
base32.js \
indicator.js \
myAlertDialog.js \
myEntryRow.js \
mySpinRow.js \
secretUtils.js \
totp.js
GRESOURCE_XML := icons.gresource.xml
GRESOURCE_FILE := $(GRESOURCE_XML:.xml=)
GSCHEMA_XML_FILE := schemas/$(SETTINGS_SCHEMA).gschema.xml
EXTRA_DIST := \
$(GRESOURCE_FILE) \
AUTHORS \
COPYING \
prefs.css \
README.md
.PHONY: all clean install update-po
all: $(ZIP_FILE)
clean:
$(RM) $(ZIP_FILE)
$(RM) $(GRESOURCE_FILE)
$(RM) po/*.mo
$(RM) schemas/gschema.compiled
install: $(ZIP_FILE)
gnome-extensions install --force $(ZIP_FILE)
$(ZIP_FILE): $(EXTRA_DIST) \
$(EXTRA_SOURCES) \
$(GSCHEMA_XML_FILE) \
$(PO_FILES) \
$(SOURCES) \
Makefile
gnome-extensions pack --force \
$(patsubst %,--extra-source=%,$(EXTRA_SOURCES)) \
$(patsubst %,--extra-source=%,$(EXTRA_DIST))
%.gresource: %.gresource.xml \
$(shell glib-compile-resources --generate-dependencies $(GRESOURCE_XML))
glib-compile-resources $< --target=$@
$(POT_FILE): $(SOURCES) $(EXTRA_SOURCES)
xgettext --from-code=UTF-8 \
--copyright-holder="Daniel K. O." \
--package-name="$(PACKAGE)" \
--msgid-bugs-address="$(URL)" \
--output=$@ \
$^
update-po: $(PO_FILES)
%.po: $(POT_FILE)
msgmerge --update $@ $^
touch $@