forked from fgrosse/cpputest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_CppUTestExt-old
75 lines (56 loc) · 2.21 KB
/
Makefile_CppUTestExt-old
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
#Set this to @ to keep the makefile quiet
SILENCE = @
#Set to Y to disable the memory leak detection. Enabled by default
ifeq ($(CPPUTEST_DISABLE_MEM_LEAK_DETECTION), Y)
CPPUTEST_USE_MEM_LEAK_DETECTION = N
else
CPPUTEST_USE_MEM_LEAK_DETECTION = Y
endif
#Set to N to remove the dependency with StdC++ new header file and operator new std_badalloc throw
ifeq ($(CPPUTEST_DISABLE_STD_CPP_LIB), Y)
CPPUTEST_USE_STD_CPP_LIB = N
else
CPPUTEST_USE_STD_CPP_LIB = Y
endif
# Set to Y for enabling debug
ENABLE_DEBUG = Y
#---- Outputs ----#
COMPONENT_NAME = CppUTestExt
TARGET_LIB = lib/lib$(COMPONENT_NAME).a
TEST_TARGET = $(COMPONENT_NAME)_tests
#--- Inputs ----#
CPPUTEST_HOME = .
CPP_PLATFORM = Gcc
WARNINGFLAGS = -pedantic-errors -Wall -Wextra -Werror -Wshadow -Wswitch-default -Wswitch-enum -Wconversion
MEMLEAK_DETECTOR_NEW_MACROS += -include include/CppUTest/MemoryLeakDetectorNewMacros.h
MEMLEAK_DETECTOR_MALLOC_MACROS += -include include/CppUTest/MemoryLeakDetectorMallocMacros.h
ifeq ($(CPPUTEST_USE_MEM_LEAK_DETECTION), N)
CPPUTEST_CPPFLAGS += -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED
endif
ifeq ($(ENABLE_DEBUG), Y)
CPPUTEST_CPPFLAGS += -g
endif
ifeq ($(CPPUTEST_USE_STD_CPP_LIB), N)
CPPUTEST_CPPFLAGS += -DCPPUTEST_STD_CPP_LIB_DISABLED
CPPUTEST_CXXFLAGS += -nostdinc++
endif
CPPUTEST_CPPFLAGS += $(WARNINGFLAGS)
CPPUTEST_CXXFLAGS += $(MEMLEAK_DETECTOR_NEW_MACROS)
CPPUTEST_CFLAGS += $(MEMLEAK_DETECTOR_MALLOC_MACROS)
#GCOVFLAGS = -fprofile-arcs -ftest-coverage
#SRC_DIRS is a list of source directories that make up the target library
#If test files are in these directories, their IMPORT_TEST_GROUPs need
#to be included in main to force them to be linked in. By convention
#put them into an AllTests.h file in each directory
SRC_DIRS = src/CppUTestExt
#TEST_SRC_DIRS is a list of directories including
# - A test main (AllTests.cpp by convention)
# - OBJ files in these directories are included in the TEST_TARGET
# - Consequently - AllTests.h containing the IMPORT_TEST_GROUPS is not needed
# -
TEST_SRC_DIRS = tests/CppUTestExt
#includes for all compiles
INCLUDES = -I$(CPPUTEST_HOME)/include
#Flags to pass to ar, ld
LD_LIBRARIES += -lstdc++ -L$(CPPUTEST_HOME)/lib -lCppUTest
include $(CPPUTEST_HOME)/build/ComponentMakefile