]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile.target
cpu-exec: Migrate some generic fns to cpu-exec-common
[mirror_qemu.git] / Makefile.target
CommitLineData
562593aa
AL
1# -*- Mode: makefile -*-
2
6b4ad3b2
PC
3BUILD_DIR?=$(CURDIR)/..
4
deed3ccf 5include ../config-host.mak
25be210f 6include config-target.mak
f3aa844b 7include config-devices.mak
17759187 8include $(SRC_PATH)/rules.mak
626df76a 9
12a1ddc1 10$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
af2be207
JK
11ifdef CONFIG_LINUX
12QEMU_CFLAGS += -I../linux-headers
13endif
fec90ff0 14QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
40293e58 15
2f28d2ff
AL
16QEMU_CFLAGS+=-I$(SRC_PATH)/include
17
40293e58
FB
18ifdef CONFIG_USER_ONLY
19# user emulator name
c1799a84 20QEMU_PROG=qemu-$(TARGET_NAME)
5c40c739 21QEMU_PROG_BUILD = $(QEMU_PROG)
40293e58 22else
1e43adfc 23# system emulator name
5c40c739 24QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
c12915e6 25ifneq (,$(findstring -mwindows,$(libs_softmmu)))
0fa5491e 26# Terminate program name with a 'w' because the linker builds a windows executable.
c1799a84 27QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
5c40c739
MT
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)
a541f297 33endif
0fa5491e 34endif
5c40c739
MT
35
36PROGS=$(QEMU_PROG) $(QEMU_PROGW)
b8841706 37STPFILES=
626df76a 38
91880d96
JQ
39config-target.h: config-target.h-timestamp
40config-target.h-timestamp: config-target.mak
41
6d8a764e 42ifdef CONFIG_TRACE_SYSTEMTAP
e0b2fd0e 43stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp
c276b17d
DB
44
45ifdef CONFIG_USER_ONLY
46TARGET_TYPE=user
47else
48TARGET_TYPE=system
49endif
50
c14518e9 51$(QEMU_PROG).stp-installed: $(SRC_PATH)/trace-events
c0424934 52 $(call quiet-command,$(TRACETOOL) \
650ab98d 53 --format=stap \
5b808275 54 --backends=$(TRACE_BACKENDS) \
650ab98d 55 --binary=$(bindir)/$(QEMU_PROG) \
b9a7b74f 56 --target-name=$(TARGET_NAME) \
650ab98d 57 --target-type=$(TARGET_TYPE) \
c14518e9
AL
58 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed")
59
60$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
61 $(call quiet-command,$(TRACETOOL) \
62 --format=stap \
5b808275 63 --backends=$(TRACE_BACKENDS) \
c14518e9 64 --binary=$(realpath .)/$(QEMU_PROG) \
b9a7b74f 65 --target-name=$(TARGET_NAME) \
c14518e9 66 --target-type=$(TARGET_TYPE) \
aaf821fd 67 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
c14518e9 68
e0b2fd0e
SH
69$(QEMU_PROG)-simpletrace.stp: $(SRC_PATH)/trace-events
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
c276b17d
DB
76else
77stap:
78endif
79
80all: $(PROGS) stap
91880d96 81
c2fb2637
PB
82# Dummy command so that make thinks it has done something
83 @true
626df76a 84
40293e58 85#########################################################
626df76a 86# cpu emulator library
fbe37ef3 87obj-y = exec.o translate-all.o cpu-exec.o
5abf9495 88obj-y += cpu-exec-common.o
951c6300 89obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
9cdc8df3 90obj-$(CONFIG_TCG_INTERPRETER) += tci.o
50348333 91obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
9cdc8df3 92obj-y += fpu/softfloat.o
5e8861a0 93obj-y += target-$(TARGET_BASE_ARCH)/
76cad711 94obj-y += disas.o
b77abd95 95obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
cf01ba9e 96obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
5e8861a0 97
e58f8d1f
TM
98obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decContext.o
99obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decNumber.o
100obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal32.o
101obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal64.o
102obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal128.o
103
40293e58
FB
104#########################################################
105# Linux user emulator target
106
107ifdef CONFIG_LINUX_USER
108
c3109ba1 109QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
1c872672 110
7fc5152c 111obj-y += linux-user/
8a090705 112obj-y += gdbstub.o thunk.o user-exec.o
40293e58 113
40293e58
FB
114endif #CONFIG_LINUX_USER
115
84778508
BS
116#########################################################
117# BSD user emulator target
118
119ifdef CONFIG_BSD_USER
120
adfc3e91
SS
121QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \
122 -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR)
84778508 123
7fc5152c 124obj-y += bsd-user/
8a090705 125obj-y += gdbstub.o user-exec.o
84778508 126
84778508
BS
127endif #CONFIG_BSD_USER
128
40293e58
FB
129#########################################################
130# System emulator target
76dfdd24 131ifdef CONFIG_SOFTMMU
96d0e26c 132obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
bc74112f 133obj-y += qtest.o bootdevice.o
c353f261 134obj-y += hw/
fbe37ef3 135obj-$(CONFIG_KVM) += kvm-all.o
c3049a56 136obj-y += memory.o cputlb.o
c22d8e04 137obj-y += memory_mapping.o
2a78636b 138obj-y += dump.o
c3049a56 139obj-y += migration/ram.o migration/savevm.o
7398dfc7 140LIBS := $(libs_softmmu) $(LIBS)
4fb240a4 141
3285cf4f 142# xen support
04b0de0e
WL
143obj-$(CONFIG_XEN) += xen-common.o
144obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o
145obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o
146obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o
3285cf4f 147
a541f297 148# Hardware support
b9a7b74f 149ifeq ($(TARGET_NAME), sparc64)
5e8861a0 150obj-y += hw/sparc64/
3475187d 151else
5e8861a0 152obj-y += hw/$(TARGET_BASE_ARCH)/
9637443f
JQ
153endif
154
da76ee76 155GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h qmp-commands-old.h
0e8c9214 156
76dfdd24 157endif # CONFIG_SOFTMMU
00a67ba1 158
cbdd1999
PB
159# Workaround for http://gcc.gnu.org/PR55489, see configure.
160%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
161
ba1183da 162dummy := $(call unnest-vars,,obj-y)
d608cc5c 163all-obj-y := $(obj-y)
ba1183da 164
341ea691 165target-obj-y :=
ba1183da
FZ
166block-obj-y :=
167common-obj-y :=
99100dc3 168include $(SRC_PATH)/Makefile.objs
341ea691
LV
169dummy := $(call unnest-vars,,target-obj-y)
170target-obj-y-save := $(target-obj-y)
cc475698
FZ
171dummy := $(call unnest-vars,.., \
172 block-obj-y \
173 block-obj-m \
174 common-obj-y \
175 common-obj-m)
341ea691 176target-obj-y := $(target-obj-y-save)
d608cc5c 177all-obj-y += $(common-obj-y)
341ea691 178all-obj-y += $(target-obj-y)
ba1183da 179all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
7fc5152c 180
a9ad5e1e
MT
181$(QEMU_PROG_BUILD): config-devices.mak
182
5c40c739
MT
183# build either PROG or PROGW
184$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
a9ad5e1e 185 $(call LINK, $(filter-out %.mak, $^))
4e34017c
JA
186ifdef CONFIG_DARWIN
187 $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@," REZ $(TARGET_DIR)$@")
188 $(call quiet-command,SetFile -a C $@," SETFILE $(TARGET_DIR)$@")
189endif
16394485 190
4c3b5a48
BS
191gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
192 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
56aebc89 193
acd0a093 194hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
4c3b5a48 195 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 196
da76ee76
PB
197hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx
198 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
199
e3193601 200qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
4c3b5a48 201 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 202
626df76a 203clean:
b54fa7dd
PM
204 rm -f *.a *~ $(PROGS)
205 rm -f $(shell find . -name '*.[od]')
e3193601 206 rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
6d8a764e 207ifdef CONFIG_TRACE_SYSTEMTAP
c276b17d
DB
208 rm -f *.stp
209endif
1e43adfc 210
5fafdf24 211install: all
9b14bb04 212ifneq ($(PROGS),)
0d659426 213 $(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
9b14bb04 214endif
6d8a764e 215ifdef CONFIG_TRACE_SYSTEMTAP
6aae2a2e 216 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
c14518e9 217 $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
e0b2fd0e 218 $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
c276b17d 219endif
626df76a 220
4115852b
PB
221GENERATED_HEADERS += config-target.h
222Makefile: $(GENERATED_HEADERS)