-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (38 loc) · 1.05 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
TARGET=levy
SOURCES = \
syntax.ml \
type_check.ml \
interpret.ml \
lexer.mll \
parser.mly \
levy.ml
OCAMLBUILD=ocamlbuild
CAML2HTML=caml2html
OCAMLDOC=ocamldoc
default: byte
all: byte native html doc
byte:
$(OCAMLBUILD) $(TARGET).byte
native:
$(OCAMLBUILD) $(TARGET).native
web: html
echo '<div class="lang">' > web.html
echo "<h3>$(TARGET)</h3>" >> web.html
echo '<div class="version">Last update: ' >> web.html
cat version.txt >> web.html
echo '</div>' >> web.html
echo '<div class="description">' >> web.html
cat description.html >> web.html
echo '</div>' >> web.html
echo '<div class="download">Download source: <a href="src/$(TARGET).zip">$(TARGET).zip</a></div>' >> web.html
/bin/echo -n '<div class="source"><a href="html/$(TARGET).html">View source online</a> (' >> web.html
cat $(SOURCES) | wc -l >> web.html
echo ' lines)</div>' >> web.html
echo "</div>" >> web.html
html:
$(CAML2HTML) -nf -ln -noannot -o ../html/$(TARGET).html $(SOURCES)
doc:
$(OCAMLBUILD) $(TARGET).docdir/index.html
clean:
/bin/rm -f web.html
$(OCAMLBUILD) -clean