Merge pull request #15486 from aabadie/pr/make/emulator_enh

make: handle emulator backend in Makefile.include
This commit is contained in:
benpicco 2020-11-25 00:31:19 +01:00 committed by GitHub
commit 638cb00a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View File

@ -395,6 +395,13 @@ include $(BOARDDIR)/Makefile.include
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
include $(RIOTCPU)/$(CPU)/Makefile.include
# Include emulator code if available and if emulate target is used
ifneq (,$(filter emulate,$(MAKECMDGOALS)))
# Use renode as default emulator
RIOT_EMULATOR ?= renode
-include $(RIOTMAKE)/tools/$(RIOT_EMULATOR).inc.mk
endif
# Assume GCC/GNU as supported toolchain if CPU's Makefile.include doesn't
# provide this macro
TOOLCHAINS_SUPPORTED ?= gnu

View File

@ -6,7 +6,4 @@ PROGRAMMER_SERIAL ?= 06EB
PORT_LINUX ?= $(word 2,$(shell $(RIOTTOOLS)/usb-serial/find-tty.sh '^$(PROGRAMMER_SERIAL)'))
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
# setup emulator
include $(RIOTMAKE)/tools/renode.inc.mk
include $(RIOTBOARD)/common/cc2538/Makefile.include

View File

@ -12,11 +12,7 @@ else ifeq (pyocd,$(PROGRAMMER))
endif
# QEMU 4.0 added microbit system emulation.
EMULATOR = qemu-system-arm
EMULATOR_FLAGS = -M microbit -device loader,file=$(ELFFILE) \
-serial stdio \
-monitor telnet::45454,server,nowait \
-nographic
RIOT_EMULATOR ?= qemu
# include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -0,0 +1,9 @@
EMULATOR ?= qemu-system-arm
EMULATOR_MACHINE ?= $(BOARD)
EMULATOR_MONITOR_PORT ?= 45454
EMULATOR_MONITOR_FLAGS ?= telnet::$(EMULATOR_MONITOR_PORT),server,nowait
EMULATOR_FLAGS = -machine $(EMULATOR_MACHINE) -device loader,file=$(ELFFILE) \
-serial stdio \
-monitor $(EMULATOR_MONITOR_FLAGS) \
-nographic