-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile
51 lines (39 loc) · 1.34 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
run: hack
./hack example.rs -r
./hack maths.rs -r
SRC = main.cpp node.cpp stringtable.cpp ast.cpp semantics.cpp exprfndef.cpp exprstructdef.cpp type.cpp scope.cpp exprflow.cpp compile.cpp exprop.cpp exprblock.cpp lexer.cpp parser.cpp codegen.cpp run_test.cpp repl.cpp error.cpp everywhere.cpp assist.cpp pattern.cpp
HEADER = main.h node.h stringtable.h ast.h semantics.h compile.h codegen.h lexer.h parser.h run_test.h repl.h error.h everywhere.h exprstructdef.h exprop.h exprblock.h exprfndef.h type.h assist.h pattern.h
hack: $(SRC) all.cpp $(HEADER) foo
g++ all.cpp -o hack -std=c++1y -g3 -DDEBUG
#run internal test
test: hack
./hack -T
# 'DEBUG=4' switches on ultra verbose debug trace ,
# dumps of intermediate state during resolving
debug4: $(SRC) all.cpp $(HEADER)
g++ $(SRC) -o hack -std=c++1y -g3 -DDEBUG=4
./hack
./hack example.rs
hack_dbg2: $(SRC) all.cpp $(HEADER)
g++ all.cpp -o hack_dbg2 -std=c++1y -g3 -DDEBUG=2
debug2: hack_dbg2
./hack_dbg2 -T
debug2types: hack_dbg2
./hack_dbg2 -Y
debug: hack_dbg2
./hack_dbg2 example.rs -tr
#todo - can we find a way to syntax highlight it.
diff:
git --no-pager diff
clean:
-rm ./hack
-rm *.ll
-rm *.o
-rm test*
test_llvm: hack
./hack
cat test.ll
#foo.c for investigating LLVM format
foo: foo.cpp
clang++ foo.cpp -S -emit-llvm -std=c++1y -g3 -DCOMPILE_FOO
clang++ foo.ll -o foo