-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 1.55 KB
/
Makefile
File metadata and controls
69 lines (55 loc) · 1.55 KB
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
all: build
test: codegen_test
lexer_test: build
./lexer_smoke_test
python3 -m unittest tests/lexer_tests/lexer_end_to_end_test.py
parser_test: build
./parser_smoke_test
python3 -m unittest tests/parser_tests/parser_end_to_end.py
semant_test: build
./semant_smoke_test
python3 -m unittest tests/semant_tests/semant_end_to_end.py
codegen_test: build
./prototype_smoke_test
./disptable_smoke_test
./constants_smoke_test
./misc_smoke_test
./text_smoke_test
./codegen_test
./codegen examples/atoi.cl examples/stack_machine.cl
mv a.s examples/stack_machine.s
make stack_test
build: googletest compile_commands.json
cmake -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1
cd build/; make -j4
googletest:
git clone https://github.com/google/googletest
compile_commands.json:
-ln -s build/compile_commands.json compile_commands.json
format:
find src -iname *.h -o -iname *.cpp | xargs clang-format -i
find tests -iname *.h -o -iname *.cpp | xargs clang-format -i
stack: examples/stack_machine.s
spim examples/stack_machine.s
stack_test: examples/stack_machine.s
python3 -m unittest tests/stack_tests/stack_test.py
examples/stack_machine.s:
coolc examples/stack_machine.cl examples/atoi.cl
clean:
-rm examples/stack_machine.s
-rm lexer
-rm parser
-rm semant
-rm codegen
-rm lexer_smoke_test
-rm parser_smoke_test
-rm semant_smoke_test
-rm datagen_smoke_test
-rm constants_smoke_test
-rm misc_smoke_test
-rm disptable_smoke_test
-rm prototype_smoke_test
-rm text_smoke_test
-rm codegen_test
-rm build -r
.PHONY: build clean lexer_test parser_test format