-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (79 loc) · 2.43 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Makefile
# Build rules for EECS 280 project 3
# Compiler
CXX ?= g++
# Compiler flags
CXXFLAGS ?= --std=c++17 -Wall -Werror -pedantic -g -Wno-sign-compare -Wno-comment
# Run a regression test
test: Card_public_test.exe Card_tests.exe Pack_public_test.exe Pack_tests.exe \
Player_public_test.exe Player_tests.exe \
euchre.exe
./Card_public_test.exe
./Card_tests.exe
./Pack_public_test.exe
./Pack_tests.exe
./Player_public_test.exe
./Player_tests.exe
./euchre.exe pack.in noshuffle 1 Adi Simple Barbara Simple Chi-Chih Simple Dabbala Simple > euchre_test00.out
diff -qB euchre_test00.out euchre_test00.out.correct
./euchre.exe pack.in shuffle 10 Edsger Simple Fran Simple Gabriel Simple Herb Simple > euchre_test01.out
diff -qB euchre_test01.out euchre_test01.out.correct
./euchre.exe pack.in noshuffle 3 Ivan Human Judea Human Kunle Human Liskov Human < euchre_test50.in > euchre_test50.out
diff -qB euchre_test50.out euchre_test50.out.correct
Card_public_test.exe: Card.cpp Card_public_test.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Card_tests.exe: Card.cpp Card_tests.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Pack_public_test.exe: Card.cpp Pack.cpp Pack_public_test.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Pack_tests.exe: Card.cpp Pack.cpp Pack_tests.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Player_public_test.exe: Card.cpp Player.cpp Player_public_test.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Player_tests.exe: Card.cpp Player.cpp Player_tests.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
euchre.exe: Card.cpp Pack.cpp Player.cpp euchre.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
.SUFFIXES:
.PHONY: clean
clean:
rm -rvf *.out *.exe *.dSYM *.stackdump
# Style check
CPD ?= /usr/um/pmd-6.0.1/bin/run.sh cpd
OCLINT ?= /usr/um/oclint-0.13/bin/oclint
FILES := \
Card.cpp \
Card_tests.cpp \
Pack.cpp \
Pack_tests.cpp \
Player.cpp \
Player_tests.cpp \
euchre.cpp
CPD_FILES := \
Card.cpp \
Pack.cpp \
Player.cpp \
euchre.cpp
style :
$(OCLINT) \
-no-analytics \
-rule=LongLine \
-rule=HighNcssMethod \
-rule=DeepNestedBlock \
-rule=TooManyParameters \
-rc=LONG_LINE=90 \
-rc=NCSS_METHOD=40 \
-rc=NESTED_BLOCK_DEPTH=4 \
-rc=TOO_MANY_PARAMETERS=4 \
-max-priority-1 0 \
-max-priority-2 0 \
-max-priority-3 0 \
$(FILES) \
-- -xc++ --std=c++17
$(CPD) \
--minimum-tokens 100 \
--language cpp \
--failOnViolation true \
--files $(CPD_FILES)
@echo "########################################"
@echo "EECS 280 style checks PASS"