]>
Commit | Line | Data |
---|---|---|
562593aa AL |
1 | # -*- Mode: makefile -*- |
2 | ||
626df76a | 3 | include config.mak |
17759187 | 4 | include $(SRC_PATH)/rules.mak |
626df76a | 5 | |
0b0babc6 | 6 | TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
4fb240a4 | 7 | VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw |
6c90361a | 8 | QEMU_CFLAGS+= -I.. -I$(TARGET_PATH) -DNEED_CPU_H |
40293e58 FB |
9 | |
10 | ifdef CONFIG_USER_ONLY | |
11 | # user emulator name | |
12 | QEMU_PROG=qemu-$(TARGET_ARCH2) | |
13 | else | |
1e43adfc | 14 | # system emulator name |
a541f297 | 15 | ifeq ($(TARGET_ARCH), i386) |
40293e58 | 16 | QEMU_PROG=qemu$(EXESUF) |
0db63474 | 17 | else |
40293e58 | 18 | QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
a541f297 | 19 | endif |
de5eaa64 | 20 | endif |
626df76a | 21 | |
40293e58 | 22 | PROGS=$(QEMU_PROG) |
626df76a | 23 | |
626df76a | 24 | LIBS+=-lm |
831b7825 | 25 | |
b248a85d | 26 | kvm.o kvm-all.o: QEMU_CFLAGS+=$(KVM_CFLAGS) |
7ba1e619 | 27 | |
40293e58 | 28 | all: $(PROGS) |
c2fb2637 PB |
29 | # Dummy command so that make thinks it has done something |
30 | @true | |
626df76a | 31 | |
40293e58 | 32 | ######################################################### |
626df76a | 33 | # cpu emulator library |
facd2857 | 34 | libobj-y = exec.o translate-all.o cpu-exec.o translate.o |
c9e0df73 | 35 | libobj-y += tcg/tcg.o tcg/tcg-runtime.o |
d6b38939 JQ |
36 | libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o |
37 | libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o | |
c9e0df73 | 38 | libobj-y += op_helper.o helper.o |
471857dd | 39 | libobj-$(CONFIG_NEED_MMU) += mmu.o |
e18ea868 JQ |
40 | libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o |
41 | libobj-$(TARGET_ALPHA) += alpha_palcode.o | |
cf6c1b16 | 42 | |
626df76a | 43 | # NOTE: the disassembler code is only needed for debugging |
c9e0df73 | 44 | libobj-y += disas.o |
64656024 JQ |
45 | libobj-$(CONFIG_ALPHA_DIS) += alpha-dis.o |
46 | libobj-$(CONFIG_ARM_DIS) += arm-dis.o | |
47 | libobj-$(CONFIG_CRIS_DIS) += cris-dis.o | |
48 | libobj-$(CONFIG_HPPA_DIS) += hppa-dis.o | |
49 | libobj-$(CONFIG_I386_DIS) += i386-dis.o | |
50 | libobj-$(CONFIG_M68K_DIS) += m68k-dis.o | |
51 | libobj-$(CONFIG_MICROBLAZE_DIS) += microblaze-dis.o | |
52 | libobj-$(CONFIG_MIPS_DIS) += mips-dis.o | |
53 | libobj-$(CONFIG_PPC_DIS) += ppc-dis.o | |
54 | libobj-$(CONFIG_S390_DIS) += s390-dis.o | |
55 | libobj-$(CONFIG_SH4_DIS) += sh4-dis.o | |
56 | libobj-$(CONFIG_SPARC_DIS) += sparc-dis.o | |
626df76a | 57 | |
40293e58 FB |
58 | # libqemu |
59 | ||
c9e0df73 | 60 | libqemu.a: $(libobj-y) |
40293e58 | 61 | |
86e840ee | 62 | translate.o: translate.c cpu.h |
40293e58 | 63 | |
86e840ee | 64 | translate-all.o: translate-all.c cpu.h |
40293e58 | 65 | |
86e840ee | 66 | tcg/tcg.o: cpu.h |
40293e58 FB |
67 | |
68 | # HELPER_CFLAGS is used for all the code compiled with static register | |
69 | # variables | |
864de24a | 70 | op_helper.o cpu-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) |
40293e58 | 71 | |
c81da56e JQ |
72 | # Note: this is a workaround. The real fix is to avoid compiling |
73 | # cpu_signal_handler() in cpu-exec.c. | |
74 | signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) | |
75 | ||
40293e58 FB |
76 | ######################################################### |
77 | # Linux user emulator target | |
78 | ||
79 | ifdef CONFIG_LINUX_USER | |
80 | ||
3ebdd119 | 81 | VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) |
a558ee17 | 82 | QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) |
40293e58 | 83 | |
37022086 | 84 | obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \ |
6af5a252 | 85 | elfload.o linuxload.o uaccess.o gdbstub.o gdbstub-xml.o |
5ba65319 | 86 | |
943e0a31 | 87 | obj-$(TARGET_HAS_BFLT) += flatload.o |
943e0a31 | 88 | obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o |
40293e58 | 89 | |
e18ea868 | 90 | obj-$(TARGET_I386) += vm86.o |
1c872672 | 91 | |
e27b27b3 | 92 | obj-i386-y += ioport-user.o |
5ba65319 | 93 | |
ed69c30d | 94 | nwfpe-obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o |
9c1dd99b | 95 | nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o |
1c872672 JQ |
96 | obj-arm-y += $(addprefix nwfpe/, $(nwfpe-obj-y)) |
97 | obj-arm-y += arm-semi.o | |
98 | ||
99 | obj-m68k-y += m68k-sim.o m68k-semi.o | |
40293e58 | 100 | |
16394485 | 101 | ARLIBS=../libqemu_user.a libqemu.a |
40293e58 FB |
102 | endif #CONFIG_LINUX_USER |
103 | ||
104 | ######################################################### | |
105 | # Darwin user emulator target | |
106 | ||
107 | ifdef CONFIG_DARWIN_USER | |
108 | ||
109 | VPATH+=:$(SRC_PATH)/darwin-user | |
a558ee17 | 110 | QEMU_CFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
40293e58 FB |
111 | |
112 | # Leave some space for the regular program loading zone | |
113 | LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 | |
114 | ||
115 | LIBS+=-lmx | |
116 | ||
a8e492c0 | 117 | obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \ |
5ba65319 BS |
118 | gdbstub.o gdbstub-xml.o |
119 | ||
e27b27b3 | 120 | obj-i386-y += ioport-user.o |
40293e58 | 121 | |
16394485 | 122 | ARLIBS=libqemu.a |
40293e58 FB |
123 | |
124 | endif #CONFIG_DARWIN_USER | |
125 | ||
84778508 BS |
126 | ######################################################### |
127 | # BSD user emulator target | |
128 | ||
129 | ifdef CONFIG_BSD_USER | |
130 | ||
131 | VPATH+=:$(SRC_PATH)/bsd-user | |
a558ee17 | 132 | QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) |
84778508 | 133 | |
37022086 | 134 | obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \ |
5ba65319 BS |
135 | gdbstub.o gdbstub-xml.o uaccess.o |
136 | ||
e27b27b3 | 137 | obj-i386-y += ioport-user.o |
84778508 | 138 | |
16394485 | 139 | ARLIBS=libqemu.a ../libqemu_user.a |
84778508 BS |
140 | |
141 | endif #CONFIG_BSD_USER | |
142 | ||
40293e58 FB |
143 | ######################################################### |
144 | # System emulator target | |
76dfdd24 | 145 | ifdef CONFIG_SOFTMMU |
40293e58 | 146 | |
a25a0ef5 | 147 | obj-y = vl.o monitor.o pci.o loader.o isa_mmio.o machine.o \ |
7282a033 | 148 | gdbstub.o gdbstub-xml.o msix.o ioport.o qemu-config.o |
1fd31ad7 AL |
149 | # virtio has to be here due to weird dependency between PCI and virtio-net. |
150 | # need to fix this properly | |
3987e1cf | 151 | obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o virtio-pci.o |
a8e492c0 | 152 | obj-$(CONFIG_KVM) += kvm.o kvm-all.o |
a3392f9b | 153 | |
40293e58 | 154 | LIBS+=-lz |
4fb240a4 | 155 | |
b6271b48 JQ |
156 | sound-obj-y = |
157 | sound-obj-$(CONFIG_SB16) += sb16.o | |
158 | sound-obj-$(CONFIG_ES1370) += es1370.o | |
159 | sound-obj-$(CONFIG_AC97) += ac97.o | |
160 | sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o | |
161 | sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o | |
57a943c4 | 162 | sound-obj-$(CONFIG_CS4231A) += cs4231a.o |
b6271b48 | 163 | |
ed69c30d | 164 | adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0 |
85571bc7 | 165 | |
a558ee17 | 166 | QEMU_CFLAGS += $(VNC_TLS_CFLAGS) |
a558ee17 | 167 | QEMU_CFLAGS += $(VNC_SASL_CFLAGS) |
2f9606b3 | 168 | |
e37630ca | 169 | # xen backend driver support |
943e0a31 | 170 | obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o |
e37630ca | 171 | |
a594cfbf | 172 | # USB layer |
a8e492c0 | 173 | obj-y += usb-ohci.o |
a594cfbf | 174 | |
a41b2ff2 | 175 | # PCI network cards |
a8e492c0 JQ |
176 | obj-y += eepro100.o |
177 | obj-y += ne2000.o | |
178 | obj-y += pcnet.o | |
179 | obj-y += rtl8139.o | |
180 | obj-y += e1000.o | |
a41b2ff2 | 181 | |
9dd986cc | 182 | # Generic watchdog support and some watchdog devices |
a8e492c0 | 183 | obj-y += wdt_ib700.o wdt_i6300esb.o |
9dd986cc | 184 | |
a541f297 | 185 | # Hardware support |
f915a115 | 186 | obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o isa-bus.o |
9637443f JQ |
187 | obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
188 | obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o | |
189 | obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o | |
190 | obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o | |
191 | ||
3cbee15b | 192 | # shared objects |
f915a115 | 193 | obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o isa-bus.o openpic.o |
3cbee15b | 194 | # PREP target |
9637443f JQ |
195 | obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o |
196 | obj-ppc-y += prep_pci.o ppc_prep.o | |
3cbee15b | 197 | # Mac shared devices |
9637443f | 198 | obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o |
3cbee15b | 199 | # OldWorld PowerMac |
9637443f | 200 | obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o |
3cbee15b | 201 | # NewWorld PowerMac |
9637443f | 202 | obj-ppc-y += unin_pci.o ppc_newworld.o |
3cbee15b | 203 | # PowerPC 4xx boards |
9637443f JQ |
204 | obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o |
205 | obj-ppc-y += ppc440.o ppc440_bamboo.o | |
74c62ba8 | 206 | # PowerPC E500 boards |
9637443f JQ |
207 | obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o |
208 | obj-ppc-$(CONFIG_KVM) += kvm_ppc.o | |
3f0855b1 | 209 | obj-ppc-$(CONFIG_FDT) += device_tree.o |
9637443f JQ |
210 | |
211 | obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o | |
212 | obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o | |
213 | obj-mips-y += g364fb.o jazz_led.o dp8393x.o | |
214 | obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o | |
f915a115 | 215 | obj-mips-y += piix_pci.o parallel.o cirrus_vga.o isa-bus.o pcspk.o $(sound-obj-y) |
9637443f JQ |
216 | obj-mips-y += mipsnet.o |
217 | obj-mips-y += pflash_cfi01.o | |
218 | obj-mips-y += vmware_vga.o | |
219 | ||
9637443f JQ |
220 | obj-microblaze-y = petalogix_s3adsp1800_mmu.o |
221 | ||
222 | obj-microblaze-y += microblaze_pic_cpu.o | |
223 | obj-microblaze-y += xilinx_intc.o | |
224 | obj-microblaze-y += xilinx_timer.o | |
225 | obj-microblaze-y += xilinx_uartlite.o | |
226 | obj-microblaze-y += xilinx_ethlite.o | |
227 | ||
228 | obj-microblaze-y += pflash_cfi02.o | |
72b675ca | 229 | |
3f0855b1 | 230 | obj-microblaze-$(CONFIG_FDT) += device_tree.o |
9637443f | 231 | |
10c144e2 | 232 | # Boards |
9637443f | 233 | obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o |
10c144e2 EI |
234 | |
235 | # IO blocks | |
9637443f JQ |
236 | obj-cris-y += etraxfs_dma.o |
237 | obj-cris-y += etraxfs_pic.o | |
238 | obj-cris-y += etraxfs_eth.o | |
239 | obj-cris-y += etraxfs_timer.o | |
240 | obj-cris-y += etraxfs_ser.o | |
241 | ||
242 | obj-cris-y += pflash_cfi02.o | |
e62b5b13 | 243 | |
3475187d | 244 | ifeq ($(TARGET_ARCH), sparc64) |
f915a115 | 245 | obj-sparc-y = sun4u.o ide.o isa-bus.o pckbd.o vga.o apb_pci.o |
9637443f JQ |
246 | obj-sparc-y += fdc.o mc146818rtc.o serial.o |
247 | obj-sparc-y += cirrus_vga.o parallel.o | |
3475187d | 248 | else |
9637443f | 249 | obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o |
f915a115 | 250 | obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o isa-bus.o sparc32_dma.o |
9637443f JQ |
251 | obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o |
252 | endif | |
253 | ||
254 | obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o | |
255 | obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o | |
256 | obj-arm-y += versatile_pci.o | |
257 | obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o | |
258 | obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o | |
259 | obj-arm-y += pl061.o | |
260 | obj-arm-y += arm-semi.o | |
261 | obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o | |
262 | obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o | |
263 | obj-arm-y += pflash_cfi01.o gumstix.o | |
3a38d437 | 264 | obj-arm-y += zaurus.o ide.o isa-bus.o serial.o spitz.o tosa.o tc6393xb.o |
9637443f JQ |
265 | obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o |
266 | obj-arm-y += omap2.o omap_dss.o soc_dma.o | |
267 | obj-arm-y += omap_sx1.o palm.o tsc210x.o | |
268 | obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o | |
269 | obj-arm-y += mst_fpga.o mainstone.o | |
ef07b491 | 270 | obj-arm-y += musicpal.o pflash_cfi02.o bitbang_i2c.o marvell_88w8618_audio.o |
9637443f JQ |
271 | obj-arm-y += framebuffer.o |
272 | obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o | |
273 | obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o | |
274 | obj-arm-y += syborg_virtio.o | |
275 | ||
9637443f JQ |
276 | obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o |
277 | obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o | |
3a38d437 | 278 | obj-sh4-y += ide.o isa-bus.o |
9637443f JQ |
279 | |
280 | obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o | |
281 | obj-m68k-y += m68k-semi.o dummy_m68k.o | |
282 | ||
f622d8a3 | 283 | main.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) |
6e1b3e4d | 284 | |
a558ee17 | 285 | vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS) |
537fe2d6 | 286 | |
5824d651 BS |
287 | vl.o: qemu-options.h |
288 | ||
2313086a BS |
289 | monitor.o: qemu-monitor.h |
290 | ||
16394485 | 291 | ARLIBS=../libqemu_common.a libqemu.a $(HWLIB) |
626df76a | 292 | |
76dfdd24 | 293 | endif # CONFIG_SOFTMMU |
00a67ba1 | 294 | |
16394485 JQ |
295 | $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS) |
296 | $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)) | |
297 | ||
298 | ||
56aebc89 | 299 | gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh |
56aebc89 | 300 | ifeq ($(TARGET_XML_FILES),) |
1aef4c57 | 301 | $(call quiet-command,rm -f $@ && echo > $@," GEN $(TARGET_DIR)$@") |
56aebc89 | 302 | else |
1aef4c57 | 303 | $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") |
56aebc89 PB |
304 | endif |
305 | ||
5824d651 | 306 | qemu-options.h: $(SRC_PATH)/qemu-options.hx |
0d00e563 | 307 | $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
5824d651 | 308 | |
2313086a BS |
309 | qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx |
310 | $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") | |
311 | ||
626df76a | 312 | clean: |
2313086a | 313 | rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o |
57fec1fe | 314 | rm -f *.d */*.d tcg/*.o |
2313086a | 315 | rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c |
1e43adfc | 316 | |
5fafdf24 | 317 | install: all |
9b14bb04 | 318 | ifneq ($(PROGS),) |
1625af87 | 319 | $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)" |
9b14bb04 | 320 | endif |
626df76a | 321 | |
2f96c28d JM |
322 | # Include automatically generated dependency files |
323 | -include $(wildcard *.d */*.d) |