-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (36 loc) · 995 Bytes
/
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
OCB_FLAGS := -use-ocamlfind -plugin-tag "package(ppx_driver.ocamlbuild)"
OCB := ocamlbuild $(OCB_FLAGS)
SRC=$(shell ls src/*.ml src/*.mly src/*.mll)
.PHONY: repl
repl: repl.native
rlwrap ./$<
test: parser_tests interpret_tests test-repl examples
$(MAKE) -C runtime test
test-repl: repl.native
./repl.expect
%_tests: %_tests.native
./$< inline-test-runner test -verbose -stop-on-error -strict
.PHONY: snippet
snippet: snippet.native $(SRC)
./$<
.PHONY: clean
clean:
$(OCB) -clean
rm -f examples/*.asm
rm -f examples/*.o
rm -f examples/*.bin
$(MAKE) -C runtime clean
.PRECIOUS: %.native
%.native: $(SRC)
$(OCB) $@
.PHONY: debug
debug: compiler.native
./$< -L=runtime examples/plus01.silly-ml
gdb a.out
.PHONY: examples
examples: $(foreach e, $(shell ls examples/*.silly-ml), $(e)-run)
examples/%.silly-ml-run: examples/%.silly-ml compiler.native runtime/libruntime.a
./run-example.sh $<
.PHONY: runtime/libruntime.a
runtime/libruntime.a:
$(MAKE) -C runtime libruntime.a