30 lines
942 B
Makefile
30 lines
942 B
Makefile
#
|
|
# 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
|
|
QEMU = $(addsuffix /,$(QEMU_BIN_PATH))$(QEMU_$(ARCH))
|
|
|
|
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
|
|
|
|
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)
|