64 lines
1.5 KiB
Makefile
64 lines
1.5 KiB
Makefile
|
CXXFLAGS= -Wall -g -std=c++0x -I .
|
||
|
|
||
|
lexor_objs=labs/lab01.o \
|
||
|
lexer/lexi.o \
|
||
|
lexer/token.o
|
||
|
|
||
|
parser_objs=labs/lab02.o \
|
||
|
lexer/lexi.o \
|
||
|
lexer/token.o \
|
||
|
parser/parser.o \
|
||
|
|
||
|
rdbms_objs=labs/lab03.o \
|
||
|
lexer/lexi.o \
|
||
|
lexer/token.o \
|
||
|
parser/parser.o \
|
||
|
|
||
|
lab01=bin/lab01
|
||
|
lab02=bin/lab02
|
||
|
lab03=bin/lab03
|
||
|
|
||
|
all: $(lab01) $(lab02) $(lab03)
|
||
|
|
||
|
$(lab01): $(lexor_objs)
|
||
|
$(CXX) $(CXXFLAGS) $(lexor_objs) -o $@
|
||
|
|
||
|
$(lab02): $(parser_objs)
|
||
|
$(CXX) $(CXXFLAGS) $^ -o $@
|
||
|
|
||
|
$(lab03): $(rdbms_objs)
|
||
|
$(CXX) $(CXXFLAGS) $^ -o $@
|
||
|
|
||
|
labs/lab01.o: labs/lab01.cpp lexer/util.h lexer/lexi.h lexer/token.h
|
||
|
lexer/lexi.o: lexer/lexi.cpp lexer/lexi.h
|
||
|
lexer/token.o: lexer/token.h lexer/token.cpp
|
||
|
|
||
|
labs/lab02.o: labs/lab02.cpp lexer/util.h lexer/lexi.h lexer/token.h \
|
||
|
parser/scheme.h parser/fact.h parser/rule.h parser/query.h\
|
||
|
parser/predicate.h parser/parameter.h parser/parser.o
|
||
|
|
||
|
labs/lab03.o: labs/lab02.cpp lexer/util.h lexer/lexi.h lexer/token.h \
|
||
|
parser/scheme.h parser/fact.h parser/rule.h parser/query.h\
|
||
|
parser/predicate.h parser/parameter.h parser/parser.o rdbms/db.h \
|
||
|
rdbms/relation.h rdbms/schema.h rdbms/Tuple.h
|
||
|
parser/parser.o: parser/parser.h parser/parser.cpp
|
||
|
|
||
|
clean:
|
||
|
@rm -vf **/*.o
|
||
|
@rm -vf $(EXE)
|
||
|
@rm -vf **/*.1
|
||
|
@rm -vf **/*.0
|
||
|
@rm -vf test
|
||
|
@rm -rvf **/*.dSYM
|
||
|
@rm -vf output.txt
|
||
|
@rm -vf bin/*
|
||
|
|
||
|
drun: main
|
||
|
gdb ./main
|
||
|
|
||
|
valgrind: $(EXE)
|
||
|
valgrind --tool=memcheck --leak-check=yes ./$(EXE) input.txt output.txt
|
||
|
|
||
|
pmc: **/*.h **/*.cpp
|
||
|
pmccabe **/*.h **/*.cpp
|