-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.include
45 lines (39 loc) · 1.34 KB
/
Makefile.include
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
ifndef SANCUS_DIR
SANCUS_SUPPORT_DIR = "/usr/local/share/sancus-support"
else
SANCUS_SUPPORT_DIR = ${SANCUS_DIR}/share/sancus-support
endif
ifndef SANCUS_SECURITY
SANCUS_SECURITY = 64
endif
ifeq ($(SANCUS_SECURITY), 64)
SANCUS_KEY = deadbeefcafebabe
else
SANCUS_KEY = deadbeefcafebabec0defeeddefec8ed
endif
CC = sancus-cc
LD = sancus-ld
SANCUS_CRYPTO = sancus-crypto
SANCUS_SIM = sancus-sim
SANCUS_LOAD = sancus-loader
RM = rm -f
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/ -Wfatal-errors -fcolor-diagnostics -Os -g
LDFLAGS = -L$(SANCUS_SUPPORT_DIR)/lib/ $(MEMFLAGS) -lsm-io -ldev --inline-arithmetic --standalone --verbose
SIMFLAGS = #$(MEMFLAGS)
ifdef CI
SIMFLAGS += --crypto-noshow
else
SIMFLAGS += --dumpfile=sancus_sim.vcd
endif
CRYPTOFLAGS = --key $(VENDOR_KEY) --verbose
LOADFLAGS = -device $(FPGA_DEV) -baudrate $(FPGA_RATE)
ifeq ($(QUIET),1)
CFLAGS += -DQUIET
endif