57 lines
1.4 KiB
Makefile
Raw Normal View History

2014-08-29 12:01:39 +00:00
CC = g++
# Requirements: cpputest.github.io
2014-08-29 12:01:39 +00:00
BTSTACK_ROOT = ../..
CFLAGS = -g -Wall -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include
CFLAGS_COVERAGE = ${CFLAGS} -fprofile-arcs -ftest-coverage
CFLAGS_ASAN = ${CFLAGS} -fsanitize=address -DHAVE_ASSERT
LDFLAGS += -lCppUTest -lCppUTestExt
LDFLAGS_COVERAGE = ${LDFLAGS} -fprofile-arcs -ftest-coverage
LDFLAGS_ASAN = ${LDFLAGS} -fsanitize=address
VPATH += ${BTSTACK_ROOT}/src
2015-11-13 15:04:41 +01:00
VPATH += ${BTSTACK_ROOT}/src/classic
2016-01-20 14:20:47 +01:00
VPATH += ${BTSTACK_ROOT}/platform/posix
2014-08-29 12:01:39 +00:00
COMMON = \
sdp_util.c \
2015-10-11 23:31:11 +02:00
hci_dump.c \
btstack_util.c
2014-08-29 12:01:39 +00:00
COMMON_OBJ_COVERAGE = $(addprefix build-coverage/,$(COMMON:.c=.o))
COMMON_OBJ_ASAN = $(addprefix build-asan/, $(COMMON:.c=.o))
all: build-coverage/des_iterator_test build-asan/des_iterator_test
build-%:
mkdir -p $@
2014-08-29 12:01:39 +00:00
build-coverage/%.o: %.c | build-coverage
${CC} -c $(CFLAGS_COVERAGE) $< -o $@
2014-08-29 12:01:39 +00:00
build-asan/%.o: %.c | build-asan
${CC} -c $(CFLAGS_ASAN) $< -o $@
build-coverage/des_iterator_test: ${COMMON_OBJ_COVERAGE} build-coverage/des_iterator_test.o | build-coverage
${CC} $^ ${LDFLAGS_COVERAGE} -o $@
build-asan/des_iterator_test: ${COMMON_OBJ_ASAN} build-asan/des_iterator_test.o | build-asan
${CC} $^ ${LDFLAGS_ASAN} -o $@
2014-08-29 12:01:39 +00:00
test: all
build-asan/des_iterator_test
coverage: all
rm -f build-coverage/*.gcda
build-coverage/des_iterator_test
2014-08-29 12:01:39 +00:00
clean:
rm -rf build-coverage build-asan