Files
xemu/Makefile.target
T

232 lines
6.7 KiB
SYSTEMD
Raw Normal View History

2009-08-04 08:24:23 -05:00
# -*- Mode: makefile -*-
2015-05-25 22:38:06 -07:00
BUILD_DIR?=$(CURDIR)/..
include ../config-host.mak
include config-target.mak
include config-devices.mak
2009-01-21 18:12:52 +00:00
include $(SRC_PATH)/rules.mak
2003-08-10 21:39:31 +00:00
$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
2011-06-23 10:05:12 +02:00
ifdef CONFIG_LINUX
QEMU_CFLAGS += -I../linux-headers
endif
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H
2011-12-03 17:10:08 -06:00
QEMU_CFLAGS+=-I$(SRC_PATH)/include
2003-10-27 21:09:52 +00:00
ifdef CONFIG_USER_ONLY
# user emulator name
2013-06-14 15:19:07 +01:00
QEMU_PROG=qemu-$(TARGET_NAME)
QEMU_PROG_BUILD = $(QEMU_PROG)
2003-10-27 21:09:52 +00:00
else
# system emulator name
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 15:19:07 +01:00
QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
$(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)
endif
endif
2004-01-05 00:08:14 +00:00
PROGS=$(QEMU_PROG) $(QEMU_PROGW)
STPFILES=
2003-08-10 21:39:31 +00:00
config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak
ifdef CONFIG_TRACE_SYSTEMTAP
2014-06-22 21:46:07 +08:00
stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp
ifdef CONFIG_USER_ONLY
TARGET_TYPE=user
else
TARGET_TYPE=system
endif
$(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all
$(call quiet-command,$(TRACETOOL) \
--group=all \
--format=stap \
2014-05-27 15:02:14 +02:00
--backends=$(TRACE_BACKENDS) \
--binary=$(bindir)/$(QEMU_PROG) \
2013-06-04 14:45:26 +02:00
--target-name=$(TARGET_NAME) \
--target-type=$(TARGET_TYPE) \
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
$(call quiet-command,$(TRACETOOL) \
--group=all \
--format=stap \
2014-05-27 15:02:14 +02:00
--backends=$(TRACE_BACKENDS) \
--binary=$(realpath .)/$(QEMU_PROG) \
2013-06-04 14:45:26 +02:00
--target-name=$(TARGET_NAME) \
--target-type=$(TARGET_TYPE) \
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all
2014-06-22 21:46:07 +08:00
$(call quiet-command,$(TRACETOOL) \
--group=all \
2014-06-22 21:46:07 +08:00
--format=simpletrace-stap \
--backends=$(TRACE_BACKENDS) \
--probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
$< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
2014-06-22 21:46:07 +08:00
else
stap:
endif
2016-11-02 20:46:13 +01:00
.PHONY: stap
all: $(PROGS) stap
2009-05-25 18:54:53 +01:00
# Dummy command so that make thinks it has done something
@true
2003-08-10 21:39:31 +00:00
#########################################################
2003-08-10 21:39:31 +00:00
# cpu emulator library
obj-y += exec.o
obj-y += accel/
2017-07-03 18:12:23 +08:00
obj-$(CONFIG_TCG) += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
obj-$(CONFIG_TCG) += tcg/tcg-common.o tcg/tcg-runtime.o
2017-06-20 13:30:09 -03:00
obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o
2013-01-01 18:43:56 +01:00
obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
obj-y += fpu/softfloat.o
obj-y += target/$(TARGET_BASE_ARCH)/
obj-y += disas.o
obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o
2014-04-21 15:54:52 -05: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
#########################################################
# Linux user emulator target
ifdef CONFIG_LINUX_USER
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
-I$(SRC_PATH)/linux-user/host/$(ARCH) \
-I$(SRC_PATH)/linux-user
obj-y += linux-user/
2016-10-24 10:35:53 +02:00
obj-y += gdbstub.o thunk.o user-exec.o user-exec-stub.o
endif #CONFIG_LINUX_USER
2008-10-26 20:33:16 +00:00
#########################################################
# BSD user emulator target
ifdef CONFIG_BSD_USER
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
obj-y += bsd-user/
2016-10-24 10:35:53 +02:00
obj-y += gdbstub.o user-exec.o user-exec-stub.o
2008-10-26 20:33:16 +00:00
endif #CONFIG_BSD_USER
#########################################################
# System emulator target
2009-08-03 14:46:41 +02:00
ifdef CONFIG_SOFTMMU
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
2017-06-26 07:22:57 +02:00
obj-y += qtest.o
obj-y += hw/
obj-y += memory.o
obj-y += memory_mapping.o
obj-y += dump.o
2017-04-24 21:03:48 +02:00
obj-y += migration/ram.o
LIBS := $(libs_softmmu) $(LIBS)
2007-11-07 19:24:02 +00:00
# Hardware support
2013-06-04 14:45:26 +02:00
ifeq ($(TARGET_NAME), sparc64)
obj-y += hw/sparc64/
2005-07-02 14:31:34 +00:00
else
obj-y += hw/$(TARGET_BASE_ARCH)/
2004-09-30 22:22:08 +00:00
endif
2009-07-16 18:33:58 +02:00
GENERATED_FILES += hmp-commands.h hmp-commands-info.h
2010-01-06 20:24:05 +01:00
2009-08-03 14:46:41 +02:00
endif # CONFIG_SOFTMMU
2006-10-28 12:19:07 +00:00
# Workaround for http://gcc.gnu.org/PR55489, see configure.
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
dummy := $(call unnest-vars,,obj-y)
all-obj-y := $(obj-y)
target-obj-y :=
block-obj-y :=
common-obj-y :=
2016-12-12 15:49:01 +03:00
chardev-obj-y :=
include $(SRC_PATH)/Makefile.objs
dummy := $(call unnest-vars,,target-obj-y)
target-obj-y-save := $(target-obj-y)
dummy := $(call unnest-vars,.., \
block-obj-y \
block-obj-m \
2016-12-12 15:49:01 +03:00
chardev-obj-y \
crypto-obj-y \
crypto-aes-obj-y \
qom-obj-y \
2015-02-27 16:19:33 +00:00
io-obj-y \
common-obj-y \
2017-04-04 21:39:39 +00:00
common-obj-m)
target-obj-y := $(target-obj-y-save)
all-obj-y += $(common-obj-y)
all-obj-y += $(target-obj-y)
all-obj-y += $(qom-obj-y)
2016-12-12 15:49:01 +03:00
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y)
all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
2015-02-27 16:19:33 +00:00
all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
$(QEMU_PROG_BUILD): config-devices.mak
2017-04-04 21:39:39 +00:00
COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a
# build either PROG or PROGW
$(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)
$(call LINK, $(filter-out %.mak, $^))
ifdef CONFIG_DARWIN
$(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@")
$(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@")
endif
2011-01-20 20:54:21 +00: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 17:55:29 +00:00
2016-06-07 13:27:04 +02:00
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@")
2016-06-07 13:27:04 +02:00
hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@")
clean: clean-target
rm -f *.a *~ $(PROGS)
rm -f $(shell find . -name '*.[od]')
2016-09-12 13:19:11 +04:00
rm -f hmp-commands.h gdbstub-xml.c
ifdef CONFIG_TRACE_SYSTEMTAP
rm -f *.stp
endif
install: all
2004-03-26 22:43:34 +00:00
ifneq ($(PROGS),)
$(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
2004-03-26 22:43:34 +00:00
endif
ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
$(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
2014-06-22 21:46:07 +08:00
$(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
endif
2003-08-10 21:39:31 +00:00
GENERATED_FILES += config-target.h
Makefile: $(GENERATED_FILES)