aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/templates/Makefile
blob: 8721d4c2bd1ea39742de5b341c49cdf7d9e1e367 (plain) (blame)
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
TARGET = pyecsca-codegen

SRC += main.c bn/bn.c asn1/asn1.c hash/hash.c prng/prng.c $(wildcard gen/*.c)

PLATFORM = {{ platform }}

CDEFS += -DHASH={{ hash_type }} -DMOD_RAND={{ mod_rand }} -DREDUCTION={{ reduction }}

MKDIR_LIST += hash prng asn1 bn gen

EXTRAINCDIRS += hash prng asn1 bn gen tommath

LDFLAGS += tommath/libtommath-{{ platform }}.a

ifeq ($(PLATFORM),CW308_XMEGA)

else ifeq ($(PLATFORM),CW308_STM32F0)
CFLAGS += -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_PREC=10
else ifeq ($(PLATFORM),CW308_STM32F3)
CFLAGS += -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_PREC=10
else ifeq ($(PLATFORM),HOST)
CFLAGS += -DMP_NO_DEV_URANDOM -DMP_LOW_MEM -DMP_PREC=10
else
  $(error Invalid or empty PLATFORM: $(PLATFORM). Known platforms: $(KNOWN_PLATFORMS))
endif
include simpleserial/Makefile.simpleserial

FIRMWAREPATH = .
include Makefile.inc