forked from jstat/jstat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (45 loc) · 1.27 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
SRC_DIR = src
TEST_DIR = test
BUILD_DIR = build
PREFIX = .
DIST_DIR = ${PREFIX}/dist
JS_ENGINE ?= `which node nodejs`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/distribution.js\
${SRC_DIR}/special.js\
${SRC_DIR}/visualisation.js\
${SRC_DIR}/optimisation.js\
${SRC_DIR}/linearalgebra.js
JS = ${DIST_DIR}/jstat.js
JS_MIN = ${DIST_DIR}/jstat.min.js
all: update_submodules core
core: jstat min lint
@@echo "jStat build complete."
${DIST_DIR}:
@@mkdir -p ${DIST_DIR}
jstat: ${JS}
${JS}: ${DIST_DIR}
@@echo "Building" ${JS}
@@cat ${BASE_FILES} > ${JS}
lint: jstat
@@if test ! -z ${JS_ENGINE}; then \
echo "Checking jStat against JSHint..."; \
${JS_ENGINE} build/jshint-check.js; \
else \
echo "You must have NodeJS installed in order to test jStat against JSHint."; \
fi
min: jstat ${JS_MIN}
${JS_MIN}: ${JS}
@@if test ! -z ${JS_ENGINE}; then \
echo "Minifying jStat" ${JS_MIN}; \
${COMPILER} ${JS} > ${JS_MIN}; \
else \
echo "You must have NodeJS installed in order to minify jStat."; \
fi
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}
pull: pull_submodules
@@git pull ${REMOTE} ${BRANCH}
.PHONY: all jstat lint min clean update_submodules pull_submodules pull core