-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (32 loc) · 1.53 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
MK=/usr/bin/make
-include Makefile.diagrams
-include Makefile.replsessions
diagramexecutable=diagram
modules=Shared LinearDiagrams/Shared LinearDiagrams/LinearDiagrams LinearDiagrams/Curve LinearDiagrams/Arc LinearDiagrams/Query PatternAlgebraDiagrams SignalDiagrams QueryDiagrams CircularDiagrams DiagramTable
document=tidal
all: $(document).html
Makefile.diagrams Makefile.replsessions PatternExpressions.hs: $(document).txt
pandoc -f markdown -t native --lua-filter getdiagrams.lua < $< > /dev/null
PatternExpressions.o: PatternExpressions.hs
ghc --make -c -Wall -Wno-missing-signatures $<
$(diagramexecutable): $(diagramexecutable).hs PatternExpressions.o $(addsuffix .hs,$(modules))
ghc --make -Wall $<
%.svg: $(diagramexecutable)
./$< -S $(basename $@) -o $@
ghci-output-%.txt: | ghci-input-%.txt
TERM=xterm script -q $@ ghci < $| > /dev/null
tidal-output-%.txt: | tidal-input-%.txt
TERM=xterm script -q $@ ghci -ghci-script BootTidal.hs < $| > /dev/null
$(document).html: $(document).txt $(addsuffix .svg,$(diagrams)) $(replsessions)
pandoc -f markdown -t html -s --toc --lua-filter renderghcisessions.lua --lua-filter gitinfo.lua < $< > $@
clean:
git clean -f $(wildcard $(diagramexecutable)*)
git clean -f $(foreach module,$(modules),$(wildcard $(module)*))
git clean -f PatternExpressions.*
git clean -fq *.svg
git clean -f *.html
git clean -f Makefile.diagrams Makefile.replsessions
git clean -f whitelistexists
git clean -fq ghci-input-*.txt tidal-input-*.txt
cleanall: clean
git clean -fxq ghci-output-*.txt tidal-output-*.txt