]>
Commit | Line | Data |
---|---|---|
562593aa AL |
1 | # -*- Mode: makefile -*- |
2 | ||
a992fe3d | 3 | GENERATED_HEADERS = config-target.h |
98c8573e | 4 | CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y) |
f527c579 | 5 | |
deed3ccf | 6 | include ../config-host.mak |
1f3d3c8f | 7 | include config-devices.mak |
25be210f | 8 | include config-target.mak |
17759187 | 9 | include $(SRC_PATH)/rules.mak |
0e8c9214 AF |
10 | ifneq ($(HWDIR),) |
11 | include $(HWDIR)/config.mak | |
12 | endif | |
626df76a | 13 | |
0b0babc6 | 14 | TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
076d2471 | 15 | $(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw) |
6c90361a | 16 | QEMU_CFLAGS+= -I.. -I$(TARGET_PATH) -DNEED_CPU_H |
40293e58 | 17 | |
0e8c9214 AF |
18 | include $(SRC_PATH)/Makefile.objs |
19 | ||
40293e58 FB |
20 | ifdef CONFIG_USER_ONLY |
21 | # user emulator name | |
22 | QEMU_PROG=qemu-$(TARGET_ARCH2) | |
23 | else | |
1e43adfc | 24 | # system emulator name |
a541f297 | 25 | ifeq ($(TARGET_ARCH), i386) |
40293e58 | 26 | QEMU_PROG=qemu$(EXESUF) |
0db63474 | 27 | else |
40293e58 | 28 | QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
a541f297 | 29 | endif |
de5eaa64 | 30 | endif |
626df76a | 31 | |
40293e58 | 32 | PROGS=$(QEMU_PROG) |
626df76a | 33 | |
626df76a | 34 | LIBS+=-lm |
831b7825 | 35 | |
0e1a275b | 36 | kvm.o kvm-all.o vhost.o vhost_net.o: QEMU_CFLAGS+=$(KVM_CFLAGS) |
7ba1e619 | 37 | |
91880d96 JQ |
38 | config-target.h: config-target.h-timestamp |
39 | config-target.h-timestamp: config-target.mak | |
40 | ||
f527c579 | 41 | all: $(PROGS) |
91880d96 | 42 | |
c2fb2637 PB |
43 | # Dummy command so that make thinks it has done something |
44 | @true | |
626df76a | 45 | |
40293e58 | 46 | ######################################################### |
626df76a | 47 | # cpu emulator library |
c2b023b6 | 48 | libobj-y = exec.o translate-all.o cpu-exec.o translate.o |
96e132e2 | 49 | libobj-y += tcg/tcg.o |
d6b38939 JQ |
50 | libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o |
51 | libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o | |
c9e0df73 | 52 | libobj-y += op_helper.o helper.o |
c6dc6f63 AP |
53 | ifeq ($(TARGET_BASE_ARCH), i386) |
54 | libobj-y += cpuid.o | |
55 | endif | |
471857dd | 56 | libobj-$(CONFIG_NEED_MMU) += mmu.o |
e18ea868 | 57 | libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o |
cf6c1b16 | 58 | |
c9e0df73 | 59 | libobj-y += disas.o |
626df76a | 60 | |
0e8c9214 | 61 | $(libobj-y): $(GENERATED_HEADERS) |
40293e58 | 62 | |
0e8c9214 | 63 | # libqemu |
40293e58 | 64 | |
86e840ee | 65 | translate.o: translate.c cpu.h |
40293e58 | 66 | |
86e840ee | 67 | translate-all.o: translate-all.c cpu.h |
40293e58 | 68 | |
86e840ee | 69 | tcg/tcg.o: cpu.h |
40293e58 FB |
70 | |
71 | # HELPER_CFLAGS is used for all the code compiled with static register | |
72 | # variables | |
864de24a | 73 | op_helper.o cpu-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) |
40293e58 | 74 | |
c81da56e JQ |
75 | # Note: this is a workaround. The real fix is to avoid compiling |
76 | # cpu_signal_handler() in cpu-exec.c. | |
77 | signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) | |
78 | ||
40293e58 FB |
79 | ######################################################### |
80 | # Linux user emulator target | |
81 | ||
82 | ifdef CONFIG_LINUX_USER | |
83 | ||
076d2471 PB |
84 | $(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)) |
85 | ||
a558ee17 | 86 | QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) |
37022086 | 87 | obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \ |
680c877a RH |
88 | elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o \ |
89 | qemu-malloc.o | |
5ba65319 | 90 | |
943e0a31 | 91 | obj-$(TARGET_HAS_BFLT) += flatload.o |
40293e58 | 92 | |
e18ea868 | 93 | obj-$(TARGET_I386) += vm86.o |
1c872672 | 94 | |
e27b27b3 | 95 | obj-i386-y += ioport-user.o |
5ba65319 | 96 | |
ed69c30d | 97 | nwfpe-obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o |
9c1dd99b | 98 | nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o |
1c872672 JQ |
99 | obj-arm-y += $(addprefix nwfpe/, $(nwfpe-obj-y)) |
100 | obj-arm-y += arm-semi.o | |
101 | ||
102 | obj-m68k-y += m68k-sim.o m68k-semi.o | |
40293e58 | 103 | |
0e8c9214 AF |
104 | $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) |
105 | ||
106 | obj-y += $(addprefix ../libuser/, $(user-obj-y)) | |
4d904533 | 107 | obj-y += $(addprefix ../libdis-user/, $(libdis-y)) |
0e8c9214 | 108 | obj-y += $(libobj-y) |
add16157 | 109 | |
40293e58 FB |
110 | endif #CONFIG_LINUX_USER |
111 | ||
112 | ######################################################### | |
113 | # Darwin user emulator target | |
114 | ||
115 | ifdef CONFIG_DARWIN_USER | |
116 | ||
076d2471 PB |
117 | $(call set-vpath, $(SRC_PATH)/darwin-user) |
118 | ||
a558ee17 | 119 | QEMU_CFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
40293e58 FB |
120 | |
121 | # Leave some space for the regular program loading zone | |
122 | LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 | |
123 | ||
124 | LIBS+=-lmx | |
125 | ||
a8e492c0 | 126 | obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \ |
3d0f1517 | 127 | gdbstub.o |
5ba65319 | 128 | |
e27b27b3 | 129 | obj-i386-y += ioport-user.o |
40293e58 | 130 | |
0e8c9214 AF |
131 | $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) |
132 | ||
133 | obj-y += $(addprefix ../libuser/, $(user-obj-y)) | |
4d904533 | 134 | obj-y += $(addprefix ../libdis-user/, $(libdis-y)) |
0e8c9214 | 135 | obj-y += $(libobj-y) |
40293e58 FB |
136 | |
137 | endif #CONFIG_DARWIN_USER | |
138 | ||
84778508 BS |
139 | ######################################################### |
140 | # BSD user emulator target | |
141 | ||
142 | ifdef CONFIG_BSD_USER | |
143 | ||
076d2471 PB |
144 | $(call set-vpath, $(SRC_PATH)/bsd-user) |
145 | ||
a558ee17 | 146 | QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) |
84778508 | 147 | |
37022086 | 148 | obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \ |
3d0f1517 | 149 | gdbstub.o uaccess.o |
5ba65319 | 150 | |
e27b27b3 | 151 | obj-i386-y += ioport-user.o |
84778508 | 152 | |
0e8c9214 AF |
153 | $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) |
154 | ||
155 | obj-y += $(addprefix ../libuser/, $(user-obj-y)) | |
4d904533 | 156 | obj-y += $(addprefix ../libdis-user/, $(libdis-y)) |
0e8c9214 | 157 | obj-y += $(libobj-y) |
84778508 BS |
158 | |
159 | endif #CONFIG_BSD_USER | |
160 | ||
40293e58 FB |
161 | ######################################################### |
162 | # System emulator target | |
76dfdd24 | 163 | ifdef CONFIG_SOFTMMU |
40293e58 | 164 | |
04c9a0cb | 165 | obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o |
1fd31ad7 AL |
166 | # virtio has to be here due to weird dependency between PCI and virtio-net. |
167 | # need to fix this properly | |
e9d0fc74 AG |
168 | obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o |
169 | obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o | |
d5970055 MT |
170 | obj-y += vhost_net.o |
171 | obj-$(CONFIG_VHOST_NET) += vhost.o | |
758e8e38 | 172 | obj-$(CONFIG_VIRTFS) += virtio-9p.o |
51464faf | 173 | obj-y += rwhandler.o |
a8e492c0 | 174 | obj-$(CONFIG_KVM) += kvm.o kvm-all.o |
98c8573e | 175 | obj-$(CONFIG_NO_KVM) += kvm-stub.o |
40293e58 | 176 | LIBS+=-lz |
4fb240a4 | 177 | |
a558ee17 | 178 | QEMU_CFLAGS += $(VNC_TLS_CFLAGS) |
a558ee17 | 179 | QEMU_CFLAGS += $(VNC_SASL_CFLAGS) |
2f6f5c7a | 180 | QEMU_CFLAGS += $(VNC_JPEG_CFLAGS) |
2f9606b3 | 181 | |
e37630ca | 182 | # xen backend driver support |
943e0a31 | 183 | obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o |
e37630ca | 184 | |
a67ba3b6 PB |
185 | # USB layer |
186 | obj-$(CONFIG_USB_OHCI) += usb-ohci.o | |
187 | ||
a41b2ff2 | 188 | # PCI network cards |
a8e492c0 JQ |
189 | obj-y += rtl8139.o |
190 | obj-y += e1000.o | |
a41b2ff2 | 191 | |
a541f297 | 192 | # Hardware support |
7f55c7ce | 193 | obj-i386-y += vga.o |
2d48377a | 194 | obj-i386-y += mc146818rtc.o i8259.o pc.o |
53b67b30 | 195 | obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o |
1ddda5cd | 196 | obj-i386-y += vmmouse.o vmport.o hpet.o applesmc.o |
09aaa160 | 197 | obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o |
d3ffc7a6 | 198 | obj-i386-y += debugcon.o multiboot.o |
c69ea0df | 199 | obj-i386-y += pc_piix.o |
9637443f | 200 | |
3cbee15b | 201 | # shared objects |
02c7c992 | 202 | obj-ppc-y = ppc.o |
4556bd8b | 203 | obj-ppc-y += vga.o |
3cbee15b | 204 | # PREP target |
956a3e6b | 205 | obj-ppc-y += i8259.o mc146818rtc.o |
add85a76 | 206 | obj-ppc-y += ppc_prep.o |
3cbee15b | 207 | # OldWorld PowerMac |
2b5eb371 | 208 | obj-ppc-y += ppc_oldworld.o |
3cbee15b | 209 | # NewWorld PowerMac |
2b5eb371 | 210 | obj-ppc-y += ppc_newworld.o |
3cbee15b | 211 | # PowerPC 4xx boards |
5f9fc5ad | 212 | obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o |
9637443f | 213 | obj-ppc-y += ppc440.o ppc440_bamboo.o |
74c62ba8 | 214 | # PowerPC E500 boards |
2b5eb371 | 215 | obj-ppc-y += ppce500_mpc8544ds.o |
9637443f | 216 | obj-ppc-$(CONFIG_KVM) += kvm_ppc.o |
3f0855b1 | 217 | obj-ppc-$(CONFIG_FDT) += device_tree.o |
9637443f JQ |
218 | |
219 | obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o | |
409dbce5 | 220 | obj-mips-y += mips_addr.o mips_timer.o mips_int.o |
4556bd8b | 221 | obj-mips-y += vga.o i8259.o |
b970ea8f | 222 | obj-mips-y += g364fb.o jazz_led.o |
956a3e6b | 223 | obj-mips-y += gt64xxx.o mc146818rtc.o |
08af49da | 224 | obj-mips-y += cirrus_vga.o |
051c190b | 225 | obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o |
9637443f | 226 | |
9637443f JQ |
227 | obj-microblaze-y = petalogix_s3adsp1800_mmu.o |
228 | ||
229 | obj-microblaze-y += microblaze_pic_cpu.o | |
230 | obj-microblaze-y += xilinx_intc.o | |
231 | obj-microblaze-y += xilinx_timer.o | |
232 | obj-microblaze-y += xilinx_uartlite.o | |
233 | obj-microblaze-y += xilinx_ethlite.o | |
234 | ||
3f0855b1 | 235 | obj-microblaze-$(CONFIG_FDT) += device_tree.o |
9637443f | 236 | |
10c144e2 | 237 | # Boards |
77d4f95e EI |
238 | obj-cris-y = cris_pic_cpu.o |
239 | obj-cris-y += cris-boot.o | |
240 | obj-cris-y += etraxfs.o axis_dev88.o | |
241 | obj-cris-y += axis_dev88.o | |
10c144e2 EI |
242 | |
243 | # IO blocks | |
9637443f JQ |
244 | obj-cris-y += etraxfs_dma.o |
245 | obj-cris-y += etraxfs_pic.o | |
246 | obj-cris-y += etraxfs_eth.o | |
247 | obj-cris-y += etraxfs_timer.o | |
248 | obj-cris-y += etraxfs_ser.o | |
249 | ||
3475187d | 250 | ifeq ($(TARGET_ARCH), sparc64) |
956a3e6b | 251 | obj-sparc-y = sun4u.o apb_pci.o |
1afdfddc | 252 | obj-sparc-y += vga.o |
2d48377a | 253 | obj-sparc-y += mc146818rtc.o |
b9945046 | 254 | obj-sparc-y += cirrus_vga.o |
3475187d | 255 | else |
24056690 | 256 | obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o |
35da37e1 | 257 | obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o |
9637443f JQ |
258 | obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o |
259 | endif | |
260 | ||
f165b53a | 261 | obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o |
9637443f JQ |
262 | obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o |
263 | obj-arm-y += versatile_pci.o | |
f7c70325 | 264 | obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o |
9637443f JQ |
265 | obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o |
266 | obj-arm-y += pl061.o | |
267 | obj-arm-y += arm-semi.o | |
268 | obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o | |
269 | obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o | |
3d08ff69 | 270 | obj-arm-y += gumstix.o |
f7736b91 | 271 | obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o |
02d74341 | 272 | obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \ |
273 | omap_gpio.o omap_intc.o omap_uart.o | |
2c1d9ecb | 274 | obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \ |
275 | omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o | |
9637443f JQ |
276 | obj-arm-y += omap_sx1.o palm.o tsc210x.o |
277 | obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o | |
278 | obj-arm-y += mst_fpga.o mainstone.o | |
5f9fc5ad | 279 | obj-arm-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o |
9637443f JQ |
280 | obj-arm-y += framebuffer.o |
281 | obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o | |
282 | obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o | |
283 | obj-arm-y += syborg_virtio.o | |
284 | ||
9637443f | 285 | obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o |
2d48377a | 286 | obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o |
f7736b91 | 287 | obj-sh4-y += ide/mmio.o |
9637443f JQ |
288 | |
289 | obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o | |
290 | obj-m68k-y += m68k-semi.o dummy_m68k.o | |
291 | ||
8cb310e1 | 292 | obj-s390x-y = s390-virtio-bus.o s390-virtio.o |
f3304eea | 293 | |
6049f4f8 RH |
294 | obj-alpha-y = alpha_palcode.o |
295 | ||
ad96090a | 296 | main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) |
5824d651 | 297 | |
2313086a BS |
298 | monitor.o: qemu-monitor.h |
299 | ||
0e8c9214 AF |
300 | $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) |
301 | ||
302 | obj-y += $(addprefix ../, $(common-obj-y)) | |
4d904533 | 303 | obj-y += $(addprefix ../libdis/, $(libdis-y)) |
0e8c9214 AF |
304 | obj-y += $(libobj-y) |
305 | obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y)) | |
626df76a | 306 | |
76dfdd24 | 307 | endif # CONFIG_SOFTMMU |
00a67ba1 | 308 | |
3d0f1517 JQ |
309 | obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o |
310 | ||
0e8c9214 | 311 | $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) |
16394485 JQ |
312 | $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)) |
313 | ||
314 | ||
59bc10ee | 315 | gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/feature_to_c.sh |
1aef4c57 | 316 | $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") |
56aebc89 | 317 | |
2313086a BS |
318 | qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx |
319 | $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") | |
320 | ||
626df76a | 321 | clean: |
2313086a | 322 | rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o |
befb0316 | 323 | rm -f *.d */*.d tcg/*.o ide/*.o |
ad96090a | 324 | rm -f qemu-monitor.h gdbstub-xml.c |
1e43adfc | 325 | |
5fafdf24 | 326 | install: all |
9b14bb04 | 327 | ifneq ($(PROGS),) |
1625af87 | 328 | $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)" |
9b14bb04 | 329 | endif |
626df76a | 330 | |
2f96c28d JM |
331 | # Include automatically generated dependency files |
332 | -include $(wildcard *.d */*.d) |