1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -I../ -I${BTSTACK_ROOT}/src 8CFLAGS += -fprofile-arcs -ftest-coverage 9LDFLAGS += -lCppUTest -lCppUTestExt 10 11VPATH += ${BTSTACK_ROOT}/src 12VPATH += ${BTSTACK_ROOT}/src/ble 13VPATH += ${BTSTACK_ROOT}/platform/posix 14 15COMMON = \ 16 ad_parser.c \ 17 ancs_client.c \ 18 att_db.c \ 19 att_dispatch.c \ 20 btstack_linked_list.c \ 21 btstack_memory.c \ 22 btstack_memory_pool.c \ 23 btstack_util.c \ 24 gatt_client.c \ 25 hci_cmd.c \ 26 hci_dump.c \ 27 le_device_db_memory.c \ 28 mock.c \ 29 30COMMON_OBJ = $(COMMON:.c=.o) 31 32all: gatt_client_test le_central 33 34# compile .ble description 35profile.h: profile.gatt 36 python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 37 38gatt_client_test: profile.h ${COMMON_OBJ} gatt_client_test.o expected_results.h 39 ${CC} ${COMMON_OBJ} gatt_client_test.o ${CFLAGS} ${LDFLAGS} -o $@ 40 41le_central: ${COMMON_OBJ} le_central.o 42 ${CC} ${COMMON_OBJ} le_central.o ${CFLAGS} ${LDFLAGS} -o $@ 43 44test: all 45 ./gatt_client_test 46 ./le_central 47 48clean: 49 rm -f gatt_client_test le_central 50 rm -f *.o 51 rm -rf *.dSYM 52 rm -f *.gcno *.gcda 53 54