forked from jstat/jstat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (53 loc) · 1.62 KB
/
Copy pathMakefile
File metadata and controls
70 lines (53 loc) · 1.62 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
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}/plugin/flot.jstat.js
JS = ${DIST_DIR}/jstat.js
JS_MIN = ${DIST_DIR}/jstat.min.js
DOC_DIR = doc
DOC_LIST = `ls ${DOC_DIR}/md/`
all: update_submodules core doc
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_DIR}/jshint-check.js; \
else \
echo "You must have NodeJS installed in order to test jStat against JSHint."; \
fi
min: jstat ${JS_MIN}
doc:
@@echo 'Generating documentation...'
@@mkdir -p ${DIST_DIR}/docs/assets
@@cp ${DOC_DIR}/assets/*.css ${DIST_DIR}/docs/assets/
@@cp ${DOC_DIR}/assets/*.js ${DIST_DIR}/docs/assets/
@@for i in ${DOC_LIST}; do \
${JS_ENGINE} ${BUILD_DIR}/doctool.js ${DOC_DIR}/assets/template.html ${DOC_DIR}/md/$${i} ${DIST_DIR}/docs/$${i%.*}.html; \
done
${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 doc clean update_submodules pull_submodules pull core