-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 1.24 KB
/
Copy pathMakefile
File metadata and controls
38 lines (27 loc) · 1.24 KB
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
#!make -f
CXX=clang++-9
CXXVERSION=c++2a
CXXFLAGS=-std=$(CXXVERSION) -Werror -Wsign-conversion
TIDY_FLAGS=-extra-arg=-std=$(CXXVERSION) -checks=bugprone-*,clang-analyzer-*,cppcoreguidelines-*,performance-*,portability-*,readability-*,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-owning-memory --warnings-as-errors=-*
VALGRIND_FLAGS=-v --leak-check=full --show-leak-kinds=all --error-exitcode=99
SOURCES=Board.cpp Player.cpp OperationsExpert.cpp Dispatcher.cpp Scientist.cpp Researcher.cpp Medic.cpp Virologist.cpp GeneSplicer.cpp FieldDoctor.cpp
OBJECTS=$(subst .cpp,.o,$(SOURCES))
run: demo1 demo2
./demo1
./demo2
demo1: Demo1.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o demo1
demo2: Demo2.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o demo2
test: TestCounter.o Test.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o test
tidy:
clang-tidy $(SOURCES) $(TIDY_FLAGS) --
valgrind: demo1 demo2 test
valgrind --tool=memcheck $(VALGRIND_FLAGS) ./demo1 2>&1 | { egrep "lost| at " || true; }
valgrind --tool=memcheck $(VALGRIND_FLAGS) ./demo2 2>&1 | { egrep "lost| at " || true; }
valgrind --tool=memcheck $(VALGRIND_FLAGS) ./test 2>&1 | { egrep "lost| at " || true; }
%.o: %.cpp
$(CXX) $(CXXFLAGS) --compile $< -o $@
clean:
rm -f *.o demo1 demo2 test