summaryrefslogtreecommitdiff
path: root/prototype/fw/Makefile
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2020-11-26 12:38:52 +0100
committerjaseg <git@jaseg.de>2020-11-26 12:38:52 +0100
commit451904a0c5fae3bd28d35c7128df3a9db1a04b26 (patch)
treeb406c126b08032219894db3ff16a2ccf87c667d6 /prototype/fw/Makefile
parente282a5eb373ec4b44d36f580fe642483f2e52794 (diff)
downloadihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.tar.gz
ihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.tar.bz2
ihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.zip
Add CRC32 implementation
Diffstat (limited to 'prototype/fw/Makefile')
-rw-r--r--prototype/fw/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/prototype/fw/Makefile b/prototype/fw/Makefile
index db7952b..3fbd029 100644
--- a/prototype/fw/Makefile
+++ b/prototype/fw/Makefile
@@ -23,9 +23,9 @@ DEBUG ?= 1
OPT ?= 0
BUILDDIR ?= build
-BINARY := safetyreset.elf
+BINARY := rotohsm_proto_rotor.elf
LDSCRIPT := generic_stm32.ld
-DEVICE := STM32F302C8
+DEVICE := STM32F302CB
########################################################################################################################
@@ -53,6 +53,7 @@ C_SOURCES += $(MUSL_SOURCES)
PREFIX ?= arm-none-eabi-
+HOSTCC := gcc
CC := $(PREFIX)gcc
CPP := $(PREFIX)cpp
CXX := $(PREFIX)g++
@@ -102,6 +103,8 @@ COMMON_CFLAGS += -O$(OPT) -std=gnu11 -g
COMMON_CFLAGS += $(DEVICE_DEFINES)
COMMON_CFLAGS += -DDEBUG=$(DEBUG)
+HOST_CFLAGS += $(COMMON_CFLAGS)
+
# for musl
CFLAGS += -Dhidden=
@@ -193,6 +196,13 @@ $(BUILDDIR)/%.o: %.s
mkdir -p $(@D)
$(CC) $(COMMON_CFLAGS) $(CFLAGS) $(EXT_CFLAGS) -o $@ -c $<
+$(BUILDDIR)/crc32_test: src/crc32_test.c src/crc32.c
+ $(HOSTCC) $(HOST_CFLAGS) -o $@ $^
+
+.PHONY: run_tests
+run_tests: $(BUILDDIR)/crc32_test
+ $(PYTHON3) -m unittest test.crc32_ref
+
venv:
test -d venv || python3 -m venv --system-site-packages venv
source venv/bin/activate && pip install cxxfilt pyelftools libarchive matplotlib