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 att_db.c \ 18 att_dispatch.c \ 19 btstack_linked_list.c \ 20 btstack_memory.c \ 21 btstack_memory_pool.c \ 22 btstack_util.c \ 23 gatt_client.c \ 24 hci_cmd.c \ 25 hci_dump.c \ 26 le_device_db_memory.c \ 27 mock.c \ 28 29COMMON_OBJ = $(COMMON:.c=.o) 30 31all: gatt_client_test le_central 32 33# compile .ble description 34profile.h: profile.gatt 35 python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 36 37gatt_client_test: profile.h ${COMMON_OBJ} gatt_client_test.o expected_results.h 38 ${CC} ${COMMON_OBJ} gatt_client_test.o ${CFLAGS} ${LDFLAGS} -o $@ 39 40le_central: ${COMMON_OBJ} le_central.o 41 ${CC} ${COMMON_OBJ} le_central.o ${CFLAGS} ${LDFLAGS} -o $@ 42 43test: all 44 ./gatt_client_test 45 ./le_central 46 47clean: 48 rm -f gatt_client_test le_central 49 rm -f *.o 50 rm -rf *.dSYM 51 rm -f *.gcno *.gcda 52 53