-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (52 loc) · 2.08 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
BUILD ?= ../build
ALL := demo dispa disps disp2 disp3
ALLB := $(ALL:%=$(BUILD)/%)
all: $(BUILD) $(ALLB)
# check for local install of openssl3
ifneq ($(wildcard $(OSL3DIR)), )
OSL3INC := -I $(OSL3DIR)/include -Wno-deprecated-declarations
OSL3LIB := -L $(OSL3DIR)/lib -lcrypto
else
OSL3INC := -Wno-deprecated-declarations
OSL3LIB := -lcrypto
endif
$(BUILD)/dispa: hw_ascon.h dispatcher.c $(BUILD)/vget.o $(BUILD)/mars_ascon.o $(BUILD)/hw_ascon.o $(BUILD)/ascon.a
gcc -o $@ -include $^ $(BUILD)/libtinycbor.so
$(BUILD)/disps: hw_she.h dispatcher.c $(BUILD)/vget.o $(BUILD)/mars_she.o $(BUILD)/hw_she.o $(BUILD)/aes.o
gcc -o $@ -include $^ $(BUILD)/libtinycbor.so
$(BUILD)/disp2: hw_sha2.h dispatcher.c $(BUILD)/vget.o $(BUILD)/mars_sha2.o $(BUILD)/hw_sha2.o
gcc -o $@ -include $^ $(BUILD)/libtinycbor.so $(OSL3LIB)
$(BUILD)/disp3: hw_sha3.h dispatcher.c $(BUILD)/vget.o $(BUILD)/mars_sha3.o $(BUILD)/hw_sha3.o
gcc -o $@ -include $^ $(BUILD)/libtinycbor.so $(OSL3LIB)
$(BUILD):
mkdir $@
$(BUILD)/hw_she.o: hw_she.c hw_she.h
gcc -o $@ -c $<
$(BUILD)/aes.o: ../aes/aes.c
gcc -o $@ -c $<
$(BUILD)/mars_she.o: hw_she.h mars.c mars.h
gcc -o $@ -include $< -c mars.c
##############################################################
$(BUILD)/hw_sha2.o: hw_sha2.c hw_sha2.h
gcc -o $@ -c $< $(OSL3INC)
$(BUILD)/mars_sha2.o: hw_sha2.h mars.c mars.h
gcc -o $@ -include $< -c mars.c
##############################################################
$(BUILD)/hw_sha3.o: hw_sha3.c hw_sha3.h
gcc -o $@ -c $< $(OSL3INC)
$(BUILD)/mars_sha3.o: hw_sha3.h mars.c mars.h
gcc -o $@ -include $< -c mars.c
##############################################################
$(BUILD)/hw_ascon.o: hw_ascon.c hw_ascon.h
gcc -o $@ -c $<
$(BUILD)/mars_ascon.o: hw_ascon.h mars.c mars.h
gcc -o $@ -include $< -c mars.c
##############################################################
$(BUILD)/%.o: %.c mars.h
gcc -o $@ -c $<
$(BUILD)/api.o $(BUILD)/demo.o: api.h mars.h
$(BUILD)/demo: $(BUILD)/demo.o $(BUILD)/api.o $(BUILD)/vget.o $(BUILD)/libtinycbor.so
gcc -o $@ $^
clean:
rm $(BUILD)/*.o $(ALLB)
rmdir $(BUILD)