btstack/test/des_iterator/Makefile

64 lines
1.6 KiB
Makefile
Raw Normal View History

# Requirements: cpputest.github.io
2014-08-29 12:01:39 +00:00
BTSTACK_ROOT = ../..
CFLAGS = -DUNIT_TEST -g -Wall -Wnarrowing -Wconversion-null
CFLAGS += -I${BTSTACK_ROOT}/src
CFLAGS += -I..
CFLAGS_COVERAGE = ${CFLAGS} -fprofile-arcs -ftest-coverage
CFLAGS_ASAN = ${CFLAGS} -fsanitize=address -DHAVE_ASSERT
LDFLAGS += -lCppUTest -lCppUTestExt
LDFLAGS_COVERAGE = ${LDFLAGS} -fprofile-arcs -ftest-coverage
LDFLAGS_ASAN = ${LDFLAGS} -fsanitize=address
VPATH += ${BTSTACK_ROOT}/src
2015-11-13 14:04:41 +00:00
VPATH += ${BTSTACK_ROOT}/src/classic
2016-01-20 13:20:47 +00:00
VPATH += ${BTSTACK_ROOT}/platform/posix
2014-08-29 12:01:39 +00:00
COMMON = \
sdp_util.c \
2015-10-11 21:31:11 +00:00
hci_dump.c \
btstack_util.c
2014-08-29 12:01:39 +00:00
COMMON_OBJ_COVERAGE = $(addprefix build-coverage/,$(COMMON:.c=.o))
COMMON_OBJ_ASAN = $(addprefix build-asan/, $(COMMON:.c=.o))
all: build-coverage/des_iterator_test build-asan/des_iterator_test
build-%:
mkdir -p $@
2014-08-29 12:01:39 +00:00
build-coverage/%.o: %.c | build-coverage
${CC} -c $(CFLAGS_COVERAGE) $< -o $@
2014-08-29 12:01:39 +00:00
build-coverage/%.o: %.cpp | build-coverage
${CXX} -c $(CFLAGS_COVERAGE) $< -o $@
build-asan/%.o: %.c | build-asan
${CC} -c $(CFLAGS_ASAN) $< -o $@
build-asan/%.o: %.cpp | build-asan
${CXX} -c $(CFLAGS_ASAN) $< -o $@
build-coverage/des_iterator_test: ${COMMON_OBJ_COVERAGE} build-coverage/des_iterator_test.o | build-coverage
${CXX} $^ ${LDFLAGS_COVERAGE} -o $@
build-asan/des_iterator_test: ${COMMON_OBJ_ASAN} build-asan/des_iterator_test.o | build-asan
${CXX} $^ ${LDFLAGS_ASAN} -o $@
2014-08-29 12:01:39 +00:00
test: all
build-asan/des_iterator_test
coverage: all
rm -f build-coverage/*.gcda
build-coverage/des_iterator_test
2014-08-29 12:01:39 +00:00
clean:
rm -rf build-coverage build-asan