1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -I../ 8CFLAGS += -I${BTSTACK_ROOT}/src 9CFLAGS += -I${BTSTACK_ROOT}/3rd-party/rijndael 10CFLAGS += -fprofile-arcs -ftest-coverage 11LDFLAGS += -lCppUTest -lCppUTestExt 12 13VPATH += ${BTSTACK_ROOT}/src 14VPATH += ${BTSTACK_ROOT}/src/ble 15VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service 16VPATH += ${BTSTACK_ROOT}/platform/posix 17VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael 18 19COMMON = \ 20 ad_parser.c \ 21 att_db.c \ 22 att_db_util.c \ 23 att_dispatch.c \ 24 att_server.c \ 25 battery_service_server.c \ 26 btstack_crypto.c \ 27 btstack_linked_list.c \ 28 btstack_memory.c \ 29 btstack_memory_pool.c \ 30 btstack_tlv.c \ 31 btstack_util.c \ 32 cycling_power_service_server.c \ 33 cycling_speed_and_cadence_service_server.c \ 34 device_information_service_server.c \ 35 hci_cmd.c \ 36 hci_dump.c \ 37 heart_rate_service_server.c \ 38 hids_device.c \ 39 le_device_db_memory.c \ 40 mock.c \ 41 nordic_spp_service_server.c \ 42 rijndael.c \ 43 ublox_spp_service_server.c \ 44 45COMMON_OBJ = $(COMMON:.c=.o) 46 47all: gatt_server_test 48 49# compile .ble description 50profile.h: profile.gatt 51 python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 52 53gatt_server_test: profile.h ${COMMON_OBJ} gatt_server_test.o 54 ${CC} ${COMMON_OBJ} gatt_server_test.o ${CFLAGS} ${LDFLAGS} -o $@ 55 56test: all 57 ./gatt_server_test 58 59clean: 60 rm -f gatt_server_test 61 rm -f *.o 62 rm -rf *.dSYM 63 rm -f *.gcno *.gcda 64 65