-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
64 lines (61 loc) · 1.93 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
SHELL = bash
UUID = [email protected]
BUILD_DIR ?= build
PNG_FILES = $(wildcard ./docs/*.png)
RAW_PATH = "$(BUILD_DIR)/$(UUID).shell-extension.zip"
BUNDLE_PATH = "$(BUILD_DIR)/$(UUID).zip"
.PHONY: build package check release install uninstall clean
build: clean
@mkdir -p $(BUILD_DIR)
$(MAKE) package
@mv -v $(RAW_PATH) $(BUNDLE_PATH)
gresource:
@cd "extension/resources"; \
glib-compile-resources --target=../preferences.gresource preferences.gresource.xml
package: gresource
@mkdir -p $(BUILD_DIR)
@echo "Packing files..."
@cd "extension"; \
gnome-extensions pack --force \
--extra-source=../LICENSE \
--extra-source=../CHANGELOG.md \
--extra-source=../README.md \
--extra-source=crypto \
--extra-source=media \
--extra-source=areaselector.js \
--extra-source=avahi.js \
--extra-source=colorpicker.js \
--extra-source=dtlsclient.js \
--extra-source=extensionmenu.js \
--extra-source=gstreamer.js \
--extra-source=modalselector.js \
--extra-source=phue.js \
--extra-source=phueapi.js \
--extra-source=phueentertainmentapi.js \
--extra-source=phuepanelmenu.js \
--extra-source=phuescreenshot.js \
--extra-source=phuesyncbox.js \
--extra-source=phuesyncboxapi.js \
--extra-source=prefspage.js \
--extra-source=queue.js \
--extra-source=syncboxmenu.js \
--extra-source=utils.js \
--extra-source=preferences.gresource \
-o ../$(BUILD_DIR)/
check:
@if [[ ! -f $(BUNDLE_PATH) ]]; then \
echo -e "\nWARNING! Extension zip couldn't be found"; exit 1; \
elif [[ "$$(stat -c %s $(BUNDLE_PATH))" -gt 4096000 ]]; then \
echo -e "\nWARNING! The extension is too big to be uploaded to the extensions website, keep it smaller than 4096 KB"; exit 1; \
fi
install:
@if [[ ! -f $(BUNDLE_PATH) ]]; then \
$(MAKE) build; \
fi
gnome-extensions install $(BUNDLE_PATH) --force
uninstall:
gnome-extensions uninstall "$(UUID)"
clean:
@rm -rfv $(BUILD_DIR)
@rm -rfv "$(UUID).zip"
@rm -rfv extension/ui/*.ui~ extension/ui/*.ui#