-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
57 lines (52 loc) · 2.07 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
JQUERY_VERSION=1.7.1
RICKSHAW_VERSION=3d43dc0fb263c7eee7bfc6020d8b7fd99637c1ab
TAG=$(shell git tag | PATH="/usr/local/opt/coreutils/libexec/gnubin:$(PATH)" sort --version-sort | tail -n 1)
build: clean static_setup
git archive --format=tar --prefix="ntfserver-$(TAG)/" "$(TAG)" > "ntfserver-$(TAG).tar"
tar -xf "ntfserver-$(TAG).tar"
rm -f "ntfserver-$(TAG).tar"
cp deps/vendor.css "ntfserver-$(TAG)/static/vendor.css"
cp deps/vendor.js "ntfserver-$(TAG)/static/vendor.js"
tar -czf "ntfserver-$(TAG).tgz" "ntfserver-$(TAG)/"
rm -fr "ntfserver-$(TAG)"
static_setup:
rm -fr deps
mkdir -p deps
# get jquery
curl -s http://ajax.googleapis.com/ajax/libs/jquery/$(JQUERY_VERSION)/jquery.min.js > deps/jquery.min.js
# get bootstrap
wget http://getbootstrap.com/2.3.2/assets/bootstrap.zip -O deps/bootstrap.zip
cd deps && unzip bootstrap.zip
# get d3
curl -s https://raw.github.com/shutterstock/rickshaw/$(RICKSHAW_VERSION)/vendor/d3.min.js > deps/d3.min.js
curl -s https://raw.github.com/shutterstock/rickshaw/$(RICKSHAW_VERSION)/vendor/d3.layout.min.js > deps/d3.layout.min.js
# get rickshaw
git clone git://github.com/shutterstock/rickshaw.git deps/rickshaw
cd deps/rickshaw && git checkout $(RICKSHAW_VERSION) && make build
# get swig
curl -s http://paularmstrong.github.io/swig/js/swig.min.js > deps/swig.min.js
# build css
cat deps/rickshaw/rickshaw.min.css > deps/vendor.css
echo >> deps/vendor.css
cat deps/bootstrap/css/bootstrap.min.css >> deps/vendor.css
# build js
cat deps/jquery.min.js > deps/vendor.js
echo >> deps/vendor.js
cat deps/swig.min.js >> deps/vendor.js
echo >> deps/vendor.js
cat deps/bootstrap/js/bootstrap.min.js >> deps/vendor.js
echo >> deps/vendor.js
cat deps/d3.min.js >> deps/vendor.js
echo >> deps/vendor.js
cat deps/d3.layout.min.js >> deps/vendor.js
echo >> deps/vendor.js
cat deps/rickshaw/rickshaw.min.js >> deps/vendor.js
# copy to static
mkdir -p static
cp -f deps/vendor.css static/vendor.css
cp -f deps/vendor.js static/vendor.js
static: static_setup
rm -fr deps
clean:
rm -fr deps static/vendor.*
.PHONY: build clean static static_setup