forked from cpputest/cpputest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_using_MakefileWorker
107 lines (93 loc) · 4.19 KB
/
Makefile_using_MakefileWorker
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
#Set this to @ to keep the makefile quiet
SILENCE = @
#--- Inputs ----#
COMPONENT_NAME = CppUTest
ifeq ($(CPPUTEST_USE_STD_C_LIB), N)
CPP_PLATFORM = GccNoStdC
else
CPP_PLATFORM = Gcc
endif
CPPUTEST_HOME = .
OLD_MAKE = oldmake
MAKE_CMD = make -f $(CPPUTEST_HOME)/Makefile_using_MakefileWorker
CPPUTEST_ENABLE_DEBUG = Y
SRC_DIRS = \
src/CppUTest \
src/Platforms/$(CPP_PLATFORM)
TEST_SRC_DIRS = \
tests/CppUTest
INCLUDE_DIRS =\
include
include $(CPPUTEST_HOME)/build/MakefileWorker.mk
#these are a sample of the other alternative flag settings
.PHONY: test_all
test_all: start
@echo Building with the default flags.
$(MAKE_CMD) clean
$(TIME) $(MAKE_CMD)
./$(TEST_TARGET) -r
$(MAKE_CMD) clean
@echo Building with the STDC++ new disabled.
$(TIME) $(MAKE_CMD) CPPUTEST_USE_STD_CPP_LIB=Y extensions
$(MAKE_CMD) CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions
@echo Building with Memory Leak Detection disabled
$(TIME) $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N extensions
$(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N cleanExtensions
@echo Building with Memory Leak Detection disabled and STD C++ disabled
$(TIME) $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y extensions
$(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions
@echo Building with debug disabled
$(TIME) $(MAKE_CMD) CPPUTEST_ENABLE_DEBUG=N extensions
$(MAKE_CMD) CPPUTEST_ENABLE_DEBUG=N cleanExtensions
@echo Building with overridden CXXFLAGS and CFLAGS and CPPFLAGS
$(TIME) $(MAKE_CMD) CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude"
$(MAKE_CMD) CFLAGS="" CXXFLAGS="" clean
@echo Building without Standard C library includes
$(TIME) $(MAKE_CMD) CPPUTEST_USE_STD_C_LIB=N all_no_tests
$(MAKE_CMD) CPPUTEST_USE_STD_C_LIB=N clean
@echo Building with a different TARGET_PLATFORM
$(MAKE_CMD) TARGET_PLATFORM=real_platform
@echo Building with overridden CXXFLAGS and CFLAGS and memory leak and STDC++ disabled
$(TIME) $(MAKE_CMD) CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude -DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED"
$(MAKE_CMD) CFLAGS="" CXXFLAGS="" CPPFLAGS="-DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" clean
@echo Building examples
$(MAKE_CMD) cleanExamples
$(TIME) $(MAKE_CMD) examples
$(MAKE_CMD) cleanExamples
@echo Testing JUnit output
$(TIME) $(MAKE_CMD)
$(SILENCE)./$(TEST_TARGET) -ojunit > junit_run_output
$(SILENCE)if [ -s junit_run_output ]; then echo "JUnit run has output. Build failed!"; exit 1; fi
$(MAKE_CMD) clean
$(MAKE_CMD) CPPUTEST_MAP_FILE=map.txt
$(MAKE_CMD) clean
@echo Testing GCOV usage
$(TIME) $(MAKE_CMD) CPPUTEST_USE_GCOV=Y everythingInstall
$(MAKE_CMD) gcov
$(MAKE) -f Makefile_CppUTestExt gcov
$(MAKE) -C examples gcov
$(MAKE_CMD) cleanEverythingInstall
@echo Testing VPATH usage
$(TIME) $(MAKE_CMD) CPPUTEST_USE_GCOV=Y CPPUTEST_USE_VPATH=Y everythingInstall
$(MAKE_CMD) CPPUTEST_USE_VPATH=Y gcov
$(MAKE) CPPUTEST_USE_VPATH=Y -f Makefile_CppUTestExt gcov
$(MAKE) CPPUTEST_USE_VPATH=Y -C examples gcov
$(MAKE_CMD) clean cleanExamples
@echo Testing VPATH usage
$(TIME) $(MAKE_CMD) CPPUTEST_USE_VPATH=Y everythingInstall
$(MAKE_CMD) CPPUTEST_USE_VPATH=Y cleanEverythingInstall
$(MAKE_CMD) flags
$(MAKE_CMD) debug
.PHONY: examples
examples: $(TEST_TARGET) extensions
+$(TIME) $(MAKE) -C examples all CPPUTEST_USE_STD_CPP_LIB=$(CPPUTEST_USE_STD_CPP_LIB) CPPUTEST_USE_MEM_LEAK_DETECTION=$(CPPUTEST_USE_MEM_LEAK_DETECTION)
extensions: $(TEST_TARGET)
+$(TIME) $(MAKE) -f Makefile_CppUTestExt all CPPUTEST_USE_STD_CPP_LIB=$(CPPUTEST_USE_STD_CPP_LIB) CPPUTEST_USE_MEM_LEAK_DETECTION=$(CPPUTEST_USE_MEM_LEAK_DETECTION) TARGET_PLATFORM=$(TARGET_PLATFORM)
cleanExtensions: clean
+$(TIME) $(MAKE) -f Makefile_CppUTestExt clean CPPUTEST_USE_STD_CPP_LIB=$(CPPUTEST_USE_STD_CPP_LIB) CPPUTEST_USE_MEM_LEAK_DETECTION=$(CPPUTEST_USE_MEM_LEAK_DETECTION) TARGET_PLATFORM=$(TARGET_PLATFORM)
cleanExamples: clean cleanExtensions
+$(TIME) $(MAKE) -C examples clean CPPUTEST_USE_STD_CPP_LIB=$(CPPUTEST_USE_STD_CPP_LIB) CPPUTEST_USE_MEM_LEAK_DETECTION=$(CPPUTEST_USE_MEM_LEAK_DETECTION)
.PHONY: everythingInstall
everythingInstall: all extensions examples
.PHONY: cleanEverythingInstall
cleanEverythingInstall: clean cleanExtensions cleanExamples