aboutsummaryrefslogtreecommitdiffhomepage
path: root/ext
diff options
context:
space:
mode:
authorJ08nY2020-02-26 14:28:52 +0100
committerJ08nY2020-02-26 14:28:52 +0100
commitf78ff987ac2df62dbd8326ce33ae61c97673710e (patch)
tree9b63026e223254bc3c4e6af164bd3ae3bdcc0404 /ext
parent3892d994470b181f950703fabf719a9c963d1c20 (diff)
downloadpyecsca-codegen-f78ff987ac2df62dbd8326ce33ae61c97673710e.tar.gz
pyecsca-codegen-f78ff987ac2df62dbd8326ce33ae61c97673710e.tar.zst
pyecsca-codegen-f78ff987ac2df62dbd8326ce33ae61c97673710e.zip
Get stuff to work on STM32F0.
Diffstat (limited to 'ext')
-rw-r--r--ext/Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/ext/Makefile b/ext/Makefile
new file mode 100644
index 0000000..6f1bd1f
--- /dev/null
+++ b/ext/Makefile
@@ -0,0 +1,41 @@
+export
+
+all: help
+
+help:
+ @echo "Build the tommath library for use with targets."
+
+clean:
+ $(MAKE) -C libtommath clean
+
+tommath_dir:
+ mkdir -p ../pyecsca/codegen/tommath
+
+host: LIBNAME=libtommath-HOST.a
+host: CFLAGS=-DMP_NO_DEV_URANDOM -DMP_LOW_MEM -DMP_PREC=10
+host: tommath_dir
+ $(MAKE) -C libtommath clean
+ $(MAKE) -C libtommath
+ cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME)
+
+stm32f0: CROSS_COMPILE=arm-none-eabi-
+stm32f0: CFLAGS=-mcpu=cortex-m0 -mthumb -mfloat-abi=soft -ffunction-sections -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_PREC=10
+stm32f0: LDFLAGS=--specs=nano.specs --specs=nosys.specs -T ../pyecsca/codegen/hal/stm32f0/LinkerScript.ld -Wl,--gc-sections -lm -mthumb -mcpu=cortex-m0
+stm32f0: COMPILE_SIZE=1
+stm32f0: LIBNAME=libtommath-CW308_STM32F0.a
+stm32f0: tommath_dir
+ $(MAKE) -C libtommath clean
+ $(MAKE) -C libtommath
+ cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME)
+
+stm32f3: CROSS_COMPILE=arm-none-eabi-
+stm32f3: CFLAGS=-mcpu=cortex-m4 -mthumb -mfloat-abi=soft -mfpu=fpv4-sp-d16 -fmessage-length=0 -ffunction-sections -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_PREC=10
+stm32f3: LDFLAGS=--specs=nano.specs -T ../pyecsca/codegen/hal/stm32f3/LinkerScript.ld -Wl,--gc-sections -lm -mthumb -mcpu=cortex-m4
+stm32f3: COMPILE_SIZE=1
+stm32f3: LIBNAME=libtommath-CW308_STM32F3.a
+stm32f3: tommath_dir
+ $(MAKE) -C libtommath clean
+ $(MAKE) -C libtommath
+ cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME)
+
+.PHONY: all host stm32f0 stm32f3 xmega tommath_dir help clean \ No newline at end of file