
include ../common.make

INCLUDES = -I${BTSTACK_ROOT}/src
INCLUDES += -I${BTSTACK_ROOT}/test/include/coverage-ble

CFLAGS   += ${INCLUDES}
CXXFLAGS += ${INCLUDES}

VPATH += ${BTSTACK_ROOT}/src
VPATH += ${BTSTACK_ROOT}/src/classic
VPATH += ${BTSTACK_ROOT}/platform/posix

COMMON = \
	btstack_util.c			\
	hci_dump.c				\
	ad_parser.c

COMMON_OBJ_COVERAGE = $(addprefix build-coverage/,$(COMMON:.c=.o))
COMMON_OBJ_ASAN     = $(addprefix build-asan/,    $(COMMON:.c=.o))

all: coverage test

build-coverage/ad_parser_test: $(COMMON_OBJ_COVERAGE)
build-asan/ad_parser_test: $(COMMON_OBJ_ASAN)

test: build-asan/ad_parser_test
	$<

coverage: build-coverage/ad_parser_test.info

clean: clean-common

