-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (71 loc) · 2.17 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
# Makefile
# Build rules for EECS 280 project 2
# Compiler
CXX ?= g++
# Compiler flags
CXXFLAGS ?= --std=c++17 -Wall -Werror -pedantic -g -Wno-sign-compare -Wno-comment
# Run a regression test
test: Matrix_public_test.exe Matrix_tests.exe Image_public_test.exe Image_tests.exe processing_public_tests.exe resize.exe
./Matrix_public_test.exe
./Image_public_test.exe
./processing_public_tests.exe
./resize.exe dog.ppm dog_4x5.out.ppm 4 5
diff dog_4x5.out.ppm dog_4x5.correct.ppm
Matrix_public_test.exe: Matrix_public_test.cpp Matrix.cpp Matrix_test_helpers.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Matrix_tests.exe: Matrix_tests.cpp Matrix.cpp Matrix_test_helpers.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Image_public_test.exe: Image_public_test.cpp Matrix.cpp Image.cpp \
Matrix_test_helpers.cpp Image_test_helpers.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
Image_tests.exe: Image_tests.cpp Matrix.cpp Image.cpp Matrix_test_helpers.cpp \
Image_test_helpers.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
processing_public_tests.exe: processing_public_tests.cpp Matrix.cpp \
Image.cpp processing.cpp \
Matrix_test_helpers.cpp Image_test_helpers.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
resize.exe: resize.cpp Matrix.cpp Image.cpp processing.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
# Disable built-in Makefile rules
.SUFFIXES:
clean:
rm -rvf *.exe *.out.txt *.out.ppm *.dSYM *.stackdump
# Run style check tools
CPD ?= /usr/um/pmd-6.0.1/bin/run.sh cpd
OCLINT ?= /usr/um/oclint-0.13/bin/oclint
FILES := \
Image.cpp \
Image_tests.cpp \
Matrix.cpp \
Matrix_tests.cpp \
processing.cpp \
resize.cpp
CPD_FILES := \
Image.cpp \
Matrix.cpp \
processing.cpp \
resize.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"