2009-08-04 15:24:23 +02:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
|
2009-10-07 02:40:57 +02:00
|
|
|
include ../config-host.mak
|
2009-10-07 02:41:00 +02:00
|
|
|
include config-target.mak
|
2013-04-16 10:50:38 +02:00
|
|
|
include config-devices.mak
|
2009-01-21 19:12:52 +01:00
|
|
|
include $(SRC_PATH)/rules.mak
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2012-05-29 11:49:50 +02:00
|
|
|
$(call set-vpath, $(SRC_PATH))
|
2011-06-23 10:05:12 +02:00
|
|
|
ifdef CONFIG_LINUX
|
|
|
|
QEMU_CFLAGS += -I../linux-headers
|
|
|
|
endif
|
2012-05-29 11:49:50 +02:00
|
|
|
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
|
2008-01-31 12:32:10 +01:00
|
|
|
|
2011-12-04 00:10:08 +01:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/include
|
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
# user emulator name
|
2013-06-14 16:19:07 +02:00
|
|
|
QEMU_PROG=qemu-$(TARGET_NAME)
|
2014-04-28 09:03:03 +02:00
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROG)
|
2008-01-31 12:32:10 +01:00
|
|
|
else
|
2003-09-30 22:54:24 +02:00
|
|
|
# system emulator name
|
2014-04-28 09:03:03 +02:00
|
|
|
QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
|
2013-04-24 22:57:59 +02:00
|
|
|
ifneq (,$(findstring -mwindows,$(libs_softmmu)))
|
2011-12-22 11:18:53 +01:00
|
|
|
# Terminate program name with a 'w' because the linker builds a windows executable.
|
2013-06-14 16:19:07 +02:00
|
|
|
QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
|
2014-04-28 09:03:03 +02:00
|
|
|
$(QEMU_PROG): $(QEMU_PROGW)
|
|
|
|
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
|
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROGW)
|
|
|
|
else
|
|
|
|
QEMU_PROG_BUILD = $(QEMU_PROG)
|
2004-04-12 22:39:29 +02:00
|
|
|
endif
|
2011-12-22 11:18:53 +01:00
|
|
|
endif
|
2014-04-28 09:03:03 +02:00
|
|
|
|
|
|
|
PROGS=$(QEMU_PROG) $(QEMU_PROGW)
|
2010-11-16 21:07:07 +01:00
|
|
|
STPFILES=
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2009-10-07 02:41:01 +02:00
|
|
|
config-target.h: config-target.h-timestamp
|
|
|
|
config-target.h-timestamp: config-target.mak
|
|
|
|
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2013-06-14 16:19:07 +02:00
|
|
|
stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp
|
2010-11-12 14:20:25 +01:00
|
|
|
|
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
TARGET_TYPE=user
|
|
|
|
else
|
|
|
|
TARGET_TYPE=system
|
|
|
|
endif
|
|
|
|
|
2013-06-14 16:19:07 +02:00
|
|
|
$(QEMU_PROG).stp-installed: $(SRC_PATH)/trace-events
|
2012-04-18 20:15:45 +02:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2012-04-03 20:47:39 +02:00
|
|
|
--format=stap \
|
2014-05-27 15:02:14 +02:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2012-04-03 20:47:39 +02:00
|
|
|
--binary=$(bindir)/$(QEMU_PROG) \
|
2013-06-04 14:45:26 +02:00
|
|
|
--target-name=$(TARGET_NAME) \
|
2012-04-03 20:47:39 +02:00
|
|
|
--target-type=$(TARGET_TYPE) \
|
2013-06-14 16:19:07 +02:00
|
|
|
< $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed")
|
|
|
|
|
|
|
|
$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
|
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
|
|
|
--format=stap \
|
2014-05-27 15:02:14 +02:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2013-06-14 16:19:07 +02:00
|
|
|
--binary=$(realpath .)/$(QEMU_PROG) \
|
2013-06-04 14:45:26 +02:00
|
|
|
--target-name=$(TARGET_NAME) \
|
2013-06-14 16:19:07 +02:00
|
|
|
--target-type=$(TARGET_TYPE) \
|
2012-12-21 10:45:20 +01:00
|
|
|
< $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
|
2013-06-14 16:19:07 +02:00
|
|
|
|
2010-11-12 14:20:25 +01:00
|
|
|
else
|
|
|
|
stap:
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(PROGS) stap
|
2009-10-07 02:41:01 +02:00
|
|
|
|
2009-05-25 19:54:53 +02:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
2003-08-10 23:39:31 +02:00
|
|
|
# cpu emulator library
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-y = exec.o translate-all.o cpu-exec.o
|
2012-05-29 10:55:47 +02:00
|
|
|
obj-y += tcg/tcg.o tcg/optimize.o
|
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += tci.o
|
2013-01-01 18:43:56 +01:00
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
|
2012-05-29 10:55:47 +02:00
|
|
|
obj-y += fpu/softfloat.o
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += target-$(TARGET_BASE_ARCH)/
|
2012-10-24 11:12:21 +02:00
|
|
|
obj-y += disas.o
|
2013-09-13 19:25:54 +02:00
|
|
|
obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
|
2013-09-13 19:25:53 +02:00
|
|
|
obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
|
2012-05-29 10:23:15 +02:00
|
|
|
|
2014-04-21 22:54:52 +02:00
|
|
|
obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decContext.o
|
|
|
|
obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decNumber.o
|
|
|
|
obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal32.o
|
|
|
|
obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal64.o
|
|
|
|
obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal128.o
|
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
|
|
|
# Linux user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_LINUX_USER
|
|
|
|
|
2011-02-07 07:05:54 +01:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
|
2009-07-16 18:34:03 +02:00
|
|
|
|
2012-05-29 09:33:59 +02:00
|
|
|
obj-y += linux-user/
|
2012-12-20 15:40:20 +01:00
|
|
|
obj-y += gdbstub.o thunk.o user-exec.o
|
2008-01-31 12:32:10 +01:00
|
|
|
|
|
|
|
endif #CONFIG_LINUX_USER
|
|
|
|
|
2008-10-26 21:33:16 +01:00
|
|
|
#########################################################
|
|
|
|
# BSD user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_BSD_USER
|
|
|
|
|
2014-06-08 18:57:22 +02: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 21:33:16 +01:00
|
|
|
|
2012-05-29 09:33:59 +02:00
|
|
|
obj-y += bsd-user/
|
2012-12-20 15:40:20 +01:00
|
|
|
obj-y += gdbstub.o user-exec.o
|
2008-10-26 21:33:16 +01:00
|
|
|
|
|
|
|
endif #CONFIG_BSD_USER
|
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
|
|
|
# System emulator target
|
2009-08-03 14:46:41 +02:00
|
|
|
ifdef CONFIG_SOFTMMU
|
2014-05-14 11:43:05 +02:00
|
|
|
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
|
2013-02-16 22:44:03 +01:00
|
|
|
obj-y += qtest.o
|
2012-05-29 11:49:34 +02:00
|
|
|
obj-y += hw/
|
2013-02-05 12:36:30 +01:00
|
|
|
obj-$(CONFIG_FDT) += device_tree.o
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-$(CONFIG_KVM) += kvm-all.o
|
2012-04-09 18:50:52 +02:00
|
|
|
obj-y += memory.o savevm.o cputlb.o
|
2013-05-28 14:53:32 +02:00
|
|
|
obj-y += memory_mapping.o
|
2013-05-17 11:54:40 +02:00
|
|
|
obj-y += dump.o
|
2013-04-17 16:26:44 +02:00
|
|
|
LIBS+=$(libs_softmmu)
|
2007-11-07 20:24:02 +01:00
|
|
|
|
2010-08-19 13:27:56 +02:00
|
|
|
# xen support
|
2014-05-07 18:16:43 +02:00
|
|
|
obj-$(CONFIG_XEN) += xen-common.o
|
|
|
|
obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o
|
|
|
|
obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o
|
|
|
|
obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o
|
2010-08-19 13:27:56 +02:00
|
|
|
|
2004-04-12 22:39:29 +02:00
|
|
|
# Hardware support
|
2013-06-04 14:45:26 +02:00
|
|
|
ifeq ($(TARGET_NAME), sparc64)
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += hw/sparc64/
|
2005-07-02 16:31:34 +02:00
|
|
|
else
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += hw/$(TARGET_BASE_ARCH)/
|
2009-07-16 18:33:58 +02:00
|
|
|
endif
|
|
|
|
|
2012-05-29 12:41:34 +02:00
|
|
|
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2009-08-03 14:46:41 +02:00
|
|
|
endif # CONFIG_SOFTMMU
|
2006-10-28 14:19:07 +02:00
|
|
|
|
2012-11-28 09:40:23 +01:00
|
|
|
# Workaround for http://gcc.gnu.org/PR55489, see configure.
|
|
|
|
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
|
|
|
|
|
2014-02-10 07:48:52 +01:00
|
|
|
dummy := $(call unnest-vars,,obj-y)
|
2014-04-29 17:49:25 +02:00
|
|
|
all-obj-y := $(obj-y)
|
2014-02-10 07:48:52 +01:00
|
|
|
|
|
|
|
block-obj-y :=
|
|
|
|
common-obj-y :=
|
2012-05-22 13:41:27 +02:00
|
|
|
include $(SRC_PATH)/Makefile.objs
|
2014-02-10 07:48:59 +01:00
|
|
|
dummy := $(call unnest-vars,.., \
|
|
|
|
block-obj-y \
|
|
|
|
block-obj-m \
|
|
|
|
common-obj-y \
|
|
|
|
common-obj-m)
|
2014-04-29 17:49:25 +02:00
|
|
|
all-obj-y += $(common-obj-y)
|
2014-02-10 07:48:52 +01:00
|
|
|
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
|
2012-05-29 09:33:59 +02:00
|
|
|
|
2013-04-17 16:26:44 +02:00
|
|
|
ifndef CONFIG_HAIKU
|
|
|
|
LIBS+=-lm
|
|
|
|
endif
|
|
|
|
|
2014-04-28 09:03:03 +02:00
|
|
|
# build either PROG or PROGW
|
|
|
|
$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
|
2011-08-31 20:30:30 +02:00
|
|
|
$(call LINK,$^)
|
2009-07-16 18:34:04 +02:00
|
|
|
|
2011-01-20 21:54:21 +01:00
|
|
|
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
|
|
|
|
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
|
2008-10-11 19:55:29 +02:00
|
|
|
|
2010-09-30 21:00:22 +02:00
|
|
|
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
|
2011-01-20 21:54:21 +01:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 10:22:04 +02:00
|
|
|
|
2011-09-02 19:34:47 +02:00
|
|
|
qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
|
2011-01-20 21:54:21 +01:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 10:22:04 +02:00
|
|
|
|
2003-08-10 23:39:31 +02:00
|
|
|
clean:
|
2012-06-20 19:02:33 +02:00
|
|
|
rm -f *.a *~ $(PROGS)
|
|
|
|
rm -f $(shell find . -name '*.[od]')
|
2011-09-02 19:34:47 +02:00
|
|
|
rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 14:20:25 +01:00
|
|
|
rm -f *.stp
|
|
|
|
endif
|
2003-09-30 22:54:24 +02:00
|
|
|
|
2007-09-16 23:08:06 +02:00
|
|
|
install: all
|
2004-03-26 23:43:34 +01:00
|
|
|
ifneq ($(PROGS),)
|
2014-05-08 13:02:29 +02:00
|
|
|
$(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
|
2010-08-05 02:21:34 +02:00
|
|
|
ifneq ($(STRIP),)
|
2014-05-08 12:56:58 +02:00
|
|
|
$(STRIP) $(PROGS:%="$(DESTDIR)$(bindir)/%")
|
2010-08-05 02:21:34 +02:00
|
|
|
endif
|
2004-03-26 23:43:34 +01:00
|
|
|
endif
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2012-04-18 21:55:41 +02:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
2013-06-14 16:19:07 +02:00
|
|
|
$(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
|
2010-11-12 14:20:25 +01:00
|
|
|
endif
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2012-05-29 12:41:34 +02:00
|
|
|
GENERATED_HEADERS += config-target.h
|
|
|
|
Makefile: $(GENERATED_HEADERS)
|