-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (68 loc) · 2.1 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
###############################################################################################
# ScalableJS http://flams.github.com/scalablejs
# The MIT License (MIT)
# Copyright (c) 2013 Olivier Scherrer <pode.fr@gmail.com>
#
# Targets:
#
# make tests: runs the JsTestDriver tests
#
# make docs: generates the documentation into docs/latest
# make build: generates Scalable.js and Scalable.min.js as they appear in the release
#
# make all: tests + docs + build
#
# #make release VERSION=x.x.x: make all, then creates the package and pushes to github
#
################################################################################################
SRC := $(wildcard src/*.js)
JsTestDriver = $(shell find tools -name "JsTestDriver-*.jar" -type f)
all: tests docs build
clean-docs:
-rm -rf docs/latest/
clean-build:
-rm -rf build/
clean-temp:
rm -f temp.js
docs: clean-docs
java -jar tools/JsDoc/jsrun.jar \
tools/JsDoc/app/run.js src \
-r=2 \
-d=docs/latest/ \
-t=tools/JsDoc/templates/jsdoc
tests: temp.js
java -jar $(JsTestDriver) \
--tests all --reset
build: clean-build Scalable.js
cp LICENSE build/
cp -rf src/ build/src/
release: all
ifndef VERSION
@echo "You must give a VERSION number to make release"
@exit 2
endif
mkdir -p release/tmp/Scalable-$(VERSION)
cp -rf build/* release/tmp/Scalable-$(VERSION)
cd release/tmp/Scalable-$(VERSION); \
sed -i .bak 's#<VERSION>#'$(VERSION)'#' Scalable.js Scalable.min.js; \
rm Scalable.js.bak Scalable.min.js.bak
cd release/tmp/; \
tar czf ../Scalable-$(VERSION).tgz Scalable-$(VERSION)
rm -rf release/tmp/
cp -rf docs/latest/ docs/$(VERSION)/
git add build docs release
git commit -am "released version $(VERSION)"
git push
git tag $(VERSION)
git push --tags
temp.js: clean-temp
r.js -o tools/build.js
Scalable.js: temp.js
mkdir -p build
cat LICENSE-MINI temp.js > build/$@
java -jar tools/GoogleCompiler/compiler.jar \
--js build/Scalable.js \
--js_output_file build/Scalable.min.js \
--create_source_map build/Scalable-map
clean: clean-build clean-docs clean-temp
.PHONY: docs clean-docs clean-build build tests release clean