blob: 9a943248b529e7953784ff7f3c364b8db1fec148 [file] [log] [blame]
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
# Abstraction of 'run' goal with Qemu
# QEMU_INSTANCE is a command line argument to make. By appending the instance
# name to the pid file we can easily run more instances of the same sample.
QEMU_FLAGS = $(QEMU_FLAGS_$(ARCH)) -pidfile qemu$(QEMU_INSTANCE).pid
ifneq ($(QEMU_PTY),)
QEMU_FLAGS += -serial pty
else
ifneq ($(QEMU_PIPE),)
# Send console output to a pipe, used for running automated sanity tests
QEMU_FLAGS += -serial pipe:$(QEMU_PIPE)
else
QEMU_FLAGS += -serial mon:stdio
endif
endif
qemu: run
run: zephyr
$(if $(QEMU_PIPE),,@echo "To exit from QEMU enter: 'CTRL+a, x'")
@echo '[QEMU] CPU: $(QEMU_CPU_TYPE_$(ARCH))'
$(if $(CONFIG_X86_IAMCU),$(ZEPHYR_BASE)/scripts/qemu-machine-hack.py $(KERNEL_ELF_NAME))
$(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_EXTRA_FLAGS) -kernel $(KERNEL_ELF_NAME)