-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.88 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
MODULES:=$(sort $(wildcard alv-lib/*.moon))
MODULES:=$(filter-out $(wildcard alv-lib/_*.moon), $(MODULES))
MODULES:=$(MODULES:alv-lib/%.moon=docs/reference/module/%.html)
REFERENCE=docs/reference/index.md $(sort $(wildcard docs/reference/[01]*.md)) docs/reference/builtins.html $(MODULES)
REFTOC=$(REFERENCE:%.md=%.html)
GUIDE=docs/guide/index.md $(sort $(wildcard docs/guide/[01]*.md))
GUIDETOC=$(GUIDE:%.md=%.html)
CORE=$(wildcard alv/*.moon alv/**/*.moon) $(wildcard alv/*.md)
DEPS=alv/version.moon $(wildcard docs/gen/*.moon)
GEN=docs/gen/
.PHONY: docs test release clean guide reference internals
docs: docs/index.html guide reference internals
test:
busted
# docs parts
guide: $(GUIDETOC)
reference: $(REFTOC)
internals: docs/internals/index.html
docs/guide/%.html: docs/guide/%.md $(GUIDE) $(DEPS) $(GEN)md
@echo "building page $<"
docs/gen/md $@ $< $(GUIDETOC)
docs/reference/module/%.html: alv-lib/%.moon $(DEPS) $(GEN)module
@echo "building docs for $<"
@mkdir -p `dirname $@`
docs/gen/module $@ alv-lib.$(subst /,.,$*) $(subst /,.,$*) $(REFTOC)
docs/reference/builtins.html: alv/builtins.moon $(DEPS) $(GEN)module
@echo "building docs for $<"
docs/gen/module $@ alv.builtins "builtins" $(REFTOC)
docs/reference/index.html: docs/reference/index.md alv/builtins.moon $(MODULES) $(DEPS) $(GEN)index
@echo "building reference index"
docs/gen/index $@ $< $(REFTOC)
docs/reference/%.html: docs/reference/%.md $(REFERENCE) $(DEPS) $(GEN)md
@echo "building page $<"
docs/gen/md $@ $< $(REFTOC)
docs/%.html: docs/%.md $(DEPS) $(GEN)md
@echo "building page $<"
docs/gen/md $@ $<
docs/ldoc.ltp: $(DEPS)
docs/gen/ldoc $@
docs/internals/index.html: alv/config.ld docs/ldoc.ltp docs/internals/*.md $(CORE)
ldoc alv
clean:
rm -rf docs/reference/*.html docs/reference/modules
rm -rf docs/internals/*/ docs/internals/*.css docs/internals/*.html
rm -f docs/index.html $(GUIDETOC) docs/ldoc.*