Skip to content

Commit c2afb4c

Browse files
committed
adding documentation creation to Makefile
1 parent bb6fb52 commit c2afb4c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Makefile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ BASE_FILES = ${SRC_DIR}/core.js\
1616
JS = ${DIST_DIR}/jstat.js
1717
JS_MIN = ${DIST_DIR}/jstat.min.js
1818

19-
all: update_submodules core
19+
DOC_DIR = doc
20+
DOC_LIST = `ls ${DOC_DIR}/md/`
21+
22+
all: update_submodules core doc
2023

2124
core: jstat min lint
2225
@@echo "jStat build complete."
@@ -28,19 +31,27 @@ jstat: ${JS}
2831

2932
${JS}: ${DIST_DIR}
3033
@@echo "Building" ${JS}
31-
3234
@@cat ${BASE_FILES} > ${JS}
3335

3436
lint: jstat
3537
@@if test ! -z ${JS_ENGINE}; then \
3638
echo "Checking jStat against JSHint..."; \
37-
${JS_ENGINE} build/jshint-check.js; \
39+
${JS_ENGINE} ${BUILD_DIR}/jshint-check.js; \
3840
else \
3941
echo "You must have NodeJS installed in order to test jStat against JSHint."; \
4042
fi
4143

4244
min: jstat ${JS_MIN}
4345

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+
4455
${JS_MIN}: ${JS}
4556
@@if test ! -z ${JS_ENGINE}; then \
4657
echo "Minifying jStat" ${JS_MIN}; \
@@ -56,4 +67,4 @@ clean:
5667
pull: pull_submodules
5768
@@git pull ${REMOTE} ${BRANCH}
5869

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

Comments
 (0)