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}/src/ble/gatt-service 14VPATH += ${BTSTACK_ROOT}/platform/posix 15 16COMMON = \ 17 ad_parser.c \ 18 att_server.c \ 19 att_db.c \ 20 att_dispatch.c \ 21 btstack_linked_list.c \ 22 btstack_memory.c \ 23 btstack_memory_pool.c \ 24 btstack_util.c \ 25 hci_cmd.c \ 26 hci_dump.c \ 27 le_device_db_memory.c \ 28 mock.c \ 29 btstack_tlv.c \ 30 battery_service_server.c \ 31 cycling_power_service_server.c \ 32 cycling_speed_and_cadence_service_server.c \ 33 device_information_service_server.c \ 34 heart_rate_service_server.c \ 35 hids_device.c \ 36 nordic_spp_service_server.c \ 37 ublox_spp_service_server.c \ 38 39COMMON_OBJ = $(COMMON:.c=.o) 40 41all: gatt_server_test 42 43# compile .ble description 44profile.h: profile.gatt 45 python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 46 47gatt_server_test: profile.h ${COMMON_OBJ} gatt_server_test.o 48 ${CC} ${COMMON_OBJ} gatt_server_test.o ${CFLAGS} ${LDFLAGS} -o $@ 49 50test: all 51 ./gatt_server_test 52 53clean: 54 rm -f gatt_server_test 55 rm -f *.o 56 rm -rf *.dSYM 57 rm -f *.gcno *.gcda 58 59