forked from jwgrenning/cpputest-starter-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
127 lines (106 loc) · 3.75 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#Set this to @ to keep the makefile quiet
SILENCE = @
#---- Outputs ----#
COMPONENT_NAME = example
#--- Inputs ----#
PROJECT_HOME_DIR = .
ifeq "$(CPPUTEST_HOME)" ""
CPPUTEST_HOME = ~/tools/cpputest
endif
# --- SRC_FILES ---
# Use SRC_FILES to specifiy individual production
# code files.
# These files are compiled and put into the
# ProductionCode library and links with the test runner
SRC_FILES = example-src/Example.c
# --- SRC_DIRS ---
# Use SRC_DIRS to specifiy production directories
# code files.
# These files are compiled and put into a the
# ProductionCode library and links with the test runner
SRC_DIRS = \
example-platform
# --- TEST_SRC_FILES ---
# TEST_SRC_FILES specifies individual test files to build. Test
# files are always included in the build and they
# pull in production code from the library
TEST_SRC_FILES = \
# --- TEST_SRC_DIRS ---
# Like TEST_SRC_FILES, but biulds everyting in the directory
TEST_SRC_DIRS = \
tests/io-cppumock \
tests/exploding-fakes \
tests \
# tests/example-fff \
# tests/fff \
# --- MOCKS_SRC_DIRS ---
# MOCKS_SRC_DIRS specifies a directories where you can put your
# mocks, stubs and fakes. You can also just put them
# in TEST_SRC_DIRS
MOCKS_SRC_DIRS = \
# Turn on CppUMock
CPPUTEST_USE_EXTENSIONS = Y
INCLUDE_DIRS =\
.\
$(CPPUTEST_HOME)/include/ \
$(CPPUTEST_HOME)/include/Platforms/Gcc \
example-src \
example-include \
example-fff \
test/exploding-fakes \
tests/fff
# --- CPPUTEST_OBJS_DIR ---
# if you have to use "../" to get to your source path
# the makefile will put the .o and .d files in surprising
# places.
# To make up for each level of "../", add place holder
# sub directories in CPPUTEST_OBJS_DIR
# each "../". It is kind of a kludge, but it causes the
# .o and .d files to be put under objs.
# e.g. if you have "../../src", set to "test-objs/1/2"
# This is set no "../" in the source path.
CPPUTEST_OBJS_DIR = test-obj
CPPUTEST_LIB_DIR = test-lib
# You may have to tweak these compiler flags
# CPPUTEST_WARNINGFLAGS - apply to C and C++
# CPPUTEST_CFLAGS - apply to C files only
# CPPUTEST_CXXFLAGS - apply to C++ files on;y
# CPPUTEST_CPPFLAGS - apply to C and C++ Pre-Processor
#
# If you get an error like this
# TestPlugin.h:93:59: error: 'override' keyword is incompatible
# with C++98 [-Werror,-Wc++98-compat] ...
# The compiler is basically telling you how to fix the
# build problem. You would add this flag setting
# CPPUTEST_CXXFLAGS += -Wno-c++14-compat
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang"), 1)
CPPUTEST_WARNINGFLAGS += -Wno-unknown-warning-option
CPPUTEST_WARNINGFLAGS += -Wno-covered-switch-default
CPPUTEST_WARNINGFLAGS += -Wno-reserved-id-macro
CPPUTEST_WARNINGFLAGS += -Wno-keyword-macro
CPPUTEST_WARNINGFLAGS += -Wno-documentation
CPPUTEST_WARNINGFLAGS += -Wno-missing-noreturn
endif
CPPUTEST_WARNINGFLAGS += -Wall
CPPUTEST_WARNINGFLAGS += -Werror
CPPUTEST_WARNINGFLAGS += -Wfatal-errors
CPPUTEST_WARNINGFLAGS += -Wswitch-default
CPPUTEST_WARNINGFLAGS += -Wno-format-nonliteral
CPPUTEST_WARNINGFLAGS += -Wno-sign-conversion
CPPUTEST_WARNINGFLAGS += -Wno-pedantic
CPPUTEST_WARNINGFLAGS += -Wno-shadow
CPPUTEST_WARNINGFLAGS += -Wno-missing-field-initializers
CPPUTEST_WARNINGFLAGS += -Wno-unused-parameter
CPPUTEST_CFLAGS += -Wall
CPPUTEST_CFLAGS += -pedantic
CPPUTEST_CFLAGS += -Wno-missing-prototypes
CPPUTEST_CFLAGS += -Wno-strict-prototypes
CPPUTEST_CXXFLAGS += -Wno-c++14-compat
CPPUTEST_CXXFLAGS += --std=c++11
CPPUTEST_CXXFLAGS += -Wno-c++98-compat-pedantic
CPPUTEST_CXXFLAGS += -Wno-c++98-compat
# --- LD_LIBRARIES -- Additional needed libraries can be added here.
# commented out example specifies math library
#LD_LIBRARIES += -lm
# Look at $(CPPUTEST_HOME)/build/MakefileWorker.mk for more controls
include $(CPPUTEST_HOME)/build/MakefileWorker.mk