-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
47 lines (36 loc) · 1.05 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
# Basic Makefile
# Retrieve the UUID from ``metadata.json``
UUID = $(shell grep -E '^[ ]*"uuid" :' ./metadata.json | sed 's@^[ ]*"uuid" :[ ]*"\(.\+\)",[ ]*@\1@')
ifeq ($(XDG_DATA_HOME),)
XDG_DATA_HOME = $(HOME)/.local/share
endif
ifeq ($(strip $(DESTDIR)),)
INSTALLBASE = $(XDG_DATA_HOME)/gnome-shell/extensions
else
INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions
endif
INSTALLNAME = $(UUID)
SRC = $(wildcard *.css) \
$(wildcard *.js) \
$(wildcard *.json) \
$(wildcard *.ui) \
$(wildcard schemas/*.gschema.xml) \
schemas/gschemas.compiled
$(info UUID is "$(UUID)")
.PHONY: all clean install zip-file
all: $(SRC)
rm -rf _build
for i in $^ ; do \
mkdir -p _build/$$(dirname $$i) ; \
cp $$i _build/$$i ; \
done
schemas/gschemas.compiled: schemas/*.gschema.xml
glib-compile-schemas schemas
clean:
rm -rf _build
install: all
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
mkdir -p $(INSTALLBASE)/$(INSTALLNAME)
cp -r _build/* $(INSTALLBASE)/$(INSTALLNAME)/
zip-file: all
cd _build && zip -qr "../$(UUID)$(VSTRING).zip" .