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