-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (49 loc) · 1.81 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CXX = g++
CXXLFLAGS = -Wl,--enable-auto-import
CXXFLAGS= -ggdb -std=c++11 -Wall
LEX = flex
LFLAGS=-osrc/lexer.cpp
YACC= bison
YFLAGS= -d -v -o src/grammar.cpp
phpc: grammar.o lexer.o main.o Scope.o Symbol.o SymbolTable.o SymbolsParser.o generate_dot.o TypeChecker.o DependencyGraph.o
${CXX} ${CXXLFLAGS} ${CXXFLAGS} Scope.o Symbol.o SymbolTable.o SymbolsParser.o TypeChecker.o DependencyGraph.o generate_dot.o lexer.o grammar.o main.o -o $@
main.o: src/main.cpp src/definitions.h
${CXX} ${CXXFLAGS} -c $<
grammar.o: src/grammar.y src/definitions.h src/Logger.hpp AST.o
${YACC} ${YFLAGS} $<
${CXX} ${CXXFLAGS} -c src/grammar.cpp
lexer.o: src/lexer.l src/definitions.h src/Logger.hpp
${LEX} ${LFLAGS} $<
${CXX} ${CXXFLAGS} -c src/lexer.cpp
Scope.o: src/SymbolTable/Scope.cpp src/SymbolTable/Scope.h
${CXX} ${CXXFLAGS} -c $<
Symbol.o: src/SymbolTable/Symbol.cpp src/SymbolTable/Symbol.h
${CXX} ${CXXFLAGS} -c $<
SymbolTable.o: src/SymbolTable/SymbolTable.cpp src/SymbolTable/SymbolTable.h
${CXX} ${CXXFLAGS} -c $<
SymbolsParser.o: src/SymbolTable/SymbolsParser.cpp src/SymbolTable/SymbolsParser.h
${CXX} ${CXXFLAGS} -c $<
generate_dot.o: src/generate_dot.cpp src/generate_dot.hpp
${CXX} ${CXXFLAGS} -c $<
TypeChecker.o: src/TypeChecker.cpp src/TypeChecker.h
${CXX} ${CXXFLAGS} -c $<
AST.o: src/AST/*
touch AST.o
DependencyGraph.o: src/DependencyGraph/DependencyGraph.cpp src/DependencyGraph/DependencyGraph.h
${CXX} ${CXXFLAGS} -c $<
symbol_table: symbol_table.dot
dot -Tsvg -o symbol_table.svg symbol_table.dot
dependency_graph_dot: dependency_graph.dot
dot -Tsvg -o dependency_graph.svg $<
ast_dot: ast.dot
dot -Tsvg -o ast.svg $<
clean:
rm *.o
rm *.txt
rm *.dot
run:
make phpc
./phpc
make symbol_table
make dependency_graph_dot
make ast_dot