2014-08-29 12:01:39 +00:00
|
|
|
CC = g++
|
|
|
|
|
2015-07-03 11:18:03 +02:00
|
|
|
# Requirements: cpputest.github.io
|
2014-08-29 12:01:39 +00:00
|
|
|
|
|
|
|
BTSTACK_ROOT = ../..
|
|
|
|
|
2015-07-27 22:51:29 +02:00
|
|
|
CFLAGS = -g -Wall -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include
|
2020-12-01 22:13:09 +01:00
|
|
|
|
|
|
|
CFLAGS_COVERAGE = ${CFLAGS} -fprofile-arcs -ftest-coverage
|
2021-01-29 21:47:15 +01:00
|
|
|
CFLAGS_ASAN = ${CFLAGS} -fsanitize=address -DHAVE_ASSERT
|
2020-12-01 22:13:09 +01:00
|
|
|
|
2015-05-17 18:07:24 +02:00
|
|
|
LDFLAGS += -lCppUTest -lCppUTestExt
|
2020-12-01 22:13:09 +01:00
|
|
|
LDFLAGS_COVERAGE = ${LDFLAGS} -fprofile-arcs -ftest-coverage
|
|
|
|
LDFLAGS_ASAN = ${LDFLAGS} -fsanitize=address
|
2015-05-17 18:07:24 +02:00
|
|
|
|
|
|
|
VPATH += ${BTSTACK_ROOT}/src
|
2015-11-13 15:04:41 +01:00
|
|
|
VPATH += ${BTSTACK_ROOT}/src/classic
|
2016-01-20 14:20:47 +01:00
|
|
|
VPATH += ${BTSTACK_ROOT}/platform/posix
|
2014-08-29 12:01:39 +00:00
|
|
|
|
|
|
|
COMMON = \
|
2015-05-17 18:07:24 +02:00
|
|
|
sdp_util.c \
|
2015-10-11 23:31:11 +02:00
|
|
|
hci_dump.c \
|
2016-01-20 16:10:07 +01:00
|
|
|
btstack_util.c
|
2014-08-29 12:01:39 +00:00
|
|
|
|
2020-12-01 22:13:09 +01: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
|
|
|
|
2020-12-01 22:13:09 +01:00
|
|
|
build-coverage/%.o: %.c | build-coverage
|
|
|
|
${CC} -c $(CFLAGS_COVERAGE) $< -o $@
|
2014-08-29 12:01:39 +00:00
|
|
|
|
2020-12-01 22:13:09 +01:00
|
|
|
build-asan/%.o: %.c | build-asan
|
|
|
|
${CC} -c $(CFLAGS_ASAN) $< -o $@
|
|
|
|
|
|
|
|
|
|
|
|
build-coverage/des_iterator_test: ${COMMON_OBJ_COVERAGE} build-coverage/des_iterator_test.o | build-coverage
|
|
|
|
${CC} $^ ${LDFLAGS_COVERAGE} -o $@
|
|
|
|
|
|
|
|
build-asan/des_iterator_test: ${COMMON_OBJ_ASAN} build-asan/des_iterator_test.o | build-asan
|
|
|
|
${CC} $^ ${LDFLAGS_ASAN} -o $@
|
2020-11-30 21:35:42 +01:00
|
|
|
|
2014-08-29 12:01:39 +00:00
|
|
|
|
2015-07-03 11:18:03 +02:00
|
|
|
test: all
|
2020-12-01 22:13:09 +01:00
|
|
|
build-asan/des_iterator_test
|
2020-11-30 21:35:42 +01:00
|
|
|
|
|
|
|
coverage: all
|
2020-12-01 22:13:09 +01:00
|
|
|
rm -f build-coverage/*.gcda
|
2020-11-30 21:35:42 +01:00
|
|
|
build-coverage/des_iterator_test
|
2014-08-29 12:01:39 +00:00
|
|
|
|
|
|
|
clean:
|
2020-12-01 22:13:09 +01:00
|
|
|
rm -rf build-coverage build-asan
|
2020-11-30 21:35:42 +01:00
|
|
|
|