1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -DUNIT_TEST -x c++ -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include 8LDFLAGS += -lCppUTest -lCppUTestExt 9 10VPATH += ${BTSTACK_ROOT}/src 11VPATH += ${BTSTACK_ROOT}/src/ble 12VPATH += ${BTSTACK_ROOT}/platform/posix 13 14COMMON = \ 15 ad_parser.c \ 16 att.c \ 17 att_dispatch.c \ 18 btstack_linked_list.c \ 19 btstack_memory.c \ 20 gatt_client.c \ 21 hci_cmds.c \ 22 hci_dump.c \ 23 le_device_db_memory.c \ 24 btstack_memory_pool.c \ 25 mock.c \ 26 utils.c \ 27 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 ${CORE_OBJ} ${COMMON_OBJ} gatt_client_test.o expected_results.h 38 ${CC} ${CORE_OBJ} ${COMMON_OBJ} gatt_client_test.o ${CFLAGS} ${LDFLAGS} -o $@ 39 40le_central: ${CORE_OBJ} ${COMMON_OBJ} le_central.o 41 ${CC} ${CORE_OBJ} ${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