-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 697 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 697 Bytes
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
n=\e[0m
g=\e[1;32m
FILES = Lexer.cpp Parser.cpp codegen.cpp main.cpp
CC = clang++-15
CFLAGS = `llvm-config-15 --cxxflags --ldflags --system-libs --libs core` -std=c++17 -ggdb -O0
all: $(FILES)
$(CC) $(CFLAGS) $(FILES) -o compiler
Lexer.cpp: Lexer.lex
flex Lexer.lex
Parser.cpp: Parser.y Lexer.cpp
bison Parser.y
clean:
rm -f *.o *~ Lexer.cpp Lexer.hpp Parser.cpp Parser.hpp compiler
verify:
./compiler input.txt output.ll
clang-15 output.ll
./a.out > output.txt || true
diff --strip-trailing-cr -u output.txt expected.txt 1>&2
verify-all: all
for test in tests/*; do \
echo "TESTING $$test"; \
cp $$test/* .; \
make verify; \
done; \
echo "$gAll tests passed!$n";