1################################################################################
2#
3#      Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
4#
5# 								           Tests Makefile.
6#
7################################################################################
8
9include ../config.mk
10
11TEST_LIB_FILE:=test_ecc_utils.c
12TEST_SOURCE:=$(filter-out $(TEST_LIB_FILE), $(wildcard test_*.c))
13
14TEST_OBJECTS:=$(TEST_SOURCE:.c=.o)
15TEST_DEPS:=$(TEST_SOURCE:.c=.d)
16TEST_BINARY:=$(TEST_SOURCE:.c=$(DOTEXE))
17
18# Edit the 'all' content to add/remove tests needed from TinyCrypt library:
19all: $(TEST_BINARY)
20
21clean:
22	-$(RM) $(TEST_BINARY) $(TEST_OBJECTS) $(TEST_DEPS)
23	-$(RM) *~ *.o *.d
24
25# Dependencies
26test_aes$(DOTEXE): test_aes.o  aes_encrypt.o aes_decrypt.o utils.o
27	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
28
29test_cbc_mode$(DOTEXE): test_cbc_mode.o cbc_mode.o \
30		aes_encrypt.o aes_decrypt.o utils.o
31	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
32
33test_ctr_mode$(DOTEXE): test_ctr_mode.o ctr_mode.o \
34		aes_encrypt.o utils.o
35	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
36
37test_ctr_prng$(DOTEXE): test_ctr_prng.o ctr_prng.o \
38		aes_encrypt.o utils.o
39	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
40
41test_cmac_mode$(DOTEXE): test_cmac_mode.o aes_encrypt.o utils.o \
42		cmac_mode.o
43	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
44
45test_ccm_mode$(DOTEXE): test_ccm_mode.o aes_encrypt.o \
46		utils.o ccm_mode.o
47	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
48
49test_hmac$(DOTEXE): test_hmac.o  hmac.o sha256.o utils.o
50	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
51
52test_hmac_prng$(DOTEXE): test_hmac_prng.o hmac_prng.o hmac.o \
53		sha256.o utils.o
54	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
55
56test_sha256$(DOTEXE): test_sha256.o sha256.o utils.o
57	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
58
59test_ecc_dh$(DOTEXE): test_ecc_dh.o ecc.o ecc_dh.o test_ecc_utils.o ecc_platform_specific.o
60	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
61
62test_ecc_dsa$(DOTEXE): test_ecc_dsa.o ecc.o utils.o ecc_dh.o \
63		ecc_dsa.o sha256.o test_ecc_utils.o ecc_platform_specific.o
64	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
65
66
67-include $(TEST_DEPS)
68