-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
114 lines (97 loc) · 2.91 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
TRANSFORM =transf +RTS -N4
TRANSFORM_PDF=transf --format=pdf
RESOLVE_LINKS=GHC_PACKAGE_PATH=`music-util package-path` hslinks
CSS =../templates/pandoc-bootstrap-template/template.css
PANDOC_TEMPLATE=../templates/pandoc-bootstrap-template/template.html
#CSS =../templates/music-suite/template.css
#PANDOC_TEMPLATE=../templates/music-suite/template.html
PANDOC=pandoc --standalone --toc
PANDOC_PDF=$(PANDOC) --write=latex
PANDOC_HTML=$(PANDOC) --write=html --toc-depth 4 --css styles.css --template $(PANDOC_TEMPLATE)
CABAL_FILES=\
../../music-score/music-score.cabal \
../../music-pitch/music-pitch.cabal \
../../music-dynamics/music-dynamics.cabal \
../../music-articulation/music-articulation.cabal \
../../music-parts/music-parts.cabal \
../../music-pitch-literal/music-pitch-literal.cabal \
../../music-dynamics-literal/music-dynamics-literal.cabal \
# Can't include prelude, as that makes all refs point to the Prelude module
# ../../music-preludes/music-preludes.cabal
SRC=src
OUT=build
PAGE=index.html
TUTORIAL_PAGE=tutorial.html
# MODULE_GRAPH=module-graph.png
# upload-wiki: transform
# pushd $(OUT) && \
# git add *.png *.ly *.mid && \
# git add *.md && \
# git commit -m "Updated wiki" && \
# git push && \
# popd
html: transform
pushd $(OUT) && \
(cat About.md \
User-Guide.md \
) \
| $(PANDOC_HTML) -o $(PAGE) && \
cp $(CSS) styles.css && \
cp -R ../js js && \
popd
# cp ../$(MODULE_GRAPH) module-graph.png && \
html-tutorial: transform
pushd $(OUT) && \
(cat Tutorial.md \
) \
| $(PANDOC_HTML) -o $(TUTORIAL_PAGE) && \
cp $(CSS) styles.css && \
popd
pdf: transform-pdf
pushd $(OUT) && \
(cat About.md \
User-Guide.md \
) \
| $(PANDOC_PDF) -o ../test.pdf && \
popd
transform:
mkdir -p $(OUT)
pushd $(OUT) && \
pwd && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM) ) <../$(SRC)/About.md >About.md && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM) ) <../$(SRC)/Usage.md >Usage.md && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM) ) <../$(SRC)/User-Guide.md >User-Guide.md && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM) ) <../$(SRC)/Tutorial.md >Tutorial.md && \
rm -f *.eps && \
rm -f *.count && \
rm -f *.tex && \
rm -f *.texi && \
popd
transform-pdf:
mkdir -p $(OUT)
pushd $(OUT) && \
pwd && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM_PDF) ) <../$(SRC)/About.md >About.md && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM_PDF) ) <../$(SRC)/Usage.md >Usage.md && \
( $(RESOLVE_LINKS) $(CABAL_FILES) | $(TRANSFORM_PDF) ) <../$(SRC)/User-Guide.md >User-Guide.md && \
rm -f *.eps && \
rm -f *.count && \
rm -f *.tex && \
rm -f *.texi && \
popd
clean:
rm -f $(OUT)/*.pdf
rm -f $(OUT)/*.ly
rm -f $(OUT)/*.mid
rm -f $(OUT)/*.png
rm -f $(OUT)/*.html
clean-todo:
rm -f *.eps
rm -f *.count
rm -f *.tex
rm -f *.texi
rm -f *.eps
rm -f *.pdf
rm -f *.png
rm -f *.mid
rm -f *.ly