aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/bitsliced-aes/Makefile
blob: 9073b6025e0dbb04f257a912279a452469ef5faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
src = $(wildcard *.c)
obj = $(src:.c=.o)

CC=k1-mbr-gcc
LDFLAGS = -Wl,--gc-sections
CFLAGS = -O3 -fdata-sections -ffunction-sections -DUNROLL_TRANSPOSE

name = bitslice

$(name):  _testbench $(obj)
	$(CC) $(LDFLAGS) -o $@ $(obj) $(LDFLAGS)


test: _test $(obj)
	$(CC) $(LDFLAGS) -o $(name) $(obj) $(LDFLAGS)

footprint: _footprint $(obj)
	$(CC) $(LDFLAGS) -o $(name) $(obj) $(LDFLAGS)


_test: tests/tests.c
	$(eval obj+=$@.o)
	$(eval CFLAGS+= -DRUN_TESTS=1)
	$(CC) -c $(CFLAGS) -o $@.o $^

_footprint: tests/tests.c
	$(eval obj+=$@.o)
	$(eval CFLAGS+= -DRUN_TESTS=1 -DTEST_FOOTPRINT=1)
	$(CC) -c $(CFLAGS) -o $@.o $^

_testbench: testbench/app.c
	$(eval obj+=_testbench.o)
	$(eval LDFLAGS+= -lcrypto)
	$(CC) -c $(CFLAGS) -o $@.o $^


clean:
	rm -f $(obj) _test.o _footprint.o _testbench.o $(name)