-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (23 loc) · 1004 Bytes
/
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
CC=g++
all : bin/c_compiler
bin/c_compiler : src/parser.tab.cpp src/lexer.yy.cpp src/ast.o src/parser.tab.hpp src/ast.hpp src/status.hpp src/status.o src/variables.hpp src/variables.o src/compiler.cpp
$(CC) src/parser.tab.cpp src/lexer.yy.cpp src/ast.o src/status.o src/variables.o src/compiler.cpp -o bin/c_compiler
@cat cow.out
src/variables.o : src/variables.cpp src/variables.hpp
$(CC) -c src/variables.cpp -o src/variables.o
src/status.o : src/status.hpp src/status.cpp src/variables.hpp
$(CC) -c src/status.cpp -o src/status.o
src/ast.o : src/ast.hpp src/ast.cpp src/status.hpp src/variables.hpp
$(CC) -c src/ast.cpp -o src/ast.o
src/parser.tab.cpp src/parser.tab.hpp : src/parser.y src/ast.hpp
bison -d src/parser.y -o src/parser.tab.cpp
src/lexer.yy.cpp : src/lexer.l src/ast.hpp src/parser.tab.hpp
flex -o src/lexer.yy.cpp src/lexer.l
clean :
rm src/parser.tab.hpp
rm src/parser.tab.cpp
rm src/lexer.yy.cpp
rm src/variables.o
rm src/status.o
rm src/ast.o
rm bin/c_compiler