forked from hedayaty/NetSpeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (42 loc) · 1.7 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
PACKAGE=netspeed
GETTEXT_PACKAGE = $(PACKAGE)
UUID = [email protected]
LANGUAGES=ca de en_CA fa fr it pt_BR ru zh_CN zh_TW es_ES nl_NL ru tr zh_CN
DOC_FILES=CHANGELOG README.md
SRC_FILES=extension.js prefs.js net_speed_layout_menu_item.js net_speed.js net_speed_status_icon.js lib.js messages.js
MO_FILES=$(foreach LANGUAGE, $(LANGUAGES), locale/$(LANGUAGE)/LC_MESSAGES/$(GETTEXT_PACKAGE).mo)
SCHEMA_FILES=schemas/gschemas.compiled schemas/org.gnome.shell.extensions.netspeed.gschema.xml
EXTENSION_FILES=stylesheet.css metadata.json
OUTPUT=$(DOC_FILES) $(SRC_FILES) $(MO_FILES) $(SCHEMA_FILES) $(EXTENSION_FILES)
POT_FILE=po/$(GETTEXT_PACKAGE).pot
LOCAL_INSTALL=~/.local/share/gnome-shell/extensions/$(UUID)
pack: update-po schemas/gschemas.compiled $(OUTPUT)
zip $(UUID).zip $(OUTPUT)
$(POT_FILE): $(SRC_FILES)
mkdir -p po
xgettext -d $(GETTEXT_PACKAGE) -o $@ $(SRC_FILES) --from-code=UTF-8
update-po: $(POT_FILE)
for lang in $(LANGUAGES); do \
msgmerge -U po/$$lang.po $(POT_FILE); \
done
locale/%/LC_MESSAGES/netspeed.mo: po/%.po
mkdir -p `dirname $@`
msgfmt $< -o $@
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.netspeed.gschema.xml
glib-compile-schemas schemas
install: pack
mkdir -p $(LOCAL_INSTALL)
rm -rf $(LOCAL_INSTALL)
unzip $(UUID).zip -d $(LOCAL_INSTALL)
enable:
gnome-extensions enable $(UUID)
disable:
gnome-extensions disable $(UUID)
uninstall:
gnome-extensions uninstall $(UUID)
reset:
gnome-extensions reset $(UUID)
reload:
# Reloading shell; Sending SIGHUP signal to gnome-shell (equivalent to alt + f2 ; r ; enter)
# busctl --verbose --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
killall -HUP gnome-shell