2009-08-04 13:24:23 +00:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
|
2015-05-26 05:38:06 +00:00
|
|
|
BUILD_DIR?=$(CURDIR)/..
|
|
|
|
|
2009-10-07 00:40:57 +00:00
|
|
|
include ../config-host.mak
|
2009-10-07 00:41:00 +00:00
|
|
|
include config-target.mak
|
2009-01-21 18:12:52 +00:00
|
|
|
include $(SRC_PATH)/rules.mak
|
2003-08-10 21:39:31 +00:00
|
|
|
|
2019-01-23 06:56:01 +00:00
|
|
|
ifdef CONFIG_SOFTMMU
|
|
|
|
include config-devices.mak
|
|
|
|
endif
|
|
|
|
|
2015-08-09 07:02:55 +00:00
|
|
|
$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
|
2011-06-23 08:05:12 +00:00
|
|
|
ifdef CONFIG_LINUX
|
|
|
|
QEMU_CFLAGS += -I../linux-headers
|
|
|
|
endif
|
2018-03-21 15:22:07 +00:00
|
|
|
QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H
|
2008-01-31 11:32:10 +00:00
|
|
|
|
2018-03-21 15:22:07 +00:00
|
|
|
QEMU_CFLAGS+=-iquote $(SRC_PATH)/include
|
2011-12-03 23:10:08 +00:00
|
|
|
|
2008-01-31 11:32:10 +00:00
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
# user emulator name
|
2013-06-14 14:19:07 +00:00
|
|
|
QEMU_PROG=qemu-$(TARGET_NAME)
|
2014-04-28 07:03:03 +00:00
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROG)
|
2008-01-31 11:32:10 +00:00
|
|
|
else
|
2003-09-30 20:54:24 +00:00
|
|
|
# system emulator name
|
2014-04-28 07:03:03 +00:00
|
|
|
QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
|
2017-11-16 16:37:32 +00:00
|
|
|
ifneq (,$(findstring -mwindows,$(SDL_LIBS)))
|
2011-12-22 10:18:53 +00:00
|
|
|
# Terminate program name with a 'w' because the linker builds a windows executable.
|
2013-06-14 14:19:07 +00:00
|
|
|
QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
|
2014-04-28 07:03:03 +00:00
|
|
|
$(QEMU_PROG): $(QEMU_PROGW)
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"GEN","$(TARGET_DIR)$(QEMU_PROG)")
|
2014-04-28 07:03:03 +00:00
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROGW)
|
|
|
|
else
|
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROG)
|
2004-04-12 20:39:29 +00:00
|
|
|
endif
|
2011-12-22 10:18:53 +00:00
|
|
|
endif
|
2014-04-28 07:03:03 +00:00
|
|
|
|
|
|
|
PROGS=$(QEMU_PROG) $(QEMU_PROGW)
|
2010-11-16 20:07:07 +00:00
|
|
|
STPFILES=
|
2003-08-10 21:39:31 +00:00
|
|
|
|
2009-10-07 00:41:01 +00:00
|
|
|
config-target.h: config-target.h-timestamp
|
|
|
|
config-target.h-timestamp: config-target.mak
|
|
|
|
|
2019-07-05 14:35:53 +00:00
|
|
|
config-devices.h: config-devices.h-timestamp
|
|
|
|
config-devices.h-timestamp: config-devices.mak
|
|
|
|
|
2011-08-31 18:30:43 +00:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2019-01-23 12:00:16 +00:00
|
|
|
stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp $(QEMU_PROG)-log.stp
|
2010-11-12 13:20:25 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
TARGET_TYPE=user
|
|
|
|
else
|
|
|
|
TARGET_TYPE=system
|
|
|
|
endif
|
|
|
|
|
2017-07-28 13:36:31 +00:00
|
|
|
tracetool-y = $(SRC_PATH)/scripts/tracetool.py
|
|
|
|
tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
|
|
|
|
|
|
|
|
$(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
2012-04-18 18:15:45 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2012-04-03 18:47:39 +00:00
|
|
|
--format=stap \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2012-04-03 18:47:39 +00:00
|
|
|
--binary=$(bindir)/$(QEMU_PROG) \
|
2013-06-04 12:45:26 +00:00
|
|
|
--target-name=$(TARGET_NAME) \
|
2012-04-03 18:47:39 +00:00
|
|
|
--target-type=$(TARGET_TYPE) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
|
2013-06-14 14:19:07 +00:00
|
|
|
|
2017-07-28 13:36:31 +00:00
|
|
|
$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
2013-06-14 14:19:07 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2013-06-14 14:19:07 +00:00
|
|
|
--format=stap \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2013-06-14 14:19:07 +00:00
|
|
|
--binary=$(realpath .)/$(QEMU_PROG) \
|
2013-06-04 12:45:26 +00:00
|
|
|
--target-name=$(TARGET_NAME) \
|
2013-06-14 14:19:07 +00:00
|
|
|
--target-type=$(TARGET_TYPE) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
|
2013-06-14 14:19:07 +00:00
|
|
|
|
2017-07-28 13:36:31 +00:00
|
|
|
$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
2014-06-22 13:46:07 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-06-22 13:46:07 +00:00
|
|
|
--format=simpletrace-stap \
|
|
|
|
--backends=$(TRACE_BACKENDS) \
|
|
|
|
--probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
|
2014-06-22 13:46:07 +00:00
|
|
|
|
2019-01-23 12:00:16 +00:00
|
|
|
$(QEMU_PROG)-log.stp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
|
|
|
--group=all \
|
|
|
|
--format=log-stap \
|
|
|
|
--backends=$(TRACE_BACKENDS) \
|
|
|
|
--probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
|
|
|
|
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-log.stp")
|
|
|
|
|
2010-11-12 13:20:25 +00:00
|
|
|
else
|
|
|
|
stap:
|
|
|
|
endif
|
2016-11-02 19:46:13 +00:00
|
|
|
.PHONY: stap
|
2010-11-12 13:20:25 +00:00
|
|
|
|
|
|
|
all: $(PROGS) stap
|
2009-10-07 00:41:01 +00:00
|
|
|
|
2009-05-25 17:54:53 +00:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2003-08-10 21:39:31 +00:00
|
|
|
|
2019-03-08 16:39:08 +00:00
|
|
|
obj-y += trace/
|
|
|
|
|
2008-01-31 11:32:10 +00:00
|
|
|
#########################################################
|
2003-08-10 21:39:31 +00:00
|
|
|
# cpu emulator library
|
2019-09-19 20:30:29 +00:00
|
|
|
obj-y += exec.o exec-vary.o
|
2017-06-02 06:06:44 +00:00
|
|
|
obj-y += accel/
|
2017-09-15 21:11:45 +00:00
|
|
|
obj-$(CONFIG_TCG) += tcg/tcg.o tcg/tcg-op.o tcg/tcg-op-vec.o tcg/tcg-op-gvec.o
|
2017-09-14 20:53:46 +00:00
|
|
|
obj-$(CONFIG_TCG) += tcg/tcg-common.o tcg/optimize.o
|
2017-06-20 16:30:09 +00:00
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o
|
2013-01-01 17:43:56 +00:00
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
|
2018-05-22 19:20:03 +00:00
|
|
|
obj-$(CONFIG_TCG) += fpu/softfloat.o
|
2016-10-11 06:56:52 +00:00
|
|
|
obj-y += target/$(TARGET_BASE_ARCH)/
|
2012-10-24 09:12:21 +00:00
|
|
|
obj-y += disas.o
|
2013-09-13 17:25:54 +00:00
|
|
|
obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
|
2019-05-16 09:51:34 +00:00
|
|
|
LIBS := $(libs_cpu) $(LIBS)
|
2012-05-29 08:23:15 +00:00
|
|
|
|
2017-08-30 22:39:53 +00:00
|
|
|
obj-$(CONFIG_PLUGIN) += plugins/
|
|
|
|
|
2008-01-31 11:32:10 +00:00
|
|
|
#########################################################
|
|
|
|
# Linux user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_LINUX_USER
|
|
|
|
|
2016-05-12 17:47:46 +00:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
|
2016-06-13 10:57:18 +00:00
|
|
|
-I$(SRC_PATH)/linux-user/host/$(ARCH) \
|
2016-05-12 17:47:46 +00:00
|
|
|
-I$(SRC_PATH)/linux-user
|
2009-07-16 16:34:03 +00:00
|
|
|
|
2012-05-29 07:33:59 +00:00
|
|
|
obj-y += linux-user/
|
2017-09-11 21:33:25 +00:00
|
|
|
obj-y += gdbstub.o thunk.o
|
2008-01-31 11:32:10 +00:00
|
|
|
|
|
|
|
endif #CONFIG_LINUX_USER
|
|
|
|
|
2008-10-26 20:33:16 +00:00
|
|
|
#########################################################
|
|
|
|
# BSD user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_BSD_USER
|
|
|
|
|
2014-06-08 16:57:22 +00:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \
|
|
|
|
-I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR)
|
2008-10-26 20:33:16 +00:00
|
|
|
|
2012-05-29 07:33:59 +00:00
|
|
|
obj-y += bsd-user/
|
2017-09-11 21:33:25 +00:00
|
|
|
obj-y += gdbstub.o
|
2008-10-26 20:33:16 +00:00
|
|
|
|
|
|
|
endif #CONFIG_BSD_USER
|
|
|
|
|
2008-01-31 11:32:10 +00:00
|
|
|
#########################################################
|
|
|
|
# System emulator target
|
2009-08-03 12:46:41 +00:00
|
|
|
ifdef CONFIG_SOFTMMU
|
2019-06-19 20:10:42 +00:00
|
|
|
obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
|
2017-06-26 05:22:57 +00:00
|
|
|
obj-y += qtest.o
|
2019-06-19 20:10:48 +00:00
|
|
|
obj-y += dump/
|
2012-05-29 09:49:34 +00:00
|
|
|
obj-y += hw/
|
2019-06-13 15:33:57 +00:00
|
|
|
obj-y += monitor/
|
2019-02-14 15:22:40 +00:00
|
|
|
obj-y += qapi/
|
2017-06-02 06:06:44 +00:00
|
|
|
obj-y += memory.o
|
2013-05-28 12:53:32 +00:00
|
|
|
obj-y += memory_mapping.o
|
2017-04-24 19:03:48 +00:00
|
|
|
obj-y += migration/ram.o
|
2015-03-09 14:54:33 +00:00
|
|
|
LIBS := $(libs_softmmu) $(LIBS)
|
2007-11-07 19:24:02 +00:00
|
|
|
|
2004-04-12 20:39:29 +00:00
|
|
|
# Hardware support
|
2013-06-04 12:45:26 +00:00
|
|
|
ifeq ($(TARGET_NAME), sparc64)
|
2012-05-29 08:23:15 +00:00
|
|
|
obj-y += hw/sparc64/
|
2005-07-02 14:31:34 +00:00
|
|
|
else
|
2012-05-29 08:23:15 +00:00
|
|
|
obj-y += hw/$(TARGET_BASE_ARCH)/
|
2009-07-16 16:33:58 +00:00
|
|
|
endif
|
|
|
|
|
2019-04-01 14:12:19 +00:00
|
|
|
generated-files-y += hmp-commands.h hmp-commands-info.h
|
2019-07-05 14:35:53 +00:00
|
|
|
generated-files-y += config-devices.h
|
2010-01-06 19:24:05 +00:00
|
|
|
|
2009-08-03 12:46:41 +00:00
|
|
|
endif # CONFIG_SOFTMMU
|
2006-10-28 12:19:07 +00:00
|
|
|
|
2014-02-10 06:48:52 +00:00
|
|
|
dummy := $(call unnest-vars,,obj-y)
|
2014-04-29 15:49:25 +00:00
|
|
|
all-obj-y := $(obj-y)
|
2014-02-10 06:48:52 +00:00
|
|
|
|
2012-05-22 11:41:27 +00:00
|
|
|
include $(SRC_PATH)/Makefile.objs
|
2014-02-10 06:48:59 +00:00
|
|
|
dummy := $(call unnest-vars,.., \
|
2015-10-21 12:16:21 +00:00
|
|
|
authz-obj-y \
|
2014-02-10 06:48:59 +00:00
|
|
|
block-obj-y \
|
|
|
|
block-obj-m \
|
2016-12-12 12:49:01 +00:00
|
|
|
chardev-obj-y \
|
2015-09-02 09:57:27 +00:00
|
|
|
crypto-obj-y \
|
2015-09-02 10:18:16 +00:00
|
|
|
qom-obj-y \
|
2015-02-27 16:19:33 +00:00
|
|
|
io-obj-y \
|
2014-02-10 06:48:59 +00:00
|
|
|
common-obj-y \
|
2019-02-12 16:25:23 +00:00
|
|
|
common-obj-m)
|
2014-04-29 15:49:25 +00:00
|
|
|
all-obj-y += $(common-obj-y)
|
2015-09-02 10:18:16 +00:00
|
|
|
all-obj-y += $(qom-obj-y)
|
2015-10-21 12:16:21 +00:00
|
|
|
all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y)
|
2016-12-12 12:49:01 +00:00
|
|
|
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y)
|
2015-09-02 09:57:27 +00:00
|
|
|
all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
|
2015-02-27 16:19:33 +00:00
|
|
|
all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
|
2012-05-29 07:33:59 +00:00
|
|
|
|
2019-01-23 06:56:01 +00:00
|
|
|
ifdef CONFIG_SOFTMMU
|
2015-02-19 07:48:52 +00:00
|
|
|
$(QEMU_PROG_BUILD): config-devices.mak
|
2019-01-23 06:56:01 +00:00
|
|
|
endif
|
2015-02-19 07:48:52 +00:00
|
|
|
|
2017-09-19 14:20:31 +00:00
|
|
|
COMMON_LDADDS = ../libqemuutil.a
|
2017-01-25 16:14:15 +00:00
|
|
|
|
2014-04-28 07:03:03 +00:00
|
|
|
# build either PROG or PROGW
|
2017-01-25 16:14:15 +00:00
|
|
|
$(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)
|
2015-02-19 07:48:52 +00:00
|
|
|
$(call LINK, $(filter-out %.mak, $^))
|
2015-05-19 08:11:17 +00:00
|
|
|
ifdef CONFIG_DARWIN
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@")
|
|
|
|
$(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@")
|
2015-05-19 08:11:17 +00:00
|
|
|
endif
|
2009-07-16 16:34:04 +00:00
|
|
|
|
2011-01-20 20:54:21 +00:00
|
|
|
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@")
|
2008-10-11 17:55:29 +00:00
|
|
|
|
2016-06-07 11:27:04 +00:00
|
|
|
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@")
|
2009-06-06 08:22:04 +00:00
|
|
|
|
2016-06-07 11:27:04 +00:00
|
|
|
hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@")
|
2015-09-10 15:38:58 +00:00
|
|
|
|
2016-09-05 08:52:19 +00:00
|
|
|
clean: clean-target
|
2012-06-20 17:02:33 +00:00
|
|
|
rm -f *.a *~ $(PROGS)
|
|
|
|
rm -f $(shell find . -name '*.[od]')
|
2016-09-12 09:19:11 +00:00
|
|
|
rm -f hmp-commands.h gdbstub-xml.c
|
2019-02-15 09:23:00 +00:00
|
|
|
rm -f trace/generated-helpers.c trace/generated-helpers.c-timestamp
|
2011-08-31 18:30:43 +00:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 13:20:25 +00:00
|
|
|
rm -f *.stp
|
|
|
|
endif
|
2003-09-30 20:54:24 +00:00
|
|
|
|
2007-09-16 21:08:06 +00:00
|
|
|
install: all
|
2004-03-26 22:43:34 +00:00
|
|
|
ifneq ($(PROGS),)
|
2014-06-22 06:55:23 +00:00
|
|
|
$(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
|
2004-03-26 22:43:34 +00:00
|
|
|
endif
|
2011-08-31 18:30:43 +00:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2012-04-18 19:55:41 +00:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
2013-06-14 14:19:07 +00:00
|
|
|
$(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
|
2014-06-22 13:46:07 +00:00
|
|
|
$(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
|
2019-01-23 12:00:16 +00:00
|
|
|
$(INSTALL_DATA) $(QEMU_PROG)-log.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-log.stp"
|
2010-11-12 13:20:25 +00:00
|
|
|
endif
|
2003-08-10 21:39:31 +00:00
|
|
|
|
2019-04-01 14:12:19 +00:00
|
|
|
generated-files-y += config-target.h
|
|
|
|
Makefile: $(generated-files-y)
|
2019-04-30 13:44:10 +00:00
|
|
|
|
|
|
|
# Reports/Analysis
|
|
|
|
#
|
|
|
|
# The target specific coverage report only cares about target specific
|
|
|
|
# blobs and not the shared code.
|
|
|
|
#
|
|
|
|
|
|
|
|
%/coverage-report.html:
|
|
|
|
@mkdir -p $*
|
|
|
|
$(call quiet-command,\
|
|
|
|
gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \
|
|
|
|
-p --html --html-details -o $@, \
|
|
|
|
"GEN", "coverage-report.html")
|
|
|
|
|
|
|
|
.PHONY: coverage-report
|
|
|
|
coverage-report: $(CURDIR)/reports/coverage/coverage-report.html
|