forked from sozi-projects/Sozi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (48 loc) · 1.53 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
VERSION := $(shell date +%y.%m-%d%H%M%S)
PLAYER_JS := $(wildcard player/*.js)
EXTRAS_JS := $(wildcard extras/*.js)
#MINIFY_OPT += --nomunge
MINIFY := juicer merge --skip-verification --arguments "$(MINIFY_OPT)" --force
SRC := $(wildcard */*.py) \
$(wildcard */*.inx) \
$(wildcard doc/install*.html) \
$(wildcard doc/*license.txt) \
$(wildcard extras/*.js) \
player/sozi.js \
player/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
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/sozi.js
release/%.css: player/%.css
$(MINIFY) --output $@ $<
release/%.js: extras/%.js
$(MINIFY) --output $@ $<
release/%.py: editor/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%.py: extras/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%: doc/%
cp $< $@
release/%.inx: editor/%.inx
cp $< $@
release/%.inx: extras/%.inx
cp $< $@
clean:
rm -f $(TARGET) release/sozi-timestamp-*