-
Notifications
You must be signed in to change notification settings - Fork 269
/
Makefile
91 lines (69 loc) · 2.28 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
91
# Retrieve the UUID from ``metadata.json``
UUID = $(shell grep -E '^[ ]*"uuid":' ./metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@')
VERSION = $(shell grep version tsconfig.json | awk -F\" '{print $$4}')
ifeq ($(XDG_DATA_HOME),)
XDG_DATA_HOME = $(HOME)/.local/share
endif
ifeq ($(strip $(DESTDIR)),)
INSTALLBASE = $(XDG_DATA_HOME)/gnome-shell/extensions
PLUGIN_BASE = $(XDG_DATA_HOME)/pop-shell/launcher
SCRIPTS_BASE = $(XDG_DATA_HOME)/pop-shell/scripts
else
INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions
PLUGIN_BASE = $(DESTDIR)/usr/lib/pop-shell/launcher
SCRIPTS_BASE = $(DESTDIR)/usr/lib/pop-shell/scripts
endif
INSTALLNAME = $(UUID)
PROJECTS = color_dialog floating_exceptions
$(info UUID is "$(UUID)")
.PHONY: all clean install zip-file
sources = src/*.ts *.css
all: depcheck compile
clean:
rm -rf _build target
# Configure local settings on system
configure:
sh scripts/configure.sh
compile: $(sources) clean
env PROJECTS="$(PROJECTS)" ./scripts/transpile.sh
# Rebuild, install, reconfigure local settings, restart shell, and listen to journalctl logs
debug: depcheck compile install configure enable restart-shell listen
depcheck:
@echo depcheck
@if ! command -v tsc >/dev/null; then \
echo \
echo 'You must install TypeScript >= 3.8 to transpile: (node-typescript on Debian systems)'; \
exit 1; \
fi
enable:
gnome-extensions enable "[email protected]"
disable:
gnome-extensions disable "[email protected]"
listen:
journalctl -o cat -n 0 -f "$$(which gnome-shell)" | grep -v warning
local-install: depcheck compile install configure restart-shell enable
install:
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
mkdir -p $(INSTALLBASE)/$(INSTALLNAME) $(PLUGIN_BASE) $(SCRIPTS_BASE)
cp -r _build/* $(INSTALLBASE)/$(INSTALLNAME)/
uninstall:
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
restart-shell:
@echo "Restart shell!"
ifneq ($(WAYLAND_DISPLAY),) # Don't restart if WAYLAND_DISPLAY is set
@echo "WAYLAND_DISPLAY is set, not restarting shell";
else
if bash -c 'xprop -root &> /dev/null'; then \
pkill -HUP gnome-shell; \
else \
gnome-session-quit --logout; \
fi
sleep 3
endif
update-repository:
git fetch origin
git reset --hard origin/master
git clean -fd
zip-file: all
cd _build && zip -qr "../$(UUID)_$(VERSION).zip" .
.NOTPARALLEL: debug local-install