1
0
Fork 0

Makefile no longer recombines if unnecessary

closure/master
Mike Gerwitz 2011-03-20 01:25:57 -04:00
parent 799aae0a56
commit 3fe132c862
2 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,7 @@
PATH_BUILD=./build PATH_BUILD=./build
PATH_TOOLS=./tools PATH_TOOLS=./tools
PATH_LIB=./lib
PATH_COMBINE_OUTPUT=${PATH_BUILD}/ease.js PATH_COMBINE_OUTPUT=${PATH_BUILD}/ease.js
PATH_COMBINE_OUTPUT_FULL=${PATH_BUILD}/ease-full.js PATH_COMBINE_OUTPUT_FULL=${PATH_BUILD}/ease-full.js
PATH_BROWSER_TEST=${PATH_TOOLS}/browser-test.html PATH_BROWSER_TEST=${PATH_TOOLS}/browser-test.html
@ -19,6 +20,7 @@ PATH_DOC_CSS=${PATH_DOC}/manual.css
PATH_DOC_IMG=${PATH_DOC}/img PATH_DOC_IMG=${PATH_DOC}/img
PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi
src_js := index.js $(wildcard $(PATH_LIB)/*.js)
doc_src := $(wildcard $(PATH_DOC)/*.texi) doc_src := $(wildcard $(PATH_DOC)/*.texi)
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia)) doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia))
@ -31,25 +33,29 @@ TESTS := $(shell find "$(PATH_TEST)" \
TEST_COMBINE := $(PATH_TEST)/test-combine*.js TEST_COMBINE := $(PATH_TEST)/test-combine*.js
.PHONY: test test-combine doc .PHONY: combine doc test test-combine
default: combine default: combine
all: combine doc all: combine doc
# create build dir # create build dir
mkbuild: $(PATH_BUILD):
mkdir -p "$(PATH_BUILD)" mkdir -p "$(PATH_BUILD)"
$(PATH_DOC_OUTPUT): $(PATH_DOC_OUTPUT):
mkdir -p "$(PATH_DOC_OUTPUT)" mkdir -p "$(PATH_DOC_OUTPUT)"
mkbuild-doc: | $(PATH_DOC_OUTPUT) mkbuild: $(PATH_BUILD)
mkbuild-doc: $(PATH_DOC_OUTPUT)
# combine all modules into easily redistributable ease.js file (intended for # combine all modules into easily redistributable ease.js file (intended for
# browser) # browser)
combine: mkbuild $(PATH_COMBINE_OUTPUT): $(src_js) | mkbuild
${COMBINE} > "${PATH_COMBINE_OUTPUT}" ${COMBINE} > "$(PATH_COMBINE_OUTPUT)"
INC_TEST=1 "${COMBINE}" > "${PATH_COMBINE_OUTPUT_FULL}" $(PATH_COMBINE_OUTPUT_FULL): $(src_js) | mkbuild
cp "${PATH_BROWSER_TEST}" "${PATH_BUILD}" 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
# run tests # run tests
test: default $(TESTS) test-combine test: default $(TESTS) test-combine

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB