-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (72 loc) · 2.23 KB
/
Makefile
File metadata and controls
88 lines (72 loc) · 2.23 KB
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
#Set this to @ to keep the makefile quiet
SILENCE = @
#---- Outputs ----#
COMPONENT_NAME = ws2801
TARGET_LIB = \
lib/lib$(COMPONENT_NAME).a
TEST_TARGET = \
$(COMPONENT_NAME)_tests
#--- Inputs ----#
PROJECT_HOME_DIR = .
CPPUTEST_HOME = ../CppUTest
CPPUTEST_USE_EXTENSIONS = Y
CPP_PLATFORM = Gcc
##
#WARNINGFLAGS += -Wall -Werror -Wswitch-default -Wswitch-enum
WARNINGFLAGS += -Wall -Wswitch-default -Wswitch-enum
MEMLEAK_DETECTOR_NEW_MACROS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h
MEMLEAK_DETECTOR_MALLOC_MACROS += -include $(CPPUTEST_HOME)/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 = \
driver/WS2801 \
driver/eeprom \
driver/switch \
# driver/dmx \
#TEST_SRC_DIRS is a list of directories including
# - A test main (AllTests.cpp by conventin)
# - 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/\
#includes for all compiles
INCLUDE_DIRS =\
$(CPPUTEST_HOME)/include/\
include/\
mocks/\
tests/\
driver/WS2801\
driver/dmx\
driver/eeprom\
driver/switch\
MOCKS_SRC_DIRS =\
mocks/\
#Flags to pass to ld
LDFLAGS +=
LD_LIBRARIES += -lstdc++
include $(CPPUTEST_HOME)/build/ComponentMakefile
.PHONY: ctags
ctags:
rm -f TAGS
ctags -eR
#dir *.h *.cpp *.c /s/b > cscope.files
find . \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.s' -o -name '*.S' \) -print > cscope.files
cscope -b