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${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 44test: all 45 ./aes_cmac_test 46 ./aestest 47 ./ecc_micro_ecc 48 ./aes_cmac_test 49 50clean: 51 rm -f aestest ecc_micro_ecc aes_cmac_test 52 rm -f *.o 53 rm -rf *.dSYM 54 rm -f *.gcno *.gcda 55 56