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