xref: /btstack/test/crypto/Makefile (revision 0561b2d8d5dba972c7daa57d5e677f7a1327edfd)
1CC = g++
2
3# Requirements: cpputest.github.io
4
5BTSTACK_ROOT =  ../..
6
7CFLAGS  = -DUNIT_TEST -g
8CPPFLAGS =  -x c++ -Wall -Wno-unused -fno-exceptions
9CFLAGS += -I. -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/platform/posix
10CFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
11CFLAGS += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
12CFLAGS += -I${BTSTACK_ROOT}/3rd-party/rijndael
13CFLAGS += -fprofile-arcs -ftest-coverage
14LDFLAGS +=  -lCppUTest -lCppUTestExt
15
16VPATH += ${BTSTACK_ROOT}/src
17VPATH += ${BTSTACK_ROOT}/src/ble
18VPATH += ${BTSTACK_ROOT}/platform/posix
19VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
20VPATH += ${BTSTACK_ROOT}/3rd-party/rijndael
21
22MBEDTLS = \
23	ecp.c \
24	ecp_curves.c \
25	bignum.c \
26
27MICROECC = \
28	uECC.c
29
30all: aes_ccm_test aestest ecc_micro_ecc aes_cmac_test
31
32aes_ccm_test: aes_ccm.o aes_ccm_test.o btstack_crypto.o btstack_linked_list.o hci_cmd.o btstack_util.o hci_dump.o aes_cmac.o rijndael.o mock.o
33	${CC} ${CFLAGS} $^ -o $@
34
35aestest: aestest.o rijndael.o
36	${CC} ${CFLAGS} $^ -o $@
37
38ecc_micro_ecc: ecc_micro_ecc.o ${MICROECC}
39	gcc ${CFLAGS} $^ -o $@
40
41aes_cmac_test: aes_cmac_test.o aes_cmac.o rijndael.o
42	gcc ${CFLAGS} $^ -o $@
43
44sm_mbedtls_allocator_test: sm_mbedtls_allocator.o hci_dump.o btstack_util.o sm_mbedtls_allocator_test.c
45	${CC} sm_mbedtls_allocator.o btstack_util.o hci_dump.o sm_mbedtls_allocator_test.c ${CFLAGS} ${CPPFLAGS}  ${LDFLAGS} -o $@
46
47test: all
48	./aes_cmac_test
49	./aestest
50	./ecc_micro_ecc
51	./aes_cmac_test
52
53clean:
54	rm -f  aestest ecc_micro_ecc aes_cmac_test
55	rm -f  *.o
56	rm -rf *.dSYM
57	rm -f *.gcno *.gcda
58
59