-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (63 loc) · 1.72 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
VM=./mini-zam/vm/minizam
VM_DEBUG=./mini-zam/vm/minizam-debug
EXE=c2mz
RED=\033[0;31m
GREEN=\033[0;32m
NC=\033[0m # No Color
all:
ocamlc -c ast.ml;
ocamlc -c utils.ml;
ocamllex lexer.mll;
ocamlc -c compiler.ml;
menhir parser.mly;
ocamlc -c parser.mli;
ocamlc -c parser.ml;
ocamlc -c lexer.ml;
ocamlc -c typer.ml;
ocamlc -c domain.ml;
ocamlc -c domain_value.ml;
ocamlc -c domain_non_rel.ml;
ocamlc -c domain_concrete.ml;
ocamlc -c domain_constant.ml;
ocamlc -c domain_interval.ml;
ocamlc -c abstract_interpreter.ml;
ocamlc -c main.ml;
ocamlc -o $(EXE) utils.cmo ast.cmo compiler.cmo lexer.cmo parser.cmo typer.cmo \
domain.cmo domain_value.cmo domain_non_rel.cmo domain_concrete.cmo domain_constant.cmo \
domain_interval.cmo abstract_interpreter.cmo main.cmo
clean:
rm -rf *.cmo *.cmi lexer.ml parser.ml parser.mli $(EXE)
clean_bc:
rm -rf tests/build/bc_*.txt
check_grammar:
menhir --list-errors parser.mly
help:
@./$(EXE) --help
compile:
@./$(EXE) tests/$(S)
compile_debug:
@./$(EXE) --debug tests/$(S)
compile_no_typing:
@./$(EXE) --no-typing tests/$(S)
abs_inter_concrete:
@./$(EXE) --abs-inter-concrete tests/$(S)
abs_inter_constant:
@./$(EXE) --abs-inter-constant tests/$(S)
abs_inter_interval:
@./$(EXE) --abs-inter-interval tests/$(S)
vm:
@$(VM) tests/build/bc_$(S)
vm_debug:
@$(VM_DEBUG) tests/build/bc_$(S)
cvm: compile vm
cvm_no_typing: compile_no_typing vm
cvm_debug: compile vm_debug
cvm_debug_no_typing: compile_no_typing vm_debug
test:
$(eval RES := $(shell S=$(S) make cvm))
@if [ $(RES) = ${R} ]; then echo "$(GREEN)$(S) PASSED$(NC)"; else echo "$(RED)$(S) FAILED $(RES)<>$(R)$(NC)"; fi
# KO > todo
tests_suite: clean_bc
$(MAKE) test R=5 S=t0.txt
vm_demo:
$(VM) tests/build/demo-bytecode.txt