-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (34 loc) · 1.17 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
#=============================================================================
UUID=$(shell cat src/metadata.json | python3 -c "import json,sys;obj=json.load(sys.stdin);print(obj['uuid']);")
SRCDIR=src
BUILDDIR=build
FILES=*.json *.js schemas *.css
MKFILE_PATH := $(lastword $(MAKEFILE_LIST))
MKFILE_DIR := $(dir $(MKFILE_PATH))
ABS_MKFILE_PATH := $(abspath $(MKFILE_PATH))
ABS_MKFILE_DIR := $(abspath $(MKFILE_DIR))
ABS_BUILDDIR=$(ABS_MKFILE_DIR)/$(BUILDDIR)
INSTALL_PATH=~/.local/share/gnome-shell/extensions
#=============================================================================
default_target: all
.PHONY: clean all zip install
clean:
rm -rf $(BUILDDIR)
# compile the schemas
all: clean
mkdir -p $(BUILDDIR)/$(UUID)
cp -r src/* $(BUILDDIR)/$(UUID)
@if [ -d $(BUILDDIR)/$(UUID)/schemas ]; then \
glib-compile-schemas $(BUILDDIR)/$(UUID)/schemas; \
fi
xz: all
(cd $(BUILDDIR)/$(UUID); \
tar -czvf $(ABS_BUILDDIR)/$(UUID).tar.xz $(FILES:%=%); \
);
zip: all
(cd $(BUILDDIR)/$(UUID); \
zip -rq $(ABS_BUILDDIR)/$(UUID).zip $(FILES:%=%); \
);
install: all
mkdir -p $(INSTALL_PATH)/$(UUID)
cp -R -p build/$(UUID)/* $(INSTALL_PATH)/$(UUID)