-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
83 lines (66 loc) · 1.86 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
#Set this to @ to keep the makefile quiet
SILENCE = @
RANLIB = ranlib
#---- Outputs ----#
COMPONENT_NAME = CSlim
TARGET_LIB = \
lib/lib$(COMPONENT_NAME).a
TEST_TARGET = \
$(COMPONENT_NAME)_tests
#--- Inputs ----#
PROJECT_HOME_DIR = .
ifeq "$(CPPUTEST_HOME)" ""
CPPUTEST_HOME = ../CppUTest
endif
ifeq "$(CSLIM_HOME)" ""
CSLIM_HOME = ../cslim
endif
CPP_PLATFORM = Gcc
# set OS_PLATFROM to win to build with winsock
# OS_PLATFORM = win
#CFLAGS are set to override malloc, free, etc to get memory leak detection in C programs
CPPUTEST_CFLAGS = -Dmalloc=cpputest_malloc -Dfree=cpputest_free -Drealloc=cpputest_realloc
CPPUTEST_USE_EXTENSIONS = Yes
CPPFLAGS = -Wall
#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/CSlim\
src/ExecutorC\
ifeq ($(OS_PLATFORM), win)
SRC_DIRS += src/ComWin32
else
SRC_DIRS += src/Com
endif
#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 \
tests/Com \
tests/CSlim \
MOCKS_SRC_DIRS = \
CSLIM_SRC_DIRS = \
fixtures
#includes for all compiles
INCLUDES =\
-Iinclude/Com\
-Iinclude/CSlim\
-Iinclude/ExecutorC\
-Itests/CSlim\
-I$(CPPUTEST_HOME)/include/\
#Flags to pass to ld
ifeq ($(OS_PLATFORM), win)
LDFLAGS += -lWS2_32
else
LDFLAGS +=
endif
LD_LIBRARIES += -lstdc++ -lm
OTHER_MAKEFILE_TO_INCLUDE = $(CSLIM_HOME)/build/CSlimServerMakefile
include $(CPPUTEST_HOME)/build/ComponentMakefile
all: $(TEST_TARGET) $(CSLIM_TARGET)