]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile.target
dump: change cpu_get_note_size to return ssize_t
[mirror_qemu.git] / Makefile.target
CommitLineData
562593aa
AL
1# -*- Mode: makefile -*-
2
b3a29fd5 3CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
98c8573e 4CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
6dbd588a 5CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
f527c579 6
deed3ccf 7include ../config-host.mak
1f3d3c8f 8include config-devices.mak
25be210f 9include config-target.mak
17759187 10include $(SRC_PATH)/rules.mak
0e8c9214
AF
11ifneq ($(HWDIR),)
12include $(HWDIR)/config.mak
13endif
626df76a 14
0b0babc6 15TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
076d2471 16$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
af2be207
JK
17ifdef CONFIG_LINUX
18QEMU_CFLAGS += -I../linux-headers
19endif
20QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
40293e58 21
0e8c9214
AF
22include $(SRC_PATH)/Makefile.objs
23
2f28d2ff
AL
24QEMU_CFLAGS+=-I$(SRC_PATH)/include
25
40293e58
FB
26ifdef CONFIG_USER_ONLY
27# user emulator name
28QEMU_PROG=qemu-$(TARGET_ARCH2)
29else
1e43adfc 30# system emulator name
0fa5491e
SW
31ifneq (,$(findstring -mwindows,$(LIBS)))
32# Terminate program name with a 'w' because the linker builds a windows executable.
33QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF)
34endif # windows executable
40293e58 35QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
a541f297 36endif
626df76a 37
40293e58 38PROGS=$(QEMU_PROG)
0fa5491e
SW
39ifdef QEMU_PROGW
40PROGS+=$(QEMU_PROGW)
41endif
b8841706 42STPFILES=
626df76a 43
aff447c9 44ifndef CONFIG_HAIKU
626df76a 45LIBS+=-lm
aff447c9 46endif
831b7825 47
91880d96
JQ
48config-target.h: config-target.h-timestamp
49config-target.h-timestamp: config-target.mak
50
6d8a764e 51ifdef CONFIG_TRACE_SYSTEMTAP
c276b17d
DB
52stap: $(QEMU_PROG).stp
53
54ifdef CONFIG_USER_ONLY
55TARGET_TYPE=user
56else
57TARGET_TYPE=system
58endif
59
2174e238 60$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
c0424934 61 $(call quiet-command,$(TRACETOOL) \
650ab98d
LV
62 --format=stap \
63 --backend=$(TRACE_BACKEND) \
64 --binary=$(bindir)/$(QEMU_PROG) \
65 --target-arch=$(TARGET_ARCH) \
66 --target-type=$(TARGET_TYPE) \
c0424934 67 < $< > $@," GEN $(QEMU_PROG).stp")
c276b17d
DB
68else
69stap:
70endif
71
72all: $(PROGS) stap
91880d96 73
c2fb2637
PB
74# Dummy command so that make thinks it has done something
75 @true
626df76a 76
40293e58 77#########################################################
626df76a 78# cpu emulator library
9cdc8df3
PB
79obj-y = exec.o translate-all.o cpu-exec.o translate.o
80obj-y += tcg/tcg.o tcg/optimize.o
81obj-$(CONFIG_TCG_INTERPRETER) += tci.o
82obj-y += fpu/softfloat.o
83obj-y += disas.o
84obj-$(CONFIG_TCI_DIS) += tci-dis.o
5e8861a0 85obj-y += target-$(TARGET_BASE_ARCH)/
9cdc8df3 86obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
5e8861a0 87
9195b2c2 88tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
626df76a 89
0184e266 90# HELPER_CFLAGS is used for all the legacy code compiled with static register
40293e58 91# variables
0184e266 92user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
40293e58 93
c81da56e 94# Note: this is a workaround. The real fix is to avoid compiling
42a623c7 95# cpu_signal_handler() in user-exec.c.
7fc5152c 96%/signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
c81da56e 97
40293e58
FB
98#########################################################
99# Linux user emulator target
100
101ifdef CONFIG_LINUX_USER
102
c3109ba1 103QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
1c872672 104
7fc5152c
PB
105obj-y += linux-user/
106obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
40293e58 107
ce008c1f 108obj-y += $(addprefix ../, $(universal-obj-y))
0e8c9214 109obj-y += $(addprefix ../libuser/, $(user-obj-y))
4d904533 110obj-y += $(addprefix ../libdis-user/, $(libdis-y))
add16157 111
40293e58
FB
112endif #CONFIG_LINUX_USER
113
84778508
BS
114#########################################################
115# BSD user emulator target
116
117ifdef CONFIG_BSD_USER
118
a558ee17 119QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
84778508 120
7fc5152c
PB
121obj-y += bsd-user/
122obj-y += gdbstub.o user-exec.o
84778508 123
ce008c1f 124obj-y += $(addprefix ../, $(universal-obj-y))
0e8c9214 125obj-y += $(addprefix ../libuser/, $(user-obj-y))
4d904533 126obj-y += $(addprefix ../libdis-user/, $(libdis-y))
84778508
BS
127
128endif #CONFIG_BSD_USER
129
40293e58
FB
130#########################################################
131# System emulator target
76dfdd24 132ifdef CONFIG_SOFTMMU
40293e58 133
5e8861a0 134obj-y += arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
1fd31ad7
AL
135# virtio has to be here due to weird dependency between PCI and virtio-net.
136# need to fix this properly
b3a29fd5 137obj-$(CONFIG_NO_PCI) += pci-stub.o
21673cde 138obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
7725d146 139obj-$(CONFIG_VIRTIO) += virtio-scsi.o
d5970055
MT
140obj-y += vhost_net.o
141obj-$(CONFIG_VHOST_NET) += vhost.o
f4f61d27 142obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
a8e492c0 143obj-$(CONFIG_KVM) += kvm.o kvm-all.o
98c8573e 144obj-$(CONFIG_NO_KVM) += kvm-stub.o
3d402831 145obj-$(CONFIG_VGA) += vga.o
0cac1b66 146obj-y += memory.o savevm.o cputlb.o
80167a8a 147obj-y += memory_mapping.o
fae001f5 148obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += arch_memory_mapping.o
9fecbed0 149obj-$(CONFIG_HAVE_CORE_DUMP) += arch_dump.o
db207769 150obj-y += dump.o
40293e58 151LIBS+=-lz
4fb240a4 152
a558ee17 153QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
a558ee17 154QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
2f6f5c7a 155QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
efe556ad 156QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
2f9606b3 157
3285cf4f 158# xen support
868bb33f 159obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
3285cf4f
AP
160obj-$(CONFIG_NO_XEN) += xen-stub.o
161
6cbf4c8c 162# Inter-VM PCI shared memory
1b01b4e7
AG
163CONFIG_IVSHMEM =
164ifeq ($(CONFIG_KVM), y)
165 ifeq ($(CONFIG_PCI), y)
166 CONFIG_IVSHMEM = y
167 endif
168endif
169obj-$(CONFIG_IVSHMEM) += ivshmem.o
6cbf4c8c 170
963d83c8
AG
171# Generic hotplugging
172obj-y += device-hotplug.o
173
a541f297 174# Hardware support
3475187d 175ifeq ($(TARGET_ARCH), sparc64)
5e8861a0 176obj-y += hw/sparc64/
3475187d 177else
5e8861a0 178obj-y += hw/$(TARGET_BASE_ARCH)/
9637443f
JQ
179endif
180
5e8861a0
PB
181# Device tree
182ifeq ($(CONFIG_FDT), y)
183obj-$(TARGET_ARM) += device_tree.o
184obj-$(TARGET_MICROBLAZE) += device_tree.o
185obj-$(TARGET_PPC) += device_tree.o
186endif
2328826b 187
ad96090a 188main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
5824d651 189
4115852b 190GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
0e8c9214 191
ce008c1f 192obj-y += $(addprefix ../, $(universal-obj-y))
0e8c9214 193obj-y += $(addprefix ../, $(common-obj-y))
4d904533 194obj-y += $(addprefix ../libdis/, $(libdis-y))
0e8c9214 195obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
937b1258 196obj-y += $(addprefix ../, $(trace-obj-y))
626df76a 197
76dfdd24 198endif # CONFIG_SOFTMMU
00a67ba1 199
111a38b0 200ifndef CONFIG_LINUX_USER
0fc6b582 201ifndef CONFIG_BSD_USER
111a38b0 202# libcacard needs qemu-thread support, and besides is only needed by devices
0fc6b582 203# so not requires with linux-user / bsd-user targets
111a38b0 204obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
0fc6b582 205endif # CONFIG_BSD_USER
111a38b0
RR
206endif # CONFIG_LINUX_USER
207
7fc5152c
PB
208nested-vars = obj-y
209dummy := $(call unnest-vars)
210
0fa5491e
SW
211ifdef QEMU_PROGW
212# The linker builds a windows executable. Make also a console executable.
5e8861a0 213$(QEMU_PROGW): $(obj-y)
0fa5491e
SW
214 $(call LINK,$^)
215$(QEMU_PROG): $(QEMU_PROGW)
216 $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
217else
5e8861a0 218$(QEMU_PROG): $(obj-y)
e03b41d4 219 $(call LINK,$^)
0fa5491e 220endif
16394485 221
4c3b5a48
BS
222gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
223 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
56aebc89 224
acd0a093 225hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
4c3b5a48 226 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 227
e3193601 228qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
4c3b5a48 229 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 230
626df76a 231clean:
2313086a 232 rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
3b9a6ee5 233 rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o kvm/*.o
e3193601 234 rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
6d8a764e 235ifdef CONFIG_TRACE_SYSTEMTAP
c276b17d
DB
236 rm -f *.stp
237endif
1e43adfc 238
5fafdf24 239install: all
9b14bb04 240ifneq ($(PROGS),)
52ba784d
HB
241 $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
242ifneq ($(STRIP),)
243 $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
244endif
9b14bb04 245endif
6d8a764e 246ifdef CONFIG_TRACE_SYSTEMTAP
6aae2a2e
EH
247 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
248 $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
c276b17d 249endif
626df76a 250
4115852b
PB
251GENERATED_HEADERS += config-target.h
252Makefile: $(GENERATED_HEADERS)
253
2f96c28d
JM
254# Include automatically generated dependency files
255-include $(wildcard *.d */*.d)