-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (66 loc) · 1.61 KB
/
Makefile
File metadata and controls
85 lines (66 loc) · 1.61 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
SHELL := /usr/bin/env bash -O globstar
NBIN := $(shell yarn bin)
DOC := $(shell find doc -type f)
ORG := $(shell find doc -type f -iname '*.org')
SITE_DOC := $(DOC:%=site/%)
SITE_HTML := $(ORG:%.org=site/%.html)
PANDOC_DEPS := $(shell find scripts -type f -iname 'pandoc-*')
.PHONY: default
default: site
site/doc/%: doc/%
@mkdir -p $(dir $@)
cp $< $@
site/%.html: %.org $(PANDOC_DEPS)
@mkdir -p $(dir $@)
pandoc -f org -t html5 \
-o $@ \
--parse-raw \
--no-highlight \
--section-divs \
--toc \
--standalone \
--template scripts/pandoc-template.html \
--filter scripts/pandoc-site-filter.js \
$<
site/module.nav: $(SITE_HTML)
@rm -rf $@
for path in $$(find src demo -type f); \
do echo $$path >>$@; \
done
.PHONY: test
test: site
NODE_PATH=./:./src/ $(NBIN)/ts-node -P test test/demo.ts
.PHONY: test-repl
test-repl: site
NODE_PATH=./:./src/ $(NBIN)/ts-node -P test
.PHONY: statics
statics:
rsync -a static site
.PHONY: html
html: $(SITE_HTML)
.PHONY: site-src
site-src: html
rsync -a src site
.PHONY: site-demo
site-demo: html
rsync -a demo site
.PHONY: site
site: html statics site-src site-demo $(SITE_DOC) site/module.nav
.PHONY: webpack
webpack: site
$(NBIN)/webpack --config webpack.config.vendor.ts
$(NBIN)/webpack --config webpack.config.ts
.PHONY: webpack-dev
webpack-dev: site
NODE_ENV=development \
$(NBIN)/nodemon --watch webpack.config.ts \
$(NBIN)/webpack-dev-server --hot --watch
.PHONY: serve
serve:
$(NBIN)/http-server site
.PHONY: lint-worker
lint-worker:
$(NBIN)/tslint src/worker/**/*.ts -p src/worker/tsconfig.json --type-check
.PHONY: clean
clean:
rm -rf out site tmp demo