-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
43 lines (40 loc) · 1.24 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
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)
package:
@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=prefs-adw1.ui \
--extra-source=wirelesshid.js \
--extra-source=prefs.css \
-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#