2019-09-23 11:12:35 +00:00
|
|
|
CC = g++
|
|
|
|
|
|
|
|
# Requirements: cpputest.github.io
|
|
|
|
|
|
|
|
BTSTACK_ROOT = ../..
|
|
|
|
|
|
|
|
CFLAGS = -g -Wall \
|
2019-09-23 11:52:33 +00:00
|
|
|
-I. \
|
2019-09-23 11:12:35 +00:00
|
|
|
-I${BTSTACK_ROOT}/src \
|
|
|
|
-I${BTSTACK_ROOT}/platform/embedded
|
|
|
|
|
2020-09-24 13:27:45 +00:00
|
|
|
CFLAGS += -fprofile-arcs -ftest-coverage
|
2019-09-23 11:12:35 +00:00
|
|
|
|
2019-09-23 11:52:33 +00:00
|
|
|
CFLAGS += -DHAVE_HAL_AUDIO
|
|
|
|
|
2019-09-23 11:12:35 +00:00
|
|
|
LDFLAGS += -lCppUTest -lCppUTestExt
|
|
|
|
|
|
|
|
VPATH += ${BTSTACK_ROOT}/src
|
|
|
|
VPATH += ${BTSTACK_ROOT}/src/ble
|
|
|
|
VPATH += ${BTSTACK_ROOT}/platform/embedded
|
2019-09-23 11:52:33 +00:00
|
|
|
VPATH += ${BTSTACK_ROOT}/platform/freertos
|
2019-09-23 11:12:35 +00:00
|
|
|
|
|
|
|
COMMON = \
|
|
|
|
btstack_em9304_spi_embedded.c \
|
2020-10-30 13:22:37 +00:00
|
|
|
btstack_memory.c \
|
2019-09-23 14:05:08 +00:00
|
|
|
btstack_run_loop.c \
|
2019-09-23 11:12:35 +00:00
|
|
|
btstack_run_loop_embedded.c \
|
|
|
|
btstack_stdin_embedded.c \
|
|
|
|
btstack_tlv_flash_bank.c \
|
|
|
|
btstack_uart_block_embedded.c \
|
|
|
|
hal_flash_bank_memory.c \
|
2019-09-23 14:05:08 +00:00
|
|
|
btstack_audio.c \
|
|
|
|
btstack_audio_embedded.c \
|
|
|
|
btstack_linked_list.c \
|
|
|
|
btstack_resample.c \
|
|
|
|
btstack_ring_buffer.c \
|
|
|
|
btstack_run_loop_base.c \
|
|
|
|
btstack_slip.c \
|
|
|
|
btstack_util.c \
|
2019-09-23 11:12:35 +00:00
|
|
|
hci_dump.c \
|
2019-09-23 14:05:08 +00:00
|
|
|
hci_transport_em9304_spi.c \
|
|
|
|
hci_transport_h4.c \
|
|
|
|
hci_transport_h5.c \
|
2019-09-23 11:12:35 +00:00
|
|
|
|
|
|
|
COMMON_OBJ = $(COMMON:.c=.o)
|
|
|
|
|
2019-09-23 11:52:33 +00:00
|
|
|
FREERTOS_OBJS = \
|
|
|
|
btstack_run_loop_freertos.o \
|
|
|
|
btstack_uart_block_freertos.o \
|
|
|
|
|
2020-11-30 20:35:42 +00:00
|
|
|
all: build-coverage/embedded_test build-coverage/freertos_test
|
2019-09-23 11:12:35 +00:00
|
|
|
|
2020-11-30 20:35:42 +00:00
|
|
|
build-coverage:
|
|
|
|
mkdir -p build-coverage
|
|
|
|
|
|
|
|
build-coverage/embedded_test: ${COMMON_OBJ} embedded_test.c | build-coverage
|
2019-09-23 11:12:35 +00:00
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2020-11-30 20:35:42 +00:00
|
|
|
build-coverage/freertos_test: ${COMMON_OBJ} ${FREERTOS_OBJS} freertos_test.c | build-coverage
|
2019-09-23 11:52:33 +00:00
|
|
|
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2019-09-23 11:12:35 +00:00
|
|
|
test: all
|
2020-11-30 20:35:42 +00:00
|
|
|
build-coverage/embedded_test
|
|
|
|
build-coverage/freertos_test
|
|
|
|
|
|
|
|
coverage: all
|
|
|
|
build-coverage/embedded_test
|
|
|
|
build-coverage/freertos_test
|
2019-09-23 11:12:35 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f embedded_test
|
|
|
|
rm -f *.o
|
2020-11-30 20:35:42 +00:00
|
|
|
rm -rf *.dSYM build-coverage
|
2019-09-23 11:12:35 +00:00
|
|
|
rm -f *.gcno *.gcda
|
|
|
|
|