1CC=g++ 2 3BTSTACK_ROOT = ../.. 4CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest 5 6COMMON = \ 7 btstack_link_key_db_tlv.c \ 8 btstack_tlv_flash_sector.c \ 9 btstack_util.c \ 10 hal_flash_sector_memory.c \ 11 hci_dump.c \ 12 13COMMON_OBJ = $(COMMON:.c=.o) 14 15VPATH = \ 16 ${BTSTACK_ROOT}/src \ 17 ${BTSTACK_ROOT}/src/classic \ 18 ${BTSTACK_ROOT}/platform/embedded \ 19 20CFLAGS = \ 21 -DBTSTACK_TEST \ 22 -g \ 23 -Wall \ 24 -Wmissing-prototypes \ 25 -Wnarrowing \ 26 -I. \ 27 -I.. \ 28 -I${BTSTACK_ROOT}/src \ 29 -I${BTSTACK_ROOT}/platform/embedded \ 30 31LDFLAGS += -lCppUTest -lCppUTestExt 32 33TESTS = tlv_test 34 35all: ${TESTS} 36 37clean: 38 rm -rf *.o $(TESTS) *.dSYM *.pklg 39 40tlv_test: ${COMMON_OBJ} tlv_test.o 41 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 42 43test: all 44 @echo Run all test 45 @set -e; \ 46 for test in $(TESTS); do \ 47 ./$$test; \ 48 done 49 50