-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 970 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 970 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
33
34
35
CPPFLAGS += -std=c++11 -W -Wall -g -Wno-unused-parameter
CPPFLAGS += -I include
all : bin/print_canonical, bin/compiler, bin/compile_test
src/parser.tab.cpp src/parser.tab.hpp : src/parser.y
bison -v -d src/parser.y -o src/parser.tab.cpp
src/lexer.yy.cpp : src/lexer.flex src/parser.tab.hpp
flex -o src/lexer.yy.cpp src/lexer.flex
bin/c_compiler : bin/compiler src/wrapper.sh
cp src/wrapper.sh bin/c_compiler
chmod u+x bin/c_compiler
bin/compiler : src/compiler.o src/parser.tab.o src/lexer.yy.o src/parser.tab.o
mkdir -p bin
g++ $(CPPFLAGS) -o bin/compiler $^
bin/print_canonical : src/print_canonical.o src/parser.tab.o src/lexer.yy.o src/parser.tab.o
mkdir -p bin
g++ $(CPPFLAGS) -o bin/print_canonical $^
bin/compile_test : src/compile_test.o src/parser.tab.o src/lexer.yy.o src/parser.tab.o
mkdir -p bin
g++ $(CPPFLAGS) -o bin/compile_test $^
clean :
rm -f src/*.tab.cpp
rm -f src/*.yy.cpp
rm -f src/*.tab.hpp
rm -f src/*.o
rm -f bin/*