From 77a790e094039481884296c738c19da7043dc3cb Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 21 Nov 2016 12:52:27 +0100 Subject: [PATCH] Makefile-AVR: add a target for running in SimulAVR. This is useful for running in a standardised environment and also demonstrates how to run an executable in SimulAVR. --- Makefile-AVR | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile-AVR b/Makefile-AVR index a35ff36..231324f 100644 --- a/Makefile-AVR +++ b/Makefile-AVR @@ -176,3 +176,19 @@ size: $(BUILDDIR)/$(PROGRAM).elf $(call show_size,Program,14,30,62,126) $(call show_size,Data,1,2,4,8) $(call show_size,EEPROM,1,2,2,4) + +.PHONY: simulavr-check simulavr +simulavr-check: + @if [ ! -x ../simulavr/src/simulavr ]; then \ + echo "Can't find SimulAVR executable in ../simulavr/src/simulavr."; \ + echo "Please install and build it next to the Teacup_Firmware folder."; \ + echo "Sources can be found at https://github.com/Traumflug/simulavr"; \ + false; \ + fi + +simulavr: + @$(MAKE) --no-print-directory -f Makefile-AVR simulavr-check + @echo "Compiling for SimulAVR and running the result in SimulAVR." + $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.h.Profiling \ + MCU=atmega644 F_CPU=20000000UL all + ../simulavr/src/simulavr -f build/testcases/config.h.Profiling/teacup.elf