-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (26 loc) · 944 Bytes
/
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
#=============================================================================
UUID=$(shell cat src/metadata.json | python3 -c "import json,sys;obj=json.load(sys.stdin);print(obj['uuid']);")
SRCDIR=src
BUILDDIR=build
FILES=metadata.json *.js stylesheet.css schemas icons
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)
#=============================================================================
default_target: all
.PHONY: clean all zip
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
zip: all
(cd $(BUILDDIR)/$(UUID); \
zip -rq $(ABS_BUILDDIR)/$(UUID).zip $(FILES:%=%); \
);