xref: /btstack/test/security_manager/Makefile (revision c37cd8f3d1350b92a2f66c31b2a5fcd75f8c91a4)
1CC = g++
2
3# Requirements: cpputest.github.io
4
5BTSTACK_ROOT =  ../..
6
7CFLAGS  = -DUNIT_TEST -g
8CPPFLAGS =  -x c++ -Wall -Wno-unused
9CFLAGS += -I. -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/platform/posix
10CFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
11CFLAGS += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
12LDFLAGS +=  -lCppUTest -lCppUTestExt
13
14VPATH += ${BTSTACK_ROOT}/src
15VPATH += ${BTSTACK_ROOT}/src/ble
16VPATH += ${BTSTACK_ROOT}/platform/posix
17VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
18
19COMMON = \
20    btstack_linked_list.c		\
21    btstack_memory.c			\
22    btstack_memory_pool.c		\
23    btstack_run_loop.c			\
24    btstack_run_loop_posix.c    \
25    hci_cmd.c					\
26    hci_dump.c					\
27    le_device_db_memory.c       \
28    mock.c 				        \
29    rijndael.c 					\
30    sm.c     					\
31    btstack_util.c			            \
32
33COMMON_OBJ = $(COMMON:.c=.o)
34
35MBEDTLS = \
36	ecp.c \
37	ecp_curves.c \
38	bignum.c \
39
40MICROECC = \
41	uECC.c
42
43all: security_manager aestest ecc_micro_ecc aes_cmac_test
44# sm_mbedtls_allocator_test
45
46security_manager: ${CORE_OBJ} ${COMMON_OBJ} security_manager.c
47	${CC} ${CORE_OBJ} ${COMMON_OBJ} security_manager.c ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o $@
48
49aestest: aestest.o rijndael.o
50	${CC} ${CFLAGS} $^ -o $@
51
52ecc_micro_ecc: ecc_micro_ecc.o ${MICROECC}
53	gcc ${CFLAGS} $^ -o $@
54
55aes_cmac_test: aes_cmac_test.o aes_cmac.o rijndael.o
56	gcc ${CFLAGS} $^ -o $@
57
58sm_mbedtls_allocator_test: sm_mbedtls_allocator.o hci_dump.o btstack_util.o sm_mbedtls_allocator_test.c
59	${CC} sm_mbedtls_allocator.o btstack_util.o hci_dump.o sm_mbedtls_allocator_test.c ${CFLAGS} ${CPPFLAGS}  ${LDFLAGS} -o $@
60
61test: all
62	./security_manager
63	./aes_cmac_test
64	./aestest
65	./ecc_micro_ecc
66	./aes_cmac_test
67
68clean:
69	rm -f  security_manager aestest ecc_micro_ecc aes_cmac_test
70	rm -f  *.o
71	rm -rf *.dSYM
72