Build examples index

This commit is contained in:
Tom Payne
2012-10-17 11:12:18 +02:00
parent 7f39f1d32d
commit 129578a515
2 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@
/build/src
/examples/*.json
/examples/*.combined.js
/examples/index.html

View File

@@ -11,7 +11,7 @@ EXTERNAL_SRC = \
build/src/external/externs/types.js \
build/src/external/src/exports.js \
build/src/external/src/types.js
EXAMPLES = $(shell find examples -maxdepth 1 -name \*.html)
EXAMPLES = $(filter-out examples/index.html,$(shell find examples -maxdepth 1 -name \*.html))
comma := ,
empty :=
space := $(empty) $(empty)
@@ -63,7 +63,10 @@ build/src/internal/src/types.js: bin/generate-exports src/ol/exports.txt
build-examples: examples $(subst .html,.combined.js,$(EXAMPLES))
.PHONY: examples
examples: $(subst .html,.json,$(EXAMPLES))
examples: examples/index.html $(subst .html,.json,$(EXAMPLES))
examples/index.html: bin/generate-examples-index $(EXAMPLES)
bin/generate-examples-index -o $@ $(EXAMPLES)
examples/%.json: Makefile base.json
echo "{\"id\": \"$(basename $(notdir $@))\", \"inherits\": \"../base.json\", \"inputs\": [\"$(subst .json,.js,$@)\", \"build/src/internal/src/types.js\"]}" > $@