-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (79 loc) · 2.67 KB
/
Makefile
File metadata and controls
91 lines (79 loc) · 2.67 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
build-dir = Build/
map-dir = $(build-dir)/map/
yui-jar = tools/yuicompressor-2.4.8pre.jar
html-replace = $(map-dir)index.html
html-prereq = index.html \
dir-prereq = json \
tiles \
media \
images \
lib \
css-path = css/
css-build-path = $(map-dir)css/
css-page-target = $(css-build-path)revolt.min.css
css-page-prereq = $(css-path)layout.css \
$(css-path)leafletcustom.css \
$(css-path)map.css \
$(css-path)probes.css \
$(css-path)sidepanel.css \
$(css-path)steps.css \
$(css-path)timeline.css \
js-path = js/
js-build-path = $(map-dir)js/
js-page-target = $(js-build-path)revolt.min.js
js-page-prereq = $(js-path)controls.js \
$(js-path)data.js \
$(js-path)init.js \
$(js-path)layout.js \
$(js-path)map.js \
$(js-path)mapcontent.js \
$(js-path)playback.js \
$(js-path)RevoltPopup.js \
$(js-path)timeline.js \
all: $(css-page-target) $(js-page-target)
clean:
@rm -rf $(build-dir)
install: js-build := `cat $(js-page-target) | /usr/bin/openssl sha1 | cut -c1-8`.js
install: css-build := `cat $(css-page-target) | /usr/bin/openssl sha1 | cut -c1-8`.css
install: copy-dir copy-html copy-site all
@cp $(css-page-target) $(css-build-path)$(css-build)
@cp $(js-page-target) $(js-build-path)$(js-build)
@echo "Linking to updated CSS and JavaScript…\t\c"
@sed -i.bak "s|\"js\/.*\.js\"|\"js\/$(js-build)\"|g" $(html-replace)
@sed -i.bak "s|\"css\/.*\.css\"|\"css\/$(css-build)\"|g" $(html-replace)
@sed -i.bak "$$!N; /^\(.*\)\n\1$$/!P; D" $(html-replace)
@rm $(css-page-target)
@rm $(js-page-target)
@rm $(html-replace).bak
@echo "[ Done ]"
@echo "Installation is complete."
$(css-page-target): $(css-page-prereq)
@rm -rf $(css-build-path)
@mkdir -p $(css-build-path)
@rm -f $(css-page-target)
@echo "Merging CSS files…\t\t\t\c"
@cat $(css-page-prereq) > $(css-path)tmp.css
@echo "[ Done ]"
@echo "Compressing merged CSS…\t\c"
@java -jar $(yui-jar) -o $(css-page-target) $(css-path)tmp.css
@echo "[ Done ]"
@rm -f $(css-path)tmp.css
$(js-page-target): $(js-page-prereq)
@rm -rf $(js-build-path)
@mkdir -p $(js-build-path)
@rm -f $(js-page-target)
@echo "Merging JS files…\t\t\t\c"
@cat $(js-page-prereq) > $(js-path)tmp.js
@echo "[ Done ]"
@echo "Compressing merged JS…\t\c"
@java -jar $(yui-jar) -o $(js-page-target) $(js-path)tmp.js
@echo "[ Done ]"
@rm -f $(js-path)tmp.js
copy-dir:
@mkdir -p $(map-dir)
$(foreach dir,$(dir-prereq),rsync -rupE --delete --exclude=".svn*" $(dir) $(map-dir) && ) :
copy-html:
@rm -f $(html-replace)
$(foreach html,$(html-prereq),rsync -rupE --delete --exclude=".svn*" $(html) $(map-dir) && ) :
copy-site:
@cp -rv website/* $(build-dir)