|
|
@ -9,6 +9,8 @@ |
|
|
|
LIBS = pthread |
|
|
|
TOP_DIR = $(PWD) |
|
|
|
TEST_DIR = $(BUILD_DIR)/test |
|
|
|
INCLUDE_DIR = -I . \
|
|
|
|
-I ./include |
|
|
|
|
|
|
|
# comment this out if you want debug compile info
|
|
|
|
#Q=@
|
|
|
@ -16,10 +18,10 @@ TEST_DIR = $(BUILD_DIR)/test |
|
|
|
ifeq ($(MAKECMDGOALS),test) |
|
|
|
GCOV := --coverage |
|
|
|
CPPUTEST_HOME := $(TOP_DIR)/test/cpputest |
|
|
|
TEST_FW_INCS := -I$(CPPUTEST_HOME)/include -I. |
|
|
|
INCLUDE_DIR += -I$(CPPUTEST_HOME)/include -I. |
|
|
|
SUPRESS_WARNINGS := -Wno-write-strings |
|
|
|
CFLAGS_TEST := -DUNIT_TEST $(TEST_FW_INCS) $(GCOV) -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h |
|
|
|
CXXFLAGS_TEST := -DUNIT_TEST $(TEST_FW_INCS) -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h $(SUPRESS_WARNINGS) |
|
|
|
CFLAGS_TEST := -DUNIT_TEST $(GCOV) -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h |
|
|
|
CXXFLAGS_TEST := -DUNIT_TEST -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h $(SUPRESS_WARNINGS) |
|
|
|
APP_PREFIX := test_ |
|
|
|
LIBS += CppUTest pthread gcov dl |
|
|
|
CPPUTEST_BUILD := $(CPPUTEST_HOME)/cpputest_build |
|
|
@ -38,13 +40,13 @@ BUILD_DIR = $(PWD)/build/app |
|
|
|
SRC_C := $(wildcard *.c) |
|
|
|
SRC_CPP := $(wildcard *.cpp) |
|
|
|
endif |
|
|
|
SRC_H += $(wildcard *.h) |
|
|
|
SRC_H += $(wildcard *.h) $(wildcard include/*.h) |
|
|
|
SRC_HPP += $(wildcard *.hpp) |
|
|
|
|
|
|
|
OUT_BINARY = $(APP_PREFIX)lwrserv |
|
|
|
|
|
|
|
CC = g++ |
|
|
|
GLOBAL_FLAGS = -g -o2 -ansi -pedantic -DHAVE_SOCKLEN_T |
|
|
|
GLOBAL_FLAGS = -g -o2 -ansi -pedantic -DHAVE_SOCKLEN_T $(INCLUDE_DIR) |
|
|
|
CFLAGS = $(GLOBAL_FLAGS) $(CFLAGS_TEST) |
|
|
|
CXXFLAGS = $(GLOBAL_FLAGS) $(CFLAGS_TEST) |
|
|
|
CPPFLAGS = $(GLOBAL_FLAGS) $(CFLAGS_TEST) |
|
|
|