Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (50 loc) · 1.53 KB
/
Copy pathMakefile
File metadata and controls
63 lines (50 loc) · 1.53 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
OUTPUT = output
SRC = 'src/**/*.purs'
LIB = 'bower_components/purescript-*/src/**/*.purs'
SRC_FFI = 'src/**/*.js'
LIB_FFI = 'bower_components/purescript-*/src/**/*.js'
example = 'example/Main.purs'
EXAMPLE_OUT=/tmp/purescript-spec-example-output.out
EXAMPLE_CSS=/tmp/purescript-spec-example.css
EXAMPLE_HTML=/tmp/purescript-spec-example-output.html
$(OUTPUT):
mkdir -p $@
ctags:
psc-docs \
--format ctags \
$(SRC) \
$(LIB) \
> tags
build-example: $(OUTPUT)
pulp build -I example --to $(OUTPUT)/example.js
run-example: build-example
@NODE_PATH=$(OUTPUT) node -e "require('Main').main();"
$(EXAMPLE_CSS): example/styles.css
cp example/styles.css $(EXAMPLE_CSS)
example.png: build-example $(EXAMPLE_CSS)
@NODE_PATH=$(OUTPUT) node -e "require('Main').main();" > $(EXAMPLE_OUT)
aha -s -f $(EXAMPLE_OUT) | awk '/head/{print "<link rel=\"stylesheet\" href=\"$(EXAMPLE_CSS)\" \>"}1' > $(EXAMPLE_HTML)
phantomjs example/rasterize.js $(EXAMPLE_HTML) example.png 200 4
gm convert example.png -trim example.png
MD_SOURCES=\
docs/index.md \
docs/introduction.md \
docs/installation.md \
docs/writing-specs.md \
docs/running.md \
docs/next-steps.md
docs/index.html: $(MD_SOURCES) docs/template.html docs/docs.css
pandoc $(SHARED_PANDOC_OPTIONS) \
-t html5 \
--standalone \
--toc \
--top-level-division=chapter \
"--metadata=subtitle:$(VERSION)" \
--no-highlight \
-c docs.css \
-o docs/index.html \
--base-header-level=2 \
--template=docs/template.html \
$(MD_SOURCES)
.PHONY: docs
docs: docs/index.html