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}/ble 11VPATH += ${BTSTACK_ROOT}/src 12VPATH += ${BTSTACK_ROOT}/platforms/posix/src 13 14COMMON = \ 15 utils.c \ 16 btstack_memory.c \ 17 memory_pool.c \ 18 linked_list.c \ 19 sdp_util.c \ 20 remote_device_db_memory.c \ 21 hci_cmds.c \ 22 hci_dump.c \ 23 att_dispatch.c \ 24 att.c \ 25 ad_parser.c \ 26 gatt_client.c \ 27 le_device_db_memory.c \ 28 mock.c 29 30 31COMMON_OBJ = $(COMMON:.c=.o) 32 33all: gatt_client_test le_central 34 35# compile .ble description 36profile.h: profile.gatt 37 python ${BTSTACK_ROOT}/ble/compile-gatt.py $< $@ 38 39gatt_client_test: profile.h ${CORE_OBJ} ${COMMON_OBJ} gatt_client_test.o expected_results.h 40 ${CC} ${CORE_OBJ} ${COMMON_OBJ} gatt_client_test.o ${CFLAGS} ${LDFLAGS} -o $@ 41 42le_central: ${CORE_OBJ} ${COMMON_OBJ} le_central.o 43 ${CC} ${CORE_OBJ} ${COMMON_OBJ} le_central.o ${CFLAGS} ${LDFLAGS} -o $@ 44 45test: all 46 ./gatt_client_test 47 ./le_central 48 49clean: 50 rm -f gatt_client_test le_central 51 rm -f *.o 52 rm -rf *.dSYM 53