forked from KSXGitHub/circular-widgets-gnome-45
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.1 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
UUID=$$(jq -r .uuid < src/metadata.json)
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 .tsbuildinfo
rm -rf $(BUILDDIR)
deps:
corepack pnpm install --frozen-lockfile
tsc: deps
corepack pnpm exec tsc
assets:
node copy-assets.cjs
build: deps assets tsc
# compile the schemas
all: clean build
mkdir -p $(BUILDDIR)/$(UUID)
cp -r dist/* $(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)