simplify TARGET_BASE_ARCH generation
[qemu/aliguori-queue.git] / Makefile.target
blob7e69a644ae1ac0f2dccee042b95e9a490ee663c3
1 include config.mak
2 include $(SRC_PATH)/rules.mak
4 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
5 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
6 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
7 #CFLAGS+=-Werror
8 LIBS=
9 # user emulator name
10 ifndef TARGET_ARCH2
11 TARGET_ARCH2=$(TARGET_ARCH)
12 endif
14 ifdef CONFIG_USER_ONLY
15 # user emulator name
16 QEMU_PROG=qemu-$(TARGET_ARCH2)
17 else
18 # system emulator name
19 ifeq ($(TARGET_ARCH), i386)
20 QEMU_PROG=qemu$(EXESUF)
21 else
22 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
23 endif
24 endif
26 PROGS=$(QEMU_PROG)
28 # cc-option
29 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
31 cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
32               > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
34 HELPER_CFLAGS=
36 ifeq ($(ARCH),i386)
37 HELPER_CFLAGS+=-fomit-frame-pointer
38 endif
40 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
41 translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
42 endif
44 ifeq ($(ARCH),sparc)
45   ifneq ($(CONFIG_SOLARIS),y)
46     HELPER_CFLAGS+=-ffixed-i0
47   endif
48 endif
50 ifeq ($(ARCH),alpha)
51 # Ensure there's only a single GP
52 CFLAGS+=-msmall-data
53 endif
55 ifeq ($(ARCH),ia64)
56 CFLAGS+=-mno-sdata
57 endif
59 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
60 CPPFLAGS+=-U_FORTIFY_SOURCE
61 LIBS+=-lm
62 ifdef CONFIG_WIN32
63 LIBS+=-lwinmm -lws2_32 -liphlpapi
64 endif
65 ifdef CONFIG_SOLARIS
66 LIBS+=-lsocket -lnsl -lresolv
67 ifdef NEEDS_LIBSUNMATH
68 LIBS+=-lsunmath
69 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
70 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
71 endif
72 endif
74 kvm.o: CFLAGS+=$(KVM_CFLAGS)
75 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
77 all: $(PROGS)
78 # Dummy command so that make thinks it has done something
79         @true
81 #########################################################
82 # cpu emulator library
83 libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
84 libobj-$(CONFIG_KQEMU) += kqemu.o
85 # TCG code generator
86 libobj-y += tcg/tcg.o tcg/tcg-runtime.o
87 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
88 ifeq ($(ARCH),sparc64)
89 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
90 endif
91 ifdef CONFIG_SOFTFLOAT
92 libobj-y += fpu/softfloat.o
93 else
94 libobj-y += fpu/softfloat-native.o
95 endif
96 CPPFLAGS+=-I$(SRC_PATH)/fpu
97 libobj-y += op_helper.o helper.o
99 ifeq ($(TARGET_BASE_ARCH), arm)
100 libobj-y += neon_helper.o iwmmxt_helper.o
101 endif
103 ifeq ($(TARGET_BASE_ARCH), alpha)
104 libobj-y += alpha_palcode.o
105 endif
107 ifeq ($(TARGET_BASE_ARCH), cris)
108 libobj-y += cris-dis.o
110 ifndef CONFIG_USER_ONLY
111 libobj-y += mmu.o
112 endif
113 endif
115 # NOTE: the disassembler code is only needed for debugging
116 libobj-y += disas.o
117 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
118 USE_I386_DIS=y
119 endif
120 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
121 USE_I386_DIS=y
122 endif
123 libobj-$(USE_I386_DIS) += i386-dis.o
124 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
125 libobj-y += alpha-dis.o
126 endif
127 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
128 libobj-y += ppc-dis.o
129 endif
130 ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
131 libobj-y += microblaze-dis.o
132 ifndef CONFIG_USER_ONLY
133 libobj-y += mmu.o
134 endif
135 endif
136 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
137 libobj-y += mips-dis.o
138 endif
139 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
140 libobj-y += sparc-dis.o
141 endif
142 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
143 libobj-y += arm-dis.o
144 endif
145 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
146 libobj-y += m68k-dis.o
147 endif
148 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
149 libobj-y += sh4-dis.o
150 endif
151 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
152 libobj-y += hppa-dis.o
153 endif
154 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
155 libobj-y += s390-dis.o
156 endif
158 # libqemu
160 libqemu.a: $(libobj-y)
162 translate.o: translate.c cpu.h
164 translate-all.o: translate-all.c cpu.h
166 tcg/tcg.o: cpu.h
168 # HELPER_CFLAGS is used for all the code compiled with static register
169 # variables
170 op_helper.o: CFLAGS += $(HELPER_CFLAGS)
172 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
174 #########################################################
175 # Linux user emulator target
177 ifdef CONFIG_LINUX_USER
179 ifndef TARGET_ABI_DIR
180   TARGET_ABI_DIR=$(TARGET_ARCH)
181 endif
182 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
183 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
185 ifdef CONFIG_STATIC
186 LDFLAGS+=-static
187 endif
189 ifeq ($(ARCH),i386)
190 ifdef TARGET_GPROF
191 USE_I386_LD=y
192 endif
193 ifdef CONFIG_STATIC
194 USE_I386_LD=y
195 endif
196 ifdef USE_I386_LD
197 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
198 else
199 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
200 # that the kernel ELF loader considers as an executable. I think this
201 # is the simplest way to make it self virtualizable!
202 LDFLAGS+=-Wl,-shared
203 endif
204 endif
206 ifeq ($(ARCH),x86_64)
207 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
208 endif
210 ifeq ($(ARCH),ppc)
211 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
212 endif
214 ifeq ($(ARCH),ppc64)
215 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
216 endif
218 ifeq ($(ARCH),s390)
219 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
220 endif
222 ifeq ($(ARCH),sparc)
223 # -static is used to avoid g1/g3 usage by the dynamic linker    
224 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
225 endif
227 ifeq ($(ARCH),sparc64)
228 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
229 endif
231 ifeq ($(ARCH),alpha)
232 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
233 endif
235 ifeq ($(ARCH),ia64)
236 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
237 endif
239 ifeq ($(ARCH),arm)
240 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
241 endif
243 ifeq ($(ARCH),m68k)
244 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
245 endif
247 ifeq ($(ARCH),mips)
248 ifeq ($(WORDS_BIGENDIAN),yes)
249 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
250 else
251 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
252 endif
253 endif
255 ifeq ($(ARCH),mips64)
256 ifeq ($(WORDS_BIGENDIAN),yes)
257 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
258 else
259 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
260 endif
261 endif
263 # profiling code
264 ifdef TARGET_GPROF
265 LDFLAGS+=-p
266 CFLAGS+=-p
267 endif
269 obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
270       elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
271       ioport-user.o
272 LIBS+= $(PTHREADLIBS)
273 LIBS+= $(CLOCKLIBS)
274 obj-$(TARGET_HAS_BFLT) += flatload.o
276 ifdef TARGET_HAS_ELFLOAD32
277 elfload32.o: elfload.c
278 endif
279 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
281 ifeq ($(TARGET_ARCH), i386)
282 obj-y += vm86.o
283 endif
285 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
286 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
287 obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
288 obj-arm-y += arm-semi.o
290 obj-m68k-y += m68k-sim.o m68k-semi.o
292 # Note: this is a workaround. The real fix is to avoid compiling
293 # cpu_signal_handler() in cpu-exec.c.
294 signal.o: CFLAGS += $(HELPER_CFLAGS)
296 ARLIBS=../libqemu_user.a libqemu.a
297 endif #CONFIG_LINUX_USER
299 #########################################################
300 # Darwin user emulator target
302 ifdef CONFIG_DARWIN_USER
304 VPATH+=:$(SRC_PATH)/darwin-user
305 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
307 # Leave some space for the regular program loading zone
308 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
310 LIBS+=-lmx
312 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
313         gdbstub.o gdbstub-xml.o ioport-user.o
315 # Note: this is a workaround. The real fix is to avoid compiling
316 # cpu_signal_handler() in cpu-exec.c.
317 signal.o: CFLAGS += $(HELPER_CFLAGS)
319 ARLIBS=libqemu.a
321 endif #CONFIG_DARWIN_USER
323 #########################################################
324 # BSD user emulator target
326 ifdef CONFIG_BSD_USER
328 VPATH+=:$(SRC_PATH)/bsd-user
329 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
331 ifdef CONFIG_STATIC
332 LDFLAGS+=-static
333 endif
335 ifeq ($(ARCH),i386)
336 ifdef TARGET_GPROF
337 USE_I386_LD=y
338 endif
339 ifdef CONFIG_STATIC
340 USE_I386_LD=y
341 endif
342 ifdef USE_I386_LD
343 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
344 else
345 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
346 # that the kernel ELF loader considers as an executable. I think this
347 # is the simplest way to make it self virtualizable!
348 LDFLAGS+=-Wl,-shared
349 endif
350 endif
352 ifeq ($(ARCH),x86_64)
353 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
354 endif
356 ifeq ($(ARCH),ppc)
357 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
358 endif
360 ifeq ($(ARCH),ppc64)
361 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
362 endif
364 ifeq ($(ARCH),s390)
365 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
366 endif
368 ifeq ($(ARCH),sparc)
369 # -static is used to avoid g1/g3 usage by the dynamic linker
370 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
371 endif
373 ifeq ($(ARCH),sparc64)
374 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
375 endif
377 ifeq ($(ARCH),alpha)
378 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
379 endif
381 ifeq ($(ARCH),ia64)
382 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
383 endif
385 ifeq ($(ARCH),arm)
386 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
387 endif
389 ifeq ($(ARCH),m68k)
390 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
391 endif
393 ifeq ($(ARCH),mips)
394 ifeq ($(WORDS_BIGENDIAN),yes)
395 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
396 else
397 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
398 endif
399 endif
401 ifeq ($(ARCH),mips64)
402 ifeq ($(WORDS_BIGENDIAN),yes)
403 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
404 else
405 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
406 endif
407 endif
409 obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
410         gdbstub.o gdbstub-xml.o ioport-user.o
411 obj-y += uaccess.o
413 # Note: this is a workaround. The real fix is to avoid compiling
414 # cpu_signal_handler() in cpu-exec.c.
415 signal.o: CFLAGS += $(HELPER_CFLAGS)
417 ARLIBS=libqemu.a ../libqemu_user.a
419 endif #CONFIG_BSD_USER
421 #########################################################
422 # System emulator target
423 ifndef CONFIG_USER_ONLY
425 obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
426         gdbstub.o gdbstub-xml.o msix.o ioport.o
427 # virtio has to be here due to weird dependency between PCI and virtio-net.
428 # need to fix this properly
429 obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
430 obj-$(CONFIG_KVM) += kvm.o kvm-all.o
432 LIBS+=-lz
433 ifdef CONFIG_ALSA
434 LIBS += -lasound
435 endif
436 ifdef CONFIG_ESD
437 LIBS += -lesd
438 endif
439 ifdef CONFIG_PA
440 LIBS += -lpulse-simple
441 endif
442 ifdef CONFIG_DSOUND
443 LIBS += -lole32 -ldxguid
444 endif
445 ifdef CONFIG_FMOD
446 LIBS += $(CONFIG_FMOD_LIB)
447 endif
448 ifdef CONFIG_OSS
449 LIBS += $(CONFIG_OSS_LIB)
450 endif
452 sound-obj-y =
453 sound-obj-$(CONFIG_SB16) += sb16.o
454 sound-obj-$(CONFIG_ES1370) += es1370.o
455 sound-obj-$(CONFIG_AC97) += ac97.o
456 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
457 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
458 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
460 ifdef CONFIG_ADLIB
461 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
462 endif
464 ifdef CONFIG_VNC_TLS
465 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
466 LIBS += $(CONFIG_VNC_TLS_LIBS)
467 endif
469 ifdef CONFIG_VNC_SASL
470 CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
471 LIBS += $(CONFIG_VNC_SASL_LIBS)
472 endif
474 ifdef CONFIG_BLUEZ
475 LIBS += $(CONFIG_BLUEZ_LIBS)
476 endif
478 # xen backend driver support
479 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
480 ifeq ($(CONFIG_XEN), y)
481   LIBS += $(XEN_LIBS)
482 endif
484 # USB layer
485 obj-y += usb-ohci.o
487 # PCI network cards
488 obj-y += eepro100.o
489 obj-y += ne2000.o
490 obj-y += pcnet.o
491 obj-y += rtl8139.o
492 obj-y += e1000.o
494 # Generic watchdog support and some watchdog devices
495 obj-y += wdt_ib700.o wdt_i6300esb.o
497 # Hardware support
498 obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
499 obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
500 obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
501 obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
502 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
504 ifeq ($(TARGET_BASE_ARCH), i386)
505 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
506 endif
508 # shared objects
509 obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
510 # PREP target
511 obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
512 obj-ppc-y += prep_pci.o ppc_prep.o
513 # Mac shared devices
514 obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
515 # OldWorld PowerMac
516 obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
517 # NewWorld PowerMac
518 obj-ppc-y += unin_pci.o ppc_newworld.o
519 # PowerPC 4xx boards
520 obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
521 obj-ppc-y += ppc440.o ppc440_bamboo.o
522 # PowerPC E500 boards
523 obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
524 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
526 ifeq ($(TARGET_BASE_ARCH), ppc)
527 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
528 endif
530 ifdef FDT_LIBS
531 obj-ppc-y += device_tree.o
532 LIBS+= $(FDT_LIBS)
533 endif
535 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
536 obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
537 obj-mips-y += g364fb.o jazz_led.o dp8393x.o
538 obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
539 obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
540 obj-mips-y += mipsnet.o
541 obj-mips-y += pflash_cfi01.o
542 obj-mips-y += vmware_vga.o
544 ifeq ($(TARGET_BASE_ARCH), mips)
545 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
546 endif
548 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
550 obj-microblaze-y += microblaze_pic_cpu.o
551 obj-microblaze-y += xilinx_intc.o
552 obj-microblaze-y += xilinx_timer.o
553 obj-microblaze-y += xilinx_uartlite.o
554 obj-microblaze-y += xilinx_ethlite.o
556 obj-microblaze-y += pflash_cfi02.o
558 ifdef FDT_LIBS
559 obj-microblaze-y += device_tree.o
560 LIBS+= $(FDT_LIBS)
561 endif
563 # Boards
564 obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
566 # IO blocks
567 obj-cris-y += etraxfs_dma.o
568 obj-cris-y += etraxfs_pic.o
569 obj-cris-y += etraxfs_eth.o
570 obj-cris-y += etraxfs_timer.o
571 obj-cris-y += etraxfs_ser.o
573 obj-cris-y += pflash_cfi02.o
575 ifeq ($(TARGET_ARCH), sparc64)
576 obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
577 obj-sparc-y += fdc.o mc146818rtc.o serial.o
578 obj-sparc-y += cirrus_vga.o parallel.o
579 else
580 obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
581 obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
582 obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
583 endif
585 obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
586 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
587 obj-arm-y += versatile_pci.o
588 obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
589 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
590 obj-arm-y += pl061.o
591 obj-arm-y += arm-semi.o
592 obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
593 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
594 obj-arm-y += pflash_cfi01.o gumstix.o
595 obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
596 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
597 obj-arm-y += omap2.o omap_dss.o soc_dma.o
598 obj-arm-y += omap_sx1.o palm.o tsc210x.o
599 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
600 obj-arm-y += mst_fpga.o mainstone.o
601 obj-arm-y += musicpal.o pflash_cfi02.o
602 obj-arm-y += framebuffer.o
603 obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
604 obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
605 obj-arm-y += syborg_virtio.o
607 ifeq ($(TARGET_BASE_ARCH), arm)
608 CPPFLAGS += -DHAS_AUDIO
609 endif
611 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
612 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
613 obj-sh4-y += ide.o
615 obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
616 obj-m68k-y += m68k-semi.o dummy_m68k.o
618 ifdef CONFIG_COCOA
619 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
620 ifdef CONFIG_COREAUDIO
621 COCOA_LIBS+=-framework CoreAudio
622 endif
623 endif
624 ifdef CONFIG_SLIRP
625 CPPFLAGS+=-I$(SRC_PATH)/slirp
626 endif
628 # specific flags are needed for non soft mmu emulator
629 ifdef CONFIG_STATIC
630 LDFLAGS+=-static
631 endif
632 ifndef CONFIG_DARWIN
633 ifndef CONFIG_WIN32
634 ifndef CONFIG_SOLARIS
635 ifndef CONFIG_AIX
636 LIBS+=-lutil
637 endif
638 endif
639 endif
640 endif
641 ifdef TARGET_GPROF
642 vl.o: CFLAGS+=-p
643 LDFLAGS+=-p
644 endif
646 ifeq ($(ARCH),ia64)
647 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
648 endif
650 ifdef CONFIG_WIN32
651 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
652 endif
654 # profiling code
655 ifdef TARGET_GPROF
656 LDFLAGS+=-p
657 main.o: CFLAGS+=-p
658 endif
660 vl.o: CFLAGS+=$(SDL_CFLAGS)
662 vl.o: qemu-options.h
664 monitor.o: qemu-monitor.h
666 LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
667 ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
669 endif # !CONFIG_USER_ONLY
671 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
672         $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
675 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
676 ifeq ($(TARGET_XML_FILES),)
677         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
678 else
679         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
680 endif
682 qemu-options.h: $(SRC_PATH)/qemu-options.hx
683         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
685 qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
686         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
688 clean:
689         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
690         rm -f *.d */*.d tcg/*.o
691         rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
693 install: all
694 ifneq ($(PROGS),)
695         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
696 endif
698 # Include automatically generated dependency files
699 -include $(wildcard *.d */*.d)