1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -g -Wall -I. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include 8CFLAGS += -fprofile-arcs -ftest-coverage 9LDFLAGS += -lCppUTest -lCppUTestExt 10 11VPATH += ${BTSTACK_ROOT}/src 12VPATH += ${BTSTACK_ROOT}/src/classic 13VPATH += ${BTSTACK_ROOT}/platform/posix 14 15COMMON = \ 16 btstack_util.c \ 17 hci_dump.c \ 18 btstack_memory_pool.c \ 19 btstack_memory.c \ 20 21COMMON_OBJ = $(COMMON:.c=.o) 22 23all: build-coverage/btstack_memory_pool_test build-coverage/btstack_memory_test 24 25build-coverage: 26 mkdir -p build-coverage 27 28build-coverage/btstack_memory_pool_test: ${COMMON_OBJ} btstack_memory_pool_test.c | build-coverage 29 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 30 31build-coverage/btstack_memory_test: ${COMMON_OBJ} btstack_memory_test.c | build-coverage 32 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 33 34test: all 35 build-coverage/btstack_memory_pool_test 36 build-coverage/btstack_memory_test 37 38coverage: all 39 build-coverage/btstack_memory_pool_test 40 build-coverage/btstack_memory_test 41 42clean: 43 rm -f *.o 44 rm -rf *.dSYM build-coverage 45 rm -f *.gcno *.gcda 46 47