1
0
Fork 0

Converted case of all Makefile vars to lower

closure/master
Mike Gerwitz 2011-05-25 22:11:50 -04:00
parent 46b974dbbe
commit 0a6e8153df
1 changed files with 77 additions and 77 deletions

154
Makefile
View File

@ -1,40 +1,40 @@
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
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')
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
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
path_info_install := /usr/local/share/info
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))
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))
doc_replace := s/<\/body>/<script type="text\/javascript" \
src="interactive.js"><\/script><\/body>/
COMBINE=${PATH_TOOLS}/combine
combine=${path_tools}/combine
.PHONY: combine min doc test test-combine
@ -44,29 +44,29 @@ default: combine min
all: combine min doc
# create build dir
$(PATH_BUILD):
mkdir -p "$(PATH_BUILD)"
$(PATH_DOC_OUTPUT):
mkdir -p "$(PATH_DOC_OUTPUT)"
mkbuild: $(PATH_BUILD)
mkbuild-doc: $(PATH_DOC_OUTPUT)
$(path_build):
mkdir -p "$(path_build)"
$(path_doc_output):
mkdir -p "$(path_doc_output)"
mkbuild: $(path_build)
mkbuild-doc: $(path_doc_output)
# combine all modules into easily redistributable ease.js file (intended for
# browser)
$(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
$(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
test: default
$(MAKE) -C $(PATH_TEST)
$(MAKE) -C $(path_test)
# performance tests
perf: default $(PERF_TESTS)
perf: default $(perf_tests)
perf-%.js: default
@node $@
@ -81,70 +81,70 @@ doc/img/%.png: doc/img/%.dia
dia -e $@ -s 300x $<
# doc pdf
$(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")
$(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")
# doc info
$(PATH_DOC_OUTPUT_INFO): $(doc_src) $(doc_imgs_txt) | mkbuild-doc
makeinfo -I "$(PATH_DOC)" -o $@ "$(PATH_MANUAL_TEXI)";
$(path_doc_output_info): $(doc_src) $(doc_imgs_txt) | mkbuild-doc
makeinfo -I "$(path_doc)" -o $@ "$(path_manual_texi)";
# doc plain text
$(PATH_DOC_OUTPUT_PLAIN): $(doc_imgs_txt) | mkbuild-doc
makeinfo --plain -I "$(PATH_DOC)" "${PATH_MANUAL_TEXI}" > $@
$(path_doc_output_plain): $(doc_imgs_txt) | mkbuild-doc
makeinfo --plain -I "$(path_doc)" "${path_manual_texi}" > $@
# doc html (multiple pages)
$(PATH_DOC_OUTPUT_HTML)/index.html: $(doc_src) \
| $(PATH_DOC_OUTPUT_HTML)/img $(PATH_DOC_OUTPUT_HTML)/interactive.js \
$(path_doc_output_html)/index.html: $(doc_src) \
| $(path_doc_output_html)/img $(path_doc_output_html)/interactive.js \
mkbuild-doc doc-img
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?
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?
# doc html (single page)
$(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}" \
$(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}" \
| sed '$(doc_replace)' \
> "$(PATH_DOC_OUTPUT_HTML1)"
> "$(path_doc_output_html1)"
# doc images (in build dir)
$(PATH_DOC_OUTPUT)/img: $(doc_imgs) | mkbuild-doc doc-img
$(path_doc_output)/img: $(doc_imgs) | mkbuild-doc doc-img
mkdir -p $@
cp "$(PATH_DOC_IMG)"/*.png $@
$(PATH_DOC_OUTPUT_HTML)/img: $(PATH_DOC_OUTPUT)/img
mkdir -p $(PATH_DOC_OUTPUT_HTML)
cp "$(path_doc_img)"/*.png $@
$(path_doc_output_html)/img: $(path_doc_output)/img
mkdir -p $(path_doc_output_html)
ln -s ../img $@
# interactive html doc (js)
$(PATH_DOC_INTERACTIVE_DEST): $(PATH_DOC_INTERACTIVE_SRC)
$(path_doc_interactive_dest): $(path_doc_interactive_src)
cp $< $@
doc-img: $(doc_imgs)
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)
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)
min: build/ease.min.js build/ease-full.min.js
build/%.min.js: build/%.js
cat $(PATH_TOOLS)/license.tpl > $@
node $(PATH_TOOLS)/minify.js < $< >> $@
cat $(path_tools)/license.tpl > $@
node $(path_tools)/minify.js < $< >> $@
install: all
[ -d $(path_info_install) ] || mkdir -p $(path_info_install)
cp $(PATH_DOC_OUTPUT_INFO) $(path_info_install)
cp $(path_doc_output_info) $(path_info_install)
uninstall:
rm $(path_info_install)/easejs.info
# clean up build dir
clean:
rm -rf "${PATH_BUILD}"
rm -rf $(PATH_DOC_IMG)/*.png
rm -rf "${path_build}"
rm -rf $(path_doc_img)/*.png