2010-11-10 19:38:06 -05:00
|
|
|
|
2011-05-25 22:11:50 -04:00
|
|
|
path_build=./build
|
|
|
|
path_tools=./tools
|
|
|
|
path_lib=./lib
|
|
|
|
path_combine_output=${path_build}/ease.js
|
|
|
|
path_combine_output_full=${path_build}/ease-full.js
|
|
|
|
path_browser_test=${path_tools}/browser-test.html
|
|
|
|
path_test=./test
|
|
|
|
path_perf_test=${path_test}/perf
|
|
|
|
|
|
|
|
perf_tests := $(shell find "$(path_perf_test)" -name 'perf-*.js')
|
|
|
|
|
|
|
|
path_doc=./doc
|
|
|
|
path_doc_output=${path_build}/doc
|
|
|
|
path_doc_output_info=${path_doc_output}/easejs.info
|
|
|
|
path_doc_output_plain=${path_doc_output}/manual.txt
|
|
|
|
path_doc_output_html=${path_doc_output}/manual
|
|
|
|
path_doc_output_html1=${path_doc_output}/manual.html
|
|
|
|
path_doc_css=${path_doc}/manual.css
|
|
|
|
path_doc_img=${path_doc}/img
|
|
|
|
path_doc_interactive_src=$(path_doc)/interactive.js
|
|
|
|
path_doc_interactive_dest=$(path_doc_output)/interactive.js \
|
|
|
|
$(path_doc_output_html)/interactive.js
|
|
|
|
path_manual_texi=${path_doc}/manual.texi
|
2010-12-19 23:51:22 -05:00
|
|
|
|
2011-05-25 22:03:36 -04:00
|
|
|
path_info_install := /usr/local/share/info
|
|
|
|
|
2011-05-25 22:11:50 -04:00
|
|
|
src_js := index.js $(wildcard $(path_lib)/*.js)
|
|
|
|
src_tests := index.js $(wildcard $(path_test)/test-*)
|
|
|
|
doc_src := $(wildcard $(path_doc)/*.texi)
|
|
|
|
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.dia))
|
|
|
|
doc_imgs_txt := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.txt))
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-21 21:09:36 -04:00
|
|
|
doc_replace := s/<\/body>/<script type="text\/javascript" \
|
|
|
|
src="interactive.js"><\/script><\/body>/
|
|
|
|
|
2011-05-25 22:11:50 -04:00
|
|
|
combine=${path_tools}/combine
|
2010-12-19 23:51:22 -05:00
|
|
|
|
|
|
|
|
2011-05-25 22:04:19 -04:00
|
|
|
.PHONY: combine min doc test test-combine
|
2010-11-10 19:38:06 -05:00
|
|
|
|
2010-12-19 23:51:22 -05:00
|
|
|
|
2011-05-23 18:38:13 -04:00
|
|
|
default: combine min
|
2011-05-25 22:04:19 -04:00
|
|
|
all: combine min doc
|
2010-12-19 23:51:22 -05:00
|
|
|
|
|
|
|
# create build dir
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_build):
|
|
|
|
mkdir -p "$(path_build)"
|
|
|
|
$(path_doc_output):
|
|
|
|
mkdir -p "$(path_doc_output)"
|
|
|
|
mkbuild: $(path_build)
|
|
|
|
mkbuild-doc: $(path_doc_output)
|
2010-12-19 23:51:22 -05:00
|
|
|
|
|
|
|
# combine all modules into easily redistributable ease.js file (intended for
|
|
|
|
# browser)
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_combine_output): $(src_js) | mkbuild
|
|
|
|
${combine} > "$(path_combine_output)"
|
|
|
|
$(path_combine_output_full): $(src_js) $(src_tests) | mkbuild
|
|
|
|
INC_TEST=1 "$(combine)" > "${path_combine_output_full}"
|
|
|
|
$(path_build)/browser-test.html: $(path_combine_output_full)
|
|
|
|
cp "$(path_browser_test)" "$(path_build)"
|
|
|
|
combine: $(path_combine_output) $(path_build)/browser-test.html
|
2010-12-19 23:51:22 -05:00
|
|
|
|
2011-03-20 02:28:40 -04:00
|
|
|
|
2011-03-27 01:57:55 -04:00
|
|
|
test: default
|
2011-05-25 22:11:50 -04:00
|
|
|
$(MAKE) -C $(path_test)
|
2010-12-19 23:51:22 -05:00
|
|
|
|
2011-03-10 22:55:07 -05:00
|
|
|
# performance tests
|
2011-05-25 22:11:50 -04:00
|
|
|
perf: default $(perf_tests)
|
2011-03-11 19:47:00 -05:00
|
|
|
perf-%.js: default
|
|
|
|
@node $@
|
2010-12-19 23:51:22 -05:00
|
|
|
|
2011-03-08 00:06:34 -05:00
|
|
|
# generate texinfo documentation (twice to generate TOC), then remove the extra
|
2011-03-09 00:01:22 -05:00
|
|
|
# files that were generated
|
|
|
|
#
|
2011-03-20 00:44:06 -04:00
|
|
|
# generates: pdf, info, HTML (multiple pages), HTML (single page)
|
|
|
|
doc: | doc-pdf doc-info doc-plain doc-html
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc images
|
2011-03-19 19:35:21 -04:00
|
|
|
doc/img/%.png: doc/img/%.dia
|
2011-03-20 15:08:21 -04:00
|
|
|
dia -e $@ -s 300x $<
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc pdf
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output)/%.pdf: $(doc_src) $(doc_imgs) | mkbuild-doc doc-img
|
|
|
|
TEXINPUTS="$(path_doc):" \
|
|
|
|
pdftex -output-directory "${path_doc}" "${path_manual_texi}" && \
|
|
|
|
TEXINPUTS="$(path_doc):" \
|
|
|
|
pdftex -output-directory "${path_doc}" "${path_manual_texi}"
|
|
|
|
mv -f "${path_doc}"/*.pdf "${path_doc_output}"
|
|
|
|
cd "$(path_doc)" && rm -f $(shell cat "$(path_doc)/.gitignore")
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc info
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output_info): $(doc_src) $(doc_imgs_txt) | mkbuild-doc
|
|
|
|
makeinfo -I "$(path_doc)" -o $@ "$(path_manual_texi)";
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc plain text
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output_plain): $(doc_imgs_txt) | mkbuild-doc
|
|
|
|
makeinfo --plain -I "$(path_doc)" "${path_manual_texi}" > $@
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc html (multiple pages)
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output_html)/index.html: $(doc_src) \
|
|
|
|
| $(path_doc_output_html)/img $(path_doc_output_html)/interactive.js \
|
2011-03-21 21:09:36 -04:00
|
|
|
mkbuild-doc doc-img
|
2011-05-25 22:11:50 -04:00
|
|
|
makeinfo --html --css-include="${path_doc_css}" \
|
|
|
|
-I "$(path_doc)" -o "${path_doc_output_html}" "${path_manual_texi}"
|
|
|
|
sed -i '$(doc_replace)' $(path_doc_output_html)/*.htm?
|
2011-03-20 00:44:06 -04:00
|
|
|
|
|
|
|
# doc html (single page)
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output_html1): $(doc_src) \
|
|
|
|
| $(path_doc_output)/img $(path_doc_output)/interactive.js mkbuild-doc doc-img
|
|
|
|
makeinfo --no-split --html --css-include="${path_doc_css}" \
|
|
|
|
-I "$(path_doc)" -o - "${path_manual_texi}" \
|
2011-03-21 21:09:36 -04:00
|
|
|
| sed '$(doc_replace)' \
|
2011-05-25 22:11:50 -04:00
|
|
|
> "$(path_doc_output_html1)"
|
2011-03-19 19:35:21 -04:00
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
# doc images (in build dir)
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_output)/img: $(doc_imgs) | mkbuild-doc doc-img
|
2011-03-20 00:44:06 -04:00
|
|
|
mkdir -p $@
|
2011-05-25 22:11:50 -04:00
|
|
|
cp "$(path_doc_img)"/*.png $@
|
|
|
|
$(path_doc_output_html)/img: $(path_doc_output)/img
|
|
|
|
mkdir -p $(path_doc_output_html)
|
2011-03-20 00:44:06 -04:00
|
|
|
ln -s ../img $@
|
|
|
|
|
2011-03-21 21:09:36 -04:00
|
|
|
# interactive html doc (js)
|
2011-05-25 22:11:50 -04:00
|
|
|
$(path_doc_interactive_dest): $(path_doc_interactive_src)
|
2011-03-21 21:09:36 -04:00
|
|
|
cp $< $@
|
|
|
|
|
2011-03-20 00:44:06 -04:00
|
|
|
doc-img: $(doc_imgs)
|
2011-05-25 22:11:50 -04:00
|
|
|
doc-pdf: $(path_doc_output)/manual.pdf
|
|
|
|
doc-info: $(path_doc_output_info)
|
|
|
|
doc-plain: $(path_doc_output_plain)
|
|
|
|
doc-html: $(path_doc_output_html)/index.html $(path_doc_output_html1)
|
2011-03-08 00:06:34 -05:00
|
|
|
|
2011-05-23 18:27:42 -04:00
|
|
|
min: build/ease.min.js build/ease-full.min.js
|
|
|
|
build/%.min.js: build/%.js
|
2011-05-25 22:11:50 -04:00
|
|
|
cat $(path_tools)/license.tpl > $@
|
|
|
|
node $(path_tools)/minify.js < $< >> $@
|
2011-05-23 18:27:42 -04:00
|
|
|
|
2011-05-25 22:40:51 -04:00
|
|
|
install: doc-info
|
2011-05-25 22:03:36 -04:00
|
|
|
[ -d $(path_info_install) ] || mkdir -p $(path_info_install)
|
2011-05-25 22:11:50 -04:00
|
|
|
cp $(path_doc_output_info) $(path_info_install)
|
2011-05-25 22:03:36 -04:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm $(path_info_install)/easejs.info
|
|
|
|
|
2010-12-19 23:51:22 -05:00
|
|
|
# clean up build dir
|
2011-03-08 23:48:47 -05:00
|
|
|
clean:
|
2011-05-25 22:11:50 -04:00
|
|
|
rm -rf "${path_build}"
|
|
|
|
rm -rf $(path_doc_img)/*.png
|
2011-03-08 00:06:34 -05:00
|
|
|
|