Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
55 lines (41 loc) · 1.54 KB
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
UUID = $(shell grep -oP '"uuid":\s*"\K[^"]+' metadata.json)
EXT_DIR = ~/.local/share/gnome-shell/extensions/$(UUID)
FILES = extension.js metadata.json lib prefs schemas prefs.js
.PHONY: all sync install uninstall test pack enable disable clean reminder do_sync do_enable compile-schemas
all: sync
reminder:
@echo ""
@echo "========================================================="
@echo " REMINDER: Log out and log back in for changes to take effect"
@echo "========================================================="
@echo ""
compile-schemas:
glib-compile-schemas schemas/
sync: compile-schemas do_sync reminder
do_sync:
mkdir -p $(EXT_DIR)
rsync -a --delete $(FILES) $(EXT_DIR)/
install: compile-schemas do_sync
@echo ""
@echo "========================================================="
@echo " Log out and back in, then run: make enable"
@echo "========================================================="
@echo ""
test:
npm test && npx eslint .
# GNOME 44+ compiles the schema on install: the zip ships only the XML. Rebuilt from scratch, since zip -r adds
# to an existing archive and would keep files that were deleted from the source tree.
pack:
rm -f extension.zip
zip -r extension.zip $(FILES) -x schemas/gschemas.compiled
enable: do_enable reminder
do_enable:
gnome-extensions enable $(UUID)
disable:
gnome-extensions disable $(UUID)
uninstall:
gnome-extensions disable $(UUID) 2>/dev/null || true
rm -rf $(EXT_DIR)
@echo "Extension uninstalled. Log out and back in to complete."
clean:
rm -f extension.zip schemas/gschemas.compiled