2012-08-14 02:03:06 +00:00
|
|
|
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
|
|
|
|
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))
|
2012-10-27 16:47:09 +00:00
|
|
|
|
2012-10-31 17:12:12 +00:00
|
|
|
docassets = $(addprefix out/,$(wildcard doc/assets/*))
|
2012-10-27 16:47:09 +00:00
|
|
|
|
2012-10-27 15:28:15 +00:00
|
|
|
VERSION = $(shell node -e "console.log( require('./src/package.json').version )")
|
2013-01-27 16:45:01 +00:00
|
|
|
UNAME := $(shell uname -s)
|
2012-08-14 02:03:06 +00:00
|
|
|
|
2012-10-27 16:47:09 +00:00
|
|
|
docs: $(outdoc_files) $(docassets)
|
|
|
|
|
2012-10-31 17:12:12 +00:00
|
|
|
out/doc/assets/%: doc/assets/%
|
2012-10-27 16:47:09 +00:00
|
|
|
mkdir -p $(@D)
|
|
|
|
cp $< $@
|
2012-08-14 02:03:06 +00:00
|
|
|
|
|
|
|
out/doc/%.html: doc/%.md
|
|
|
|
mkdir -p $(@D)
|
|
|
|
node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
2013-01-27 16:59:52 +00:00
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
sed -i '' 's/__VERSION__/${VERSION}/' $@
|
|
|
|
else
|
|
|
|
sed -i 's/__VERSION__/${VERSION}/' $@
|
|
|
|
endif
|
2012-08-14 02:03:06 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf out/
|