forked from sozi-projects/Sozi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (52 loc) · 1.75 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
VERSION := $(shell date +%y.%m-%d%H%M%S)
PLAYER_JS := $(wildcard player/js/*.js)
EXTRAS_JS := $(wildcard player/extras/*.js)
#MINIFY_OPT += --nomunge
MINIFY := juicer merge --skip-verification --arguments "$(MINIFY_OPT)" --force
SRC := \
$(wildcard editors/inkscape/*.py) \
$(wildcard editors/inkscape/extras/*.py) \
$(wildcard editors/inkscape/*.inx) \
$(wildcard editors/inkscape/extras/*.inx) \
$(wildcard doc/install*.html) \
$(wildcard doc/*license.txt) \
$(wildcard player/js/extras/*.js) \
player/js/sozi.js \
player/css/sozi.css
TARGET := $(addprefix release/, $(notdir $(SRC)))
INSTALL_DIR := $(HOME)/.config/inkscape/extensions
TIMESTAMP := release/sozi-timestamp-$(VERSION)
.PHONY: zip verify minify install timestamp clean
all: zip
zip: release/sozi-release-$(VERSION).zip
verify: $(PLAYER_JS) $(EXTRAS_JS)
juicer verify $^
minify: release/sozi.js release/sozi.css
install: $(TARGET)
cp release/*.inx $(INSTALL_DIR)
cp release/*.py $(INSTALL_DIR)
cp release/*.js $(INSTALL_DIR)
cp release/*.css $(INSTALL_DIR)
timestamp: release/sozi-timestamp-$(VERSION)
$(TIMESTAMP):
touch $@
release/sozi-release-$(VERSION).zip: $(TARGET)
cd release ; zip $(notdir $@) $(notdir $^)
release/sozi.js: $(PLAYER_JS)
$(MINIFY) --output $@ player/js/sozi.js
release/%.css: player/css/%.css
$(MINIFY) --output $@ $<
release/%.js: player/js/extras/%.js
$(MINIFY) --output $@ $<
release/%.py: editors/inkscape/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%.py: editors/inkscape/extras/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%.inx: editors/inkscape/%.inx
cp $< $@
release/%.inx: editors/inkscape/extras/%.inx
cp $< $@
release/%: doc/%
cp $< $@
clean:
rm -f $(TARGET) release/sozi-timestamp-*