@@ -16,7 +16,10 @@ BASE_FILES = ${SRC_DIR}/core.js\
16
16
JS = ${DIST_DIR}/jstat.js
17
17
JS_MIN = ${DIST_DIR}/jstat.min.js
18
18
19
- all : update_submodules core
19
+ DOC_DIR = doc
20
+ DOC_LIST = ` ls ${DOC_DIR} /md/ `
21
+
22
+ all : update_submodules core doc
20
23
21
24
core : jstat min lint
22
25
@@echo " jStat build complete."
@@ -28,19 +31,27 @@ jstat: ${JS}
28
31
29
32
${JS} : ${DIST_DIR}
30
33
@@echo " Building" ${JS}
31
-
32
34
@@cat ${BASE_FILES} > ${JS}
33
35
34
36
lint : jstat
35
37
@@if test ! -z ${JS_ENGINE} ; then \
36
38
echo " Checking jStat against JSHint..." ; \
37
- ${JS_ENGINE} build /jshint-check.js; \
39
+ ${JS_ENGINE} ${BUILD_DIR} /jshint-check.js; \
38
40
else \
39
41
echo " You must have NodeJS installed in order to test jStat against JSHint." ; \
40
42
fi
41
43
42
44
min : jstat ${JS_MIN}
43
45
46
+ doc :
47
+ @@echo ' Generating documentation...'
48
+ @@mkdir -p ${DIST_DIR} /docs/assets
49
+ @@cp ${DOC_DIR} /assets/* .css ${DIST_DIR} /docs/assets/
50
+ @@cp ${DOC_DIR} /assets/* .js ${DIST_DIR} /docs/assets/
51
+ @@for i in ${DOC_LIST} ; do \
52
+ ${JS_ENGINE} ${BUILD_DIR} /doctool.js ${DOC_DIR} /assets/template.html ${DOC_DIR} /md/$$ {i} ${DIST_DIR} /docs/$$ {i%.* }.html; \
53
+ done
54
+
44
55
${JS_MIN} : ${JS}
45
56
@@if test ! -z ${JS_ENGINE} ; then \
46
57
echo " Minifying jStat" ${JS_MIN} ; \
56
67
pull : pull_submodules
57
68
@@git pull ${REMOTE} ${BRANCH}
58
69
59
- .PHONY : all jstat lint min clean update_submodules pull_submodules pull core
70
+ .PHONY : all jstat lint min doc clean update_submodules pull_submodules pull core
0 commit comments