2009-08-04 17:24:23 +04:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
|
2009-10-07 04:40:57 +04:00
|
|
|
include ../config-host.mak
|
2009-10-07 04:41:02 +04:00
|
|
|
include config-devices.mak
|
2009-10-07 04:41:00 +04:00
|
|
|
include config-target.mak
|
2009-01-21 21:12:52 +03:00
|
|
|
include $(SRC_PATH)/rules.mak
|
2003-08-11 01:39:31 +04:00
|
|
|
|
2012-05-29 13:49:50 +04:00
|
|
|
$(call set-vpath, $(SRC_PATH))
|
2011-06-23 12:05:12 +04:00
|
|
|
ifdef CONFIG_LINUX
|
|
|
|
QEMU_CFLAGS += -I../linux-headers
|
|
|
|
endif
|
2012-05-29 13:49:50 +04:00
|
|
|
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
|
2008-01-31 14:32:10 +03:00
|
|
|
|
2011-12-04 03:10:08 +04:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/include
|
|
|
|
|
2008-01-31 14:32:10 +03:00
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
# user emulator name
|
|
|
|
QEMU_PROG=qemu-$(TARGET_ARCH2)
|
|
|
|
else
|
2003-10-01 00:54:24 +04:00
|
|
|
# system emulator name
|
2011-12-22 14:18:53 +04:00
|
|
|
ifneq (,$(findstring -mwindows,$(LIBS)))
|
|
|
|
# Terminate program name with a 'w' because the linker builds a windows executable.
|
|
|
|
QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF)
|
|
|
|
endif # windows executable
|
2008-01-31 14:32:10 +03:00
|
|
|
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
|
2004-04-13 00:39:29 +04:00
|
|
|
endif
|
2003-08-11 01:39:31 +04:00
|
|
|
|
2008-01-31 14:32:10 +03:00
|
|
|
PROGS=$(QEMU_PROG)
|
2011-12-22 14:18:53 +04:00
|
|
|
ifdef QEMU_PROGW
|
|
|
|
PROGS+=$(QEMU_PROGW)
|
|
|
|
endif
|
2010-11-16 23:07:07 +03:00
|
|
|
STPFILES=
|
2003-08-11 01:39:31 +04:00
|
|
|
|
2010-09-20 02:50:45 +04:00
|
|
|
ifndef CONFIG_HAIKU
|
2003-08-11 01:39:31 +04:00
|
|
|
LIBS+=-lm
|
2010-09-20 02:50:45 +04:00
|
|
|
endif
|
2007-01-18 23:06:33 +03:00
|
|
|
|
2009-10-07 04:41:01 +04:00
|
|
|
config-target.h: config-target.h-timestamp
|
|
|
|
config-target.h-timestamp: config-target.mak
|
|
|
|
|
2011-08-31 22:30:43 +04:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 16:20:25 +03:00
|
|
|
stap: $(QEMU_PROG).stp
|
|
|
|
|
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
TARGET_TYPE=user
|
|
|
|
else
|
|
|
|
TARGET_TYPE=system
|
|
|
|
endif
|
|
|
|
|
2012-03-18 11:47:15 +04:00
|
|
|
$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
|
2012-04-18 22:15:45 +04:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2012-04-03 22:47:39 +04:00
|
|
|
--format=stap \
|
|
|
|
--backend=$(TRACE_BACKEND) \
|
|
|
|
--binary=$(bindir)/$(QEMU_PROG) \
|
|
|
|
--target-arch=$(TARGET_ARCH) \
|
|
|
|
--target-type=$(TARGET_TYPE) \
|
2012-12-21 13:45:20 +04:00
|
|
|
< $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
|
2010-11-12 16:20:25 +03:00
|
|
|
else
|
|
|
|
stap:
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(PROGS) stap
|
2009-10-07 04:41:01 +04:00
|
|
|
|
2009-05-25 21:54:53 +04:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2003-08-11 01:39:31 +04:00
|
|
|
|
2008-01-31 14:32:10 +03:00
|
|
|
#########################################################
|
2003-08-11 01:39:31 +04:00
|
|
|
# cpu emulator library
|
2012-05-29 13:48:59 +04:00
|
|
|
obj-y = exec.o translate-all.o cpu-exec.o
|
2012-05-29 12:55:47 +04:00
|
|
|
obj-y += tcg/tcg.o tcg/optimize.o
|
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += tci.o
|
2013-01-01 21:43:56 +04:00
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
|
2012-05-29 12:55:47 +04:00
|
|
|
obj-y += fpu/softfloat.o
|
2012-05-29 12:23:15 +04:00
|
|
|
obj-y += target-$(TARGET_BASE_ARCH)/
|
2012-10-24 13:12:21 +04:00
|
|
|
obj-y += disas.o
|
2012-05-29 12:55:47 +04:00
|
|
|
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
|
2012-05-29 12:23:15 +04:00
|
|
|
|
2008-01-31 14:32:10 +03:00
|
|
|
#########################################################
|
|
|
|
# Linux user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_LINUX_USER
|
|
|
|
|
2011-02-07 09:05:54 +03:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
|
2009-07-16 20:34:03 +04:00
|
|
|
|
2012-05-29 11:33:59 +04:00
|
|
|
obj-y += linux-user/
|
2012-12-20 18:40:20 +04:00
|
|
|
obj-y += gdbstub.o thunk.o user-exec.o
|
2008-01-31 14:32:10 +03:00
|
|
|
|
|
|
|
endif #CONFIG_LINUX_USER
|
|
|
|
|
2008-10-26 23:33:16 +03:00
|
|
|
#########################################################
|
|
|
|
# BSD user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_BSD_USER
|
|
|
|
|
2009-08-03 16:46:21 +04:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
|
2008-10-26 23:33:16 +03:00
|
|
|
|
2012-05-29 11:33:59 +04:00
|
|
|
obj-y += bsd-user/
|
2012-12-20 18:40:20 +04:00
|
|
|
obj-y += gdbstub.o user-exec.o
|
2008-10-26 23:33:16 +03:00
|
|
|
|
|
|
|
endif #CONFIG_BSD_USER
|
|
|
|
|
2008-01-31 14:32:10 +03:00
|
|
|
#########################################################
|
|
|
|
# System emulator target
|
2009-08-03 16:46:41 +04:00
|
|
|
ifdef CONFIG_SOFTMMU
|
2012-05-29 13:49:34 +04:00
|
|
|
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
|
|
|
|
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
|
|
|
|
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
|
|
|
|
CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y)
|
|
|
|
CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y)
|
2008-01-31 14:32:10 +03:00
|
|
|
|
2012-05-29 13:48:59 +04:00
|
|
|
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
|
2013-02-17 01:44:03 +04:00
|
|
|
obj-y += qtest.o
|
2012-05-29 13:49:34 +04:00
|
|
|
obj-y += hw/
|
2012-05-29 13:48:59 +04:00
|
|
|
obj-$(CONFIG_KVM) += kvm-all.o
|
2010-04-19 22:59:30 +04:00
|
|
|
obj-$(CONFIG_NO_KVM) += kvm-stub.o
|
2012-04-09 20:50:52 +04:00
|
|
|
obj-y += memory.o savevm.o cputlb.o
|
2012-05-29 13:48:59 +04:00
|
|
|
obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
|
|
|
|
obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
|
2012-06-07 10:22:56 +04:00
|
|
|
obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
|
|
|
|
obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
|
2008-01-31 14:32:10 +03:00
|
|
|
LIBS+=-lz
|
2007-11-07 22:24:02 +03:00
|
|
|
|
2010-08-19 15:27:56 +04:00
|
|
|
# xen support
|
2012-05-29 13:49:34 +04:00
|
|
|
obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
|
2010-08-19 15:27:56 +04:00
|
|
|
obj-$(CONFIG_NO_XEN) += xen-stub.o
|
|
|
|
|
2004-04-13 00:39:29 +04:00
|
|
|
# Hardware support
|
2005-07-02 18:31:34 +04:00
|
|
|
ifeq ($(TARGET_ARCH), sparc64)
|
2012-05-29 12:23:15 +04:00
|
|
|
obj-y += hw/sparc64/
|
2005-07-02 18:31:34 +04:00
|
|
|
else
|
2012-05-29 12:23:15 +04:00
|
|
|
obj-y += hw/$(TARGET_BASE_ARCH)/
|
2009-07-16 20:33:58 +04:00
|
|
|
endif
|
|
|
|
|
2010-03-29 23:23:52 +04:00
|
|
|
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
|
2009-03-28 09:44:27 +03:00
|
|
|
|
2012-05-29 14:41:34 +04:00
|
|
|
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
|
2010-01-06 22:24:05 +03:00
|
|
|
|
2009-08-03 16:46:41 +04:00
|
|
|
endif # CONFIG_SOFTMMU
|
2006-10-28 16:19:07 +04:00
|
|
|
|
2012-11-28 12:40:23 +04:00
|
|
|
# Workaround for http://gcc.gnu.org/PR55489, see configure.
|
|
|
|
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
|
|
|
|
|
2012-05-22 15:41:27 +04:00
|
|
|
nested-vars += obj-y
|
|
|
|
|
|
|
|
# This resolves all nested paths, so it must come last
|
|
|
|
include $(SRC_PATH)/Makefile.objs
|
|
|
|
|
|
|
|
all-obj-y = $(obj-y)
|
2013-01-19 14:06:47 +04:00
|
|
|
all-obj-y += $(addprefix ../, $(common-obj-y))
|
2012-05-29 11:33:59 +04:00
|
|
|
|
2011-12-22 14:18:53 +04:00
|
|
|
ifdef QEMU_PROGW
|
|
|
|
# The linker builds a windows executable. Make also a console executable.
|
2012-12-20 18:40:20 +04:00
|
|
|
$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
|
2011-12-22 14:18:53 +04:00
|
|
|
$(call LINK,$^)
|
|
|
|
$(QEMU_PROG): $(QEMU_PROGW)
|
|
|
|
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
|
|
|
|
else
|
2012-12-20 18:40:20 +04:00
|
|
|
$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
|
2011-08-31 22:30:30 +04:00
|
|
|
$(call LINK,$^)
|
2011-12-22 14:18:53 +04:00
|
|
|
endif
|
2009-07-16 20:34:04 +04:00
|
|
|
|
2011-01-20 23:54:21 +03: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 21:55:29 +04:00
|
|
|
|
2010-09-30 23:00:22 +04:00
|
|
|
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
|
2011-01-20 23:54:21 +03:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 12:22:04 +04:00
|
|
|
|
2011-09-02 21:34:47 +04:00
|
|
|
qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
|
2011-01-20 23:54:21 +03:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 12:22:04 +04:00
|
|
|
|
2003-08-11 01:39:31 +04:00
|
|
|
clean:
|
2012-06-20 21:02:33 +04:00
|
|
|
rm -f *.a *~ $(PROGS)
|
|
|
|
rm -f $(shell find . -name '*.[od]')
|
2011-09-02 21:34:47 +04:00
|
|
|
rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
|
2011-08-31 22:30:43 +04:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 16:20:25 +03:00
|
|
|
rm -f *.stp
|
|
|
|
endif
|
2003-10-01 00:54:24 +04:00
|
|
|
|
2007-09-17 01:08:06 +04:00
|
|
|
install: all
|
2004-03-27 01:43:34 +03:00
|
|
|
ifneq ($(PROGS),)
|
2010-08-05 04:21:34 +04:00
|
|
|
$(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
|
|
|
|
ifneq ($(STRIP),)
|
|
|
|
$(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
|
|
|
|
endif
|
2004-03-27 01:43:34 +03:00
|
|
|
endif
|
2011-08-31 22:30:43 +04:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2012-04-18 23:55:41 +04:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
|
|
|
$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
2010-11-12 16:20:25 +03:00
|
|
|
endif
|
2003-08-11 01:39:31 +04:00
|
|
|
|
2012-05-29 14:41:34 +04:00
|
|
|
GENERATED_HEADERS += config-target.h
|
|
|
|
Makefile: $(GENERATED_HEADERS)
|