forked from AfikPeretz/NumberWithUnits.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.41 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
#!make -f
CXX=clang++-9
CXXFLAGS=-std=c++2a -Werror -Wsign-conversion
VALGRIND_FLAGS=-v --leak-check=full --show-leak-kinds=all --error-exitcode=99
SOURCES=NumberWithUnits.cpp
OBJECTS=$(subst .cpp,.o,$(SOURCES))
run: test1 test2 test3
test1: TestRunner.o StudentTest1.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@
test2: TestRunner.o StudentTest2.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@
test3: TestRunner.o StudentTest3.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@
main: Main.o $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o main
./main
%.o: %.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) --compile $< -o $@
StudentTest1.cpp: # Shlomo Glick
curl https://raw.githubusercontent.com/shlomog12/ex3_partA/main/Test.cpp > $@
StudentTest2.cpp: # Yair Raviv
curl https://raw.githubusercontent.com/yairaviv/NumberWithUnits_a/main/Test.cpp > $@
StudentTest3.cpp: # Roei Birger
curl https://raw.githubusercontent.com/roei-birger/CPP_course_p3/master/Test.cpp > $@
tidy:
clang-tidy $(SOURCES) -extra-arg=-std=c++2a -checks=bugprone-*,clang-analyzer-*,cppcoreguidelines-*,performance-*,portability-*,readability-*,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-owning-memory,-readability-isolate-declaration --warnings-as-errors=-* --
valgrind: test1
valgrind --leak-check=full --error-exitcode=99 --tool=memcheck $(VALGRIND_FLAGS) ./test1
git:
git add -A
git commit -m "$m"
git push
clean:
rm -f *.o test*
rm -f StudentTest*.cpp