auto-generate Arduino example, to keep in sync

This commit is contained in:
Toby Jaffey 2025-12-11 11:05:44 +00:00
parent 7a1656ab10
commit 9ca720d35c
9 changed files with 22 additions and 980 deletions

15
host-arduino/Makefile Normal file
View file

@ -0,0 +1,15 @@
# The purpose of this Makefile is to auto-generate the Arduino example
# Arduino cannot set -DUVM32_MEMORY_SIZE, so add a config file
# Arduino expects .cpp files
make:
echo '#include "config.h"' > uvm32.cpp
cat ../uvm32/uvm32.c >> uvm32.cpp
cp ../uvm32/uvm32.h uvm32.h
cp ../uvm32/mini-rv32ima.h mini-rv32ima.h
cp ../common/uvm32_common_custom.h uvm32_common_custom.h
cp ../common/uvm32_sys.h uvm32_sys.h
xxd -i ../precompiled/mandel.bin | sed -e "s/unsigned char/const unsigned char/" > mandel.h
clean:
rm -f uvm32.cpp uvm32.h mini-rv32ima.h uvm32_common_custom.h uvm32_sys.h mandel.h