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.
This commit is contained in:
Markus Hitter 2016-11-21 12:52:27 +01:00
parent 47dc3aed89
commit 77a790e094
1 changed files with 16 additions and 0 deletions

View File

@ -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