xref: /btstack/test/crypto/Makefile (revision e9c5f44ee8add45f6cd4be8b6faa9e09a2804fcc)
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}/platform/posix
10CFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
11CFLAGS += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
12CFLAGS += -I${BTSTACK_ROOT}/test/rijndael
13LDFLAGS +=  -lCppUTest -lCppUTestExt
14
15VPATH += ${BTSTACK_ROOT}/src
16VPATH += ${BTSTACK_ROOT}/src/ble
17VPATH += ${BTSTACK_ROOT}/platform/posix
18VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
19VPATH += ${BTSTACK_ROOT}/test/rijndael
20
21MBEDTLS = \
22	ecp.c \
23	ecp_curves.c \
24	bignum.c \
25
26MICROECC = \
27	uECC.c
28
29all: aes_ccm_test aestest ecc_micro_ecc aes_cmac_test
30
31aes_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
32
33aestest: aestest.o rijndael.o
34	${CC} ${CFLAGS} $^ -o $@
35
36ecc_micro_ecc: ecc_micro_ecc.o ${MICROECC}
37	gcc ${CFLAGS} $^ -o $@
38
39aes_cmac_test: aes_cmac_test.o aes_cmac.o rijndael.o
40	gcc ${CFLAGS} $^ -o $@
41
42sm_mbedtls_allocator_test: sm_mbedtls_allocator.o hci_dump.o btstack_util.o sm_mbedtls_allocator_test.c
43	${CC} sm_mbedtls_allocator.o btstack_util.o hci_dump.o sm_mbedtls_allocator_test.c ${CFLAGS} ${CPPFLAGS}  ${LDFLAGS} -o $@
44
45test: all
46	./aes_cmac_test
47	./aestest
48	./ecc_micro_ecc
49	./aes_cmac_test
50
51clean:
52	rm -f  aestest ecc_micro_ecc aes_cmac_test
53	rm -f  *.o
54	rm -rf *.dSYM
55
56