2014-04-11 15:14:38 +00:00
|
|
|
CC = g++
|
|
|
|
|
2015-07-03 09:18:03 +00:00
|
|
|
# Requirements: cpputest.github.io
|
2014-04-11 15:14:38 +00:00
|
|
|
|
|
|
|
BTSTACK_ROOT = ../..
|
|
|
|
|
2016-05-04 14:08:44 +00:00
|
|
|
CFLAGS = -DUNIT_TEST -g
|
|
|
|
CPPFLAGS = -x c++ -Wall -Wno-unused
|
2016-01-20 13:20:47 +00:00
|
|
|
CFLAGS += -I. -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/platform/posix
|
2016-05-04 14:08:44 +00:00
|
|
|
CFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
|
2015-05-17 16:07:24 +00:00
|
|
|
LDFLAGS += -lCppUTest -lCppUTestExt
|
|
|
|
|
|
|
|
VPATH += ${BTSTACK_ROOT}/src
|
2015-11-13 14:04:41 +00:00
|
|
|
VPATH += ${BTSTACK_ROOT}/src/ble
|
2016-01-20 13:20:47 +00:00
|
|
|
VPATH += ${BTSTACK_ROOT}/platform/posix
|
2016-05-04 14:08:44 +00:00
|
|
|
VPATH += ${BTSTACK_ROOT}/3rd-party/mbedtls/library
|
2014-04-11 15:14:38 +00:00
|
|
|
|
|
|
|
COMMON = \
|
2016-01-20 14:42:54 +00:00
|
|
|
btstack_linked_list.c \
|
2015-05-17 16:07:24 +00:00
|
|
|
btstack_memory.c \
|
2016-01-20 14:42:54 +00:00
|
|
|
btstack_memory_pool.c \
|
|
|
|
btstack_run_loop.c \
|
|
|
|
btstack_run_loop_posix.c \
|
2016-01-21 10:33:17 +00:00
|
|
|
hci_cmd.c \
|
2015-05-17 16:07:24 +00:00
|
|
|
hci_dump.c \
|
|
|
|
le_device_db_memory.c \
|
2016-01-06 16:31:20 +00:00
|
|
|
mock.c \
|
2016-01-20 14:42:54 +00:00
|
|
|
rijndael.c \
|
|
|
|
sm.c \
|
2016-01-20 15:10:07 +00:00
|
|
|
btstack_util.c \
|
2014-04-11 15:14:38 +00:00
|
|
|
|
|
|
|
COMMON_OBJ = $(COMMON:.c=.o)
|
|
|
|
|
2016-05-04 14:08:44 +00:00
|
|
|
MBEDTLS = \
|
|
|
|
ecp.c \
|
|
|
|
ecp_curves.c \
|
2016-05-07 20:02:06 +00:00
|
|
|
bignum.c \
|
2016-05-04 14:08:44 +00:00
|
|
|
|
2016-06-10 11:47:11 +00:00
|
|
|
all: security_manager aestest ectest aes_cmac_test
|
|
|
|
# sm_mbedtls_allocator_test
|
2014-04-11 15:14:38 +00:00
|
|
|
|
|
|
|
security_manager: ${CORE_OBJ} ${COMMON_OBJ} security_manager.c
|
2016-05-04 14:08:44 +00:00
|
|
|
${CC} ${CORE_OBJ} ${COMMON_OBJ} security_manager.c ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o $@
|
2014-04-11 15:14:38 +00:00
|
|
|
|
2016-05-27 11:32:29 +00:00
|
|
|
aestest: aestest.o rijndael.o
|
|
|
|
${CC} ${CFLAGS} $^ -o $@
|
2014-04-12 21:21:46 +00:00
|
|
|
|
2016-05-27 11:32:29 +00:00
|
|
|
ectest: ectest.o ${MBEDTLS} rijndael.o
|
2016-06-10 11:47:11 +00:00
|
|
|
echo "compiling ectest"
|
2016-05-04 14:08:44 +00:00
|
|
|
gcc ${CFLAGS} $^ -o $@
|
|
|
|
|
2016-05-27 11:32:29 +00:00
|
|
|
aes_cmac_test: aes_cmac_test.o aes_cmac.o rijndael.o
|
2016-05-04 14:08:44 +00:00
|
|
|
gcc ${CFLAGS} $^ -o $@
|
|
|
|
|
2016-06-03 14:59:29 +00:00
|
|
|
sm_mbedtls_allocator_test: sm_mbedtls_allocator.o hci_dump.o btstack_util.o sm_mbedtls_allocator_test.c
|
|
|
|
${CC} sm_mbedtls_allocator.o btstack_util.o hci_dump.o sm_mbedtls_allocator_test.c ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o $@
|
|
|
|
|
2015-07-03 09:18:03 +00:00
|
|
|
test: all
|
2015-05-17 16:07:24 +00:00
|
|
|
./security_manager
|
2016-05-27 11:32:29 +00:00
|
|
|
./aes_cmac_test
|
2015-05-17 16:07:24 +00:00
|
|
|
./aestest
|
2016-06-10 11:47:11 +00:00
|
|
|
./ectest
|
|
|
|
./aes_cmac_test
|
2015-05-17 16:07:24 +00:00
|
|
|
|
2014-04-11 15:14:38 +00:00
|
|
|
clean:
|
|
|
|
rm -f security_manager
|
2015-05-14 06:25:34 +00:00
|
|
|
rm -f *.o
|
2014-04-11 15:14:38 +00:00
|
|
|
rm -rf *.dSYM
|
|
|
|
|