-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (28 loc) · 999 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
all: docclean doc docopen
.PHONY : all
NODE = node
UNAME_S := $(shell uname -s)
apidoc_sources = $(wildcard doc/api/*.markdown)
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
$(addprefix out/,$(apidoc_sources:.markdown=.json))
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
docclean:
-rm -rf out/doc
doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/
$(apidoc_dirs):
mkdir -p $@
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
cp $< $@
out/doc/%: doc/%
cp -r $< $@
out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
$(NODE) tools/doc/generate.js --format=json $< > $@
out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
$(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
docopen: out/doc/api/all.html
ifeq ($(UNAME_S), Darwin)
open -a "Google Chrome" out/doc/api/all.html
else
-google-chrome out/doc/api/all.html
endif