-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.config
75 lines (60 loc) · 1.81 KB
/
Makefile.config
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
ifndef SANCUS_DIR
SANCUS_SUPPORT_DIR = "/usr/local/share/sancus-support"
else
SANCUS_SUPPORT_DIR = ${SANCUS_DIR}/share/sancus-support
endif
ifndef CAN_AUTH_DIR
CAN_AUTH_DIR = ../../can-auth
endif
CC = sancus-cc
LD = sancus-ld
SANCUS_CRYPTO = sancus-crypto
SANCUS_SIM = sancus-sim
SANCUS_LOAD = sancus-loader
RM = rm -f
SANCUS_KEY = deadbeefcafebabec0defeeddefec8ed
VENDOR_ID = 1234
RAM_SIZE = 16K
ROM_SIZE = 41K
FPGA_DEV = /dev/ttyUSB0
FPGA_RATE = 115200
VENDOR_KEY = $(shell $(SANCUS_CRYPTO) --key $(SANCUS_KEY) --gen-vendor-key $(VENDOR_ID) | xxd -p)
MEMFLAGS = --ram $(RAM_SIZE) --rom $(ROM_SIZE)
CFLAGS = -I$(SANCUS_SUPPORT_DIR)/include/ -include$(CAN_AUTH_DIR)/$(LIBVULCAN).h -Wfatal-errors -fcolor-diagnostics -Os
LDFLAGS = -L$(SANCUS_SUPPORT_DIR)/lib/ $(MEMFLAGS) -lsm-io -ldev --inline-arithmetic --standalone --verbose
SIMFLAGS = #$(MEMFLAGS)
CRYPTOFLAGS = --key $(VENDOR_KEY) --verbose --fill-macs
LOADFLAGS = -device $(FPGA_DEV) -baudrate $(FPGA_RATE) -dump-io
ifdef CI
SIMFLAGS += --crypto-noshow
endif
ifndef LIBVULCAN
LIBVULCAN = vatican
endif
ifeq ($(QUIET),1)
CFLAGS += -D__SANCUS_IO_QUIET=1
endif
ifeq ($(TRAVIS_QUIET),1)
CFLAGS += -DTRAVIS_QUIET=1
endif
ifeq ($(BENCH),1)
CFLAGS += -D__SANCUS_IO_BENCH=1
endif
ifeq ($(DEBUG),1)
CFLAGS += -DDEBUG=1
endif
ifeq ($(BENCH_MAC),1)
CFLAGS += -DBENCH_MAC_COMPUTATION=1
endif
ifdef VULCAN_SM
CFLAGS += -DVULCAN_SM=$(VULCAN_SM)
endif
ifdef CAN_DRV_SM
CFLAGS += -DCAN_DRV_SM=$(CAN_DRV_SM)
endif
ifeq ($(NOAUTH),1)
CFLAGS += -DNOAUTH
endif
ifeq ($(NG),1)
CFLAGS += -DVATICAN_INCLUDE_NONCE_GENERATOR=1
endif