-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
84 lines (61 loc) · 1.84 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
SHELL := bash
TESTFILES := README.md doc/*.md lib/*.knk
LIBS := $(wildcard lib/*.knk)
.PHONY: test test_haskell doctest_hs doctest_knk_hs
.PHONY: test_node doctest_knk_js test_diff
.PHONY: cabal_build clean cleanup
.PHONY: repl_haskell repl_node repl_browser
.PHONY: link_vim_syntax copy_vim_syntax
.PHONY: html html_docs_vim html_index html_links
test: test_haskell test_node test_diff
test_haskell: doctest_hs doctest_knk_hs
doctest_hs:
cabal v2-run doctests # nicer output than v2-test
doctest_knk_hs:
cabal v2-run koneko -- --doctest $(TESTFILES)
test_node: doctest_knk_js
doctest_knk_js:
@echo
node js/koneko --doctest $(TESTFILES) --coverage
test_diff:
scripts/test-diff
cabal_build:
build="cabal v2-build" env=write-ghc-environment-files; \
if $$build --help | grep -q $$env; then \
$$build --$$env=always --enable-tests; \
else \
$$build --enable-tests; \
fi
clean:
cabal v2-clean
rm -f .ghc.environment.*
[ ! -e dist ] || rmdir dist
[ ! -e lib-doc ] || rm -r lib-doc
cleanup:
find -name '*~' -delete -print
repl_haskell:
scripts/repl_hs
repl_node:
scripts/repl_js
repl_browser:
cd js && python3 -m http.server --bind 127.0.0.1
link_vim_syntax:
scripts/copy-or-link-vim-syntax link
copy_vim_syntax:
scripts/copy-or-link-vim-syntax copy
html: html_docs_vim html_index html_links
html_docs_vim: $(patsubst lib/%.knk,lib-doc/%.knk.html,$(LIBS))
lib-doc/%.knk.html: lib/%.knk
mkdir -p lib-doc
scripts/knk2html "$<" "$@"
html_index: $(patsubst lib/%.knk,lib-doc/%.knk.index.html,$(LIBS))
# .SECONDARY: $(patsubst lib/%.knk,lib-doc/%.knk.index.md,$(LIBS))
lib-doc/%.knk.index.html: lib-doc/%.knk.index.md
pandoc -M title="Index of $$(basename "$<" .index.md)" \
-s -f gfm -t html "$<" > "$@"
lib-doc/%.knk.index.md: lib/%.knk
mkdir -p lib-doc
scripts/knk2index "$<" > "$@"
# TODO
html_links: $(LIBS)
@echo TODO