1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -g -Wall \ 8 -I. \ 9 -I.. \ 10 -I${BTSTACK_ROOT}/src \ 11 -I${BTSTACK_ROOT}/platform/embedded 12 13CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined 14 15CFLAGS += -DHAVE_HAL_AUDIO 16 17LDFLAGS += -lCppUTest -lCppUTestExt 18 19VPATH += ${BTSTACK_ROOT}/src 20VPATH += ${BTSTACK_ROOT}/src/ble 21VPATH += ${BTSTACK_ROOT}/platform/embedded 22VPATH += ${BTSTACK_ROOT}/platform/freertos 23 24COMMON = \ 25 btstack_em9304_spi_embedded.c \ 26 btstack_run_loop.c \ 27 btstack_run_loop_embedded.c \ 28 btstack_stdin_embedded.c \ 29 btstack_tlv_flash_bank.c \ 30 btstack_uart_block_embedded.c \ 31 hal_flash_bank_memory.c \ 32 btstack_audio.c \ 33 btstack_audio_embedded.c \ 34 btstack_linked_list.c \ 35 btstack_resample.c \ 36 btstack_ring_buffer.c \ 37 btstack_run_loop_base.c \ 38 btstack_slip.c \ 39 btstack_util.c \ 40 hci_dump.c \ 41 hci_transport_em9304_spi.c \ 42 hci_transport_h4.c \ 43 hci_transport_h5.c \ 44 45COMMON_OBJ = $(COMMON:.c=.o) 46 47FREERTOS_OBJS = \ 48 btstack_run_loop_freertos.o \ 49 btstack_uart_block_freertos.o \ 50 51all: embedded_test freertos_test 52 53embedded_test: ${COMMON_OBJ} embedded_test.c 54 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 55 56freertos_test: ${COMMON_OBJ} ${FREERTOS_OBJS} freertos_test.c 57 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 58 59test: all 60 ./embedded_test 61 ./freertos_test 62 63clean: 64 rm -f embedded_test 65 rm -f *.o 66 rm -rf *.dSYM 67 rm -f *.gcno *.gcda 68 69