1CC = g++ 2 3# Requirements: cpputest.github.io 4 5BTSTACK_ROOT = ../.. 6 7CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -I${BTSTACK_ROOT}/src 8CFLAGS += -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION 9CFLAGS += -fprofile-arcs -ftest-coverage 10LDFLAGS += -lCppUTest -lCppUTestExt 11 12VPATH += ${BTSTACK_ROOT}/src 13VPATH += ${BTSTACK_ROOT}/src/ble 14VPATH += ${BTSTACK_ROOT}/platform/posix 15 16COMMON = \ 17 ad_parser.c \ 18 btstack_linked_list.c \ 19 btstack_memory.c \ 20 btstack_memory_pool.c \ 21 btstack_util.c \ 22 btstack_run_loop.c \ 23 hci.c \ 24 hci_cmd.c \ 25 hci_dump.c \ 26 le_device_db_memory.c \ 27 28COMMON_OBJ = $(COMMON:.c=.o) 29 30all: test_le_scan 31 32# compile .ble description 33profile.h: profile.gatt 34 python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ 35 36test_le_scan: ${COMMON_OBJ} test_le_scan.o 37 ${CC} ${COMMON_OBJ} test_le_scan.o ${CFLAGS} ${LDFLAGS} -o $@ 38 39test: all 40 ./test_le_scan 41 42clean: 43 rm -f test_le_scan 44 rm -f *.o 45 rm -rf *.dSYM 46 rm -f *.gcno *.gcda 47 48