]> git.proxmox.com Git - mirror_qemu.git/blame_incremental - Makefile.target
monitor: use qmp_dispatch()
[mirror_qemu.git] / Makefile.target
... / ...
CommitLineData
1# -*- Mode: makefile -*-
2
3BUILD_DIR?=$(CURDIR)/..
4
5include ../config-host.mak
6include config-target.mak
7include config-devices.mak
8include $(SRC_PATH)/rules.mak
9
10$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
11ifdef CONFIG_LINUX
12QEMU_CFLAGS += -I../linux-headers
13endif
14QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
15
16QEMU_CFLAGS+=-I$(SRC_PATH)/include
17
18ifdef CONFIG_USER_ONLY
19# user emulator name
20QEMU_PROG=qemu-$(TARGET_NAME)
21QEMU_PROG_BUILD = $(QEMU_PROG)
22else
23# system emulator name
24QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
25ifneq (,$(findstring -mwindows,$(libs_softmmu)))
26# Terminate program name with a 'w' because the linker builds a windows executable.
27QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
28$(QEMU_PROG): $(QEMU_PROGW)
29 $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
30QEMU_PROG_BUILD = $(QEMU_PROGW)
31else
32QEMU_PROG_BUILD = $(QEMU_PROG)
33endif
34endif
35
36PROGS=$(QEMU_PROG) $(QEMU_PROGW)
37STPFILES=
38
39config-target.h: config-target.h-timestamp
40config-target.h-timestamp: config-target.mak
41
42ifdef CONFIG_TRACE_SYSTEMTAP
43stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp
44
45ifdef CONFIG_USER_ONLY
46TARGET_TYPE=user
47else
48TARGET_TYPE=system
49endif
50
51$(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all
52 $(call quiet-command,$(TRACETOOL) \
53 --format=stap \
54 --backends=$(TRACE_BACKENDS) \
55 --binary=$(bindir)/$(QEMU_PROG) \
56 --target-name=$(TARGET_NAME) \
57 --target-type=$(TARGET_TYPE) \
58 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed")
59
60$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
61 $(call quiet-command,$(TRACETOOL) \
62 --format=stap \
63 --backends=$(TRACE_BACKENDS) \
64 --binary=$(realpath .)/$(QEMU_PROG) \
65 --target-name=$(TARGET_NAME) \
66 --target-type=$(TARGET_TYPE) \
67 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
68
69$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all
70 $(call quiet-command,$(TRACETOOL) \
71 --format=simpletrace-stap \
72 --backends=$(TRACE_BACKENDS) \
73 --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
74 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
75
76else
77stap:
78endif
79
80all: $(PROGS) stap
81
82# Dummy command so that make thinks it has done something
83 @true
84
85#########################################################
86# cpu emulator library
87obj-y = exec.o translate-all.o cpu-exec.o
88obj-y += translate-common.o
89obj-y += cpu-exec-common.o
90obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
91obj-$(CONFIG_TCG_INTERPRETER) += tci.o
92obj-y += tcg/tcg-common.o
93obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
94obj-y += fpu/softfloat.o
95obj-y += target-$(TARGET_BASE_ARCH)/
96obj-y += disas.o
97obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
98obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
99
100obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decContext.o
101obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decNumber.o
102obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal32.o
103obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal64.o
104obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal128.o
105
106#########################################################
107# Linux user emulator target
108
109ifdef CONFIG_LINUX_USER
110
111QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
112 -I$(SRC_PATH)/linux-user/host/$(ARCH) \
113 -I$(SRC_PATH)/linux-user
114
115obj-y += linux-user/
116obj-y += gdbstub.o thunk.o user-exec.o
117
118endif #CONFIG_LINUX_USER
119
120#########################################################
121# BSD user emulator target
122
123ifdef CONFIG_BSD_USER
124
125QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \
126 -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR)
127
128obj-y += bsd-user/
129obj-y += gdbstub.o user-exec.o
130
131endif #CONFIG_BSD_USER
132
133#########################################################
134# System emulator target
135ifdef CONFIG_SOFTMMU
136obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
137obj-y += qtest.o bootdevice.o
138obj-y += hw/
139obj-$(CONFIG_KVM) += kvm-all.o
140obj-y += memory.o cputlb.o
141obj-y += memory_mapping.o
142obj-y += dump.o
143obj-y += migration/ram.o migration/savevm.o
144LIBS := $(libs_softmmu) $(LIBS)
145
146# xen support
147obj-$(CONFIG_XEN) += xen-common.o
148obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o
149obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o
150obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o
151
152# Hardware support
153ifeq ($(TARGET_NAME), sparc64)
154obj-y += hw/sparc64/
155else
156obj-y += hw/$(TARGET_BASE_ARCH)/
157endif
158
159GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h qmp-commands-old.h
160
161endif # CONFIG_SOFTMMU
162
163# Workaround for http://gcc.gnu.org/PR55489, see configure.
164%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
165
166dummy := $(call unnest-vars,,obj-y)
167all-obj-y := $(obj-y)
168
169target-obj-y :=
170block-obj-y :=
171common-obj-y :=
172include $(SRC_PATH)/Makefile.objs
173dummy := $(call unnest-vars,,target-obj-y)
174target-obj-y-save := $(target-obj-y)
175dummy := $(call unnest-vars,.., \
176 block-obj-y \
177 block-obj-m \
178 crypto-obj-y \
179 crypto-aes-obj-y \
180 qom-obj-y \
181 io-obj-y \
182 common-obj-y \
183 common-obj-m)
184target-obj-y := $(target-obj-y-save)
185all-obj-y += $(common-obj-y)
186all-obj-y += $(target-obj-y)
187all-obj-y += $(qom-obj-y)
188all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
189all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
190all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
191all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
192
193$(QEMU_PROG_BUILD): config-devices.mak
194
195# build either PROG or PROGW
196$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
197 $(call LINK, $(filter-out %.mak, $^))
198ifdef CONFIG_DARWIN
199 $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@," REZ $(TARGET_DIR)$@")
200 $(call quiet-command,SetFile -a C $@," SETFILE $(TARGET_DIR)$@")
201endif
202
203gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
204 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
205
206hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
207 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
208
209hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
210 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
211
212qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx $(SRC_PATH)/scripts/hxtool
213 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
214
215clean: clean-target
216 rm -f *.a *~ $(PROGS)
217 rm -f $(shell find . -name '*.[od]')
218 rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
219ifdef CONFIG_TRACE_SYSTEMTAP
220 rm -f *.stp
221endif
222
223install: all
224ifneq ($(PROGS),)
225 $(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
226endif
227ifdef CONFIG_TRACE_SYSTEMTAP
228 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
229 $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
230 $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
231endif
232
233GENERATED_HEADERS += config-target.h
234Makefile: $(GENERATED_HEADERS)