move cc-option definition to rules.mak
[qemu.git] / Makefile.target
blobdbb2263fa6a7f936e7704c52dd92a58150105b95
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=
10 ifdef CONFIG_USER_ONLY
11 # user emulator name
12 QEMU_PROG=qemu-$(TARGET_ARCH2)
13 else
14 # system emulator name
15 ifeq ($(TARGET_ARCH), i386)
16 QEMU_PROG=qemu$(EXESUF)
17 else
18 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
19 endif
20 endif
22 PROGS=$(QEMU_PROG)
24 HELPER_CFLAGS=
26 ifeq ($(ARCH),i386)
27 HELPER_CFLAGS+=-fomit-frame-pointer
28 endif
30 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
31 translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
32 endif
34 ifeq ($(ARCH),sparc)
35   ifneq ($(CONFIG_SOLARIS),y)
36     HELPER_CFLAGS+=-ffixed-i0
37   endif
38 endif
40 ifeq ($(ARCH),alpha)
41 # Ensure there's only a single GP
42 CFLAGS+=-msmall-data
43 endif
45 ifeq ($(ARCH),ia64)
46 CFLAGS+=-mno-sdata
47 endif
49 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
50 CPPFLAGS+=-U_FORTIFY_SOURCE
51 LIBS+=-lm
52 ifdef CONFIG_WIN32
53 LIBS+=-lwinmm -lws2_32 -liphlpapi
54 endif
55 ifdef CONFIG_SOLARIS
56 LIBS+=-lsocket -lnsl -lresolv
57 ifdef CONFIG_NEEDS_LIBSUNMATH
58 LIBS+=-lsunmath
59 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
60 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
61 endif
62 endif
64 kvm.o: CFLAGS+=$(KVM_CFLAGS)
65 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
67 all: $(PROGS)
68 # Dummy command so that make thinks it has done something
69         @true
71 #########################################################
72 # cpu emulator library
73 libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
74 libobj-$(CONFIG_KQEMU) += kqemu.o
75 # TCG code generator
76 libobj-y += tcg/tcg.o tcg/tcg-runtime.o
77 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
78 ifeq ($(ARCH),sparc64)
79 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
80 endif
81 ifdef CONFIG_SOFTFLOAT
82 libobj-y += fpu/softfloat.o
83 else
84 libobj-y += fpu/softfloat-native.o
85 endif
86 CPPFLAGS+=-I$(SRC_PATH)/fpu
87 libobj-y += op_helper.o helper.o
89 ifeq ($(TARGET_BASE_ARCH), arm)
90 libobj-y += neon_helper.o iwmmxt_helper.o
91 endif
93 ifeq ($(TARGET_BASE_ARCH), alpha)
94 libobj-y += alpha_palcode.o
95 endif
97 ifeq ($(TARGET_BASE_ARCH), cris)
98 libobj-y += cris-dis.o
100 ifndef CONFIG_USER_ONLY
101 libobj-y += mmu.o
102 endif
103 endif
105 # NOTE: the disassembler code is only needed for debugging
106 libobj-y += disas.o
107 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
108 USE_I386_DIS=y
109 endif
110 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
111 USE_I386_DIS=y
112 endif
113 libobj-$(USE_I386_DIS) += i386-dis.o
114 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
115 libobj-y += alpha-dis.o
116 endif
117 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
118 libobj-y += ppc-dis.o
119 endif
120 ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
121 libobj-y += microblaze-dis.o
122 ifndef CONFIG_USER_ONLY
123 libobj-y += mmu.o
124 endif
125 endif
126 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
127 libobj-y += mips-dis.o
128 endif
129 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
130 libobj-y += sparc-dis.o
131 endif
132 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
133 libobj-y += arm-dis.o
134 endif
135 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
136 libobj-y += m68k-dis.o
137 endif
138 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
139 libobj-y += sh4-dis.o
140 endif
141 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
142 libobj-y += hppa-dis.o
143 endif
144 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
145 libobj-y += s390-dis.o
146 endif
148 # libqemu
150 libqemu.a: $(libobj-y)
152 translate.o: translate.c cpu.h
154 translate-all.o: translate-all.c cpu.h
156 tcg/tcg.o: cpu.h
158 # HELPER_CFLAGS is used for all the code compiled with static register
159 # variables
160 op_helper.o: CFLAGS += $(HELPER_CFLAGS)
162 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
164 #########################################################
165 # Linux user emulator target
167 ifdef CONFIG_LINUX_USER
169 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
170 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
172 ifeq ($(ARCH),i386)
173 ifdef TARGET_GPROF
174 USE_I386_LD=y
175 endif
176 ifdef CONFIG_STATIC
177 USE_I386_LD=y
178 endif
179 ifdef USE_I386_LD
180 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
181 else
182 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
183 # that the kernel ELF loader considers as an executable. I think this
184 # is the simplest way to make it self virtualizable!
185 LDFLAGS+=-Wl,-shared
186 endif
187 endif
189 ifeq ($(ARCH),x86_64)
190 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
191 endif
193 ifeq ($(ARCH),ppc)
194 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
195 endif
197 ifeq ($(ARCH),ppc64)
198 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
199 endif
201 ifeq ($(ARCH),s390)
202 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
203 endif
205 ifeq ($(ARCH),sparc)
206 # -static is used to avoid g1/g3 usage by the dynamic linker    
207 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
208 endif
210 ifeq ($(ARCH),sparc64)
211 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
212 endif
214 ifeq ($(ARCH),alpha)
215 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
216 endif
218 ifeq ($(ARCH),ia64)
219 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
220 endif
222 ifeq ($(ARCH),arm)
223 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
224 endif
226 ifeq ($(ARCH),m68k)
227 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
228 endif
230 ifeq ($(ARCH),mips)
231 ifeq ($(HOST_WORDS_BIGENDIAN),y)
232 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
233 else
234 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
235 endif
236 endif
238 ifeq ($(ARCH),mips64)
239 ifeq ($(HOST_WORDS_BIGENDIAN),y)
240 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
241 else
242 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
243 endif
244 endif
246 # profiling code
247 ifdef TARGET_GPROF
248 LDFLAGS+=-p
249 CFLAGS+=-p
250 endif
252 obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
253       elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
254       ioport-user.o
255 obj-$(TARGET_HAS_BFLT) += flatload.o
257 ifdef TARGET_HAS_ELFLOAD32
258 elfload32.o: elfload.c
259 endif
260 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
262 ifeq ($(TARGET_ARCH), i386)
263 obj-y += vm86.o
264 endif
266 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
267 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
268 obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
269 obj-arm-y += arm-semi.o
271 obj-m68k-y += m68k-sim.o m68k-semi.o
273 # Note: this is a workaround. The real fix is to avoid compiling
274 # cpu_signal_handler() in cpu-exec.c.
275 signal.o: CFLAGS += $(HELPER_CFLAGS)
277 ARLIBS=../libqemu_user.a libqemu.a
278 endif #CONFIG_LINUX_USER
280 LIBS+= $(PTHREADLIBS)
281 LIBS+= $(CLOCKLIBS)
283 #########################################################
284 # Darwin user emulator target
286 ifdef CONFIG_DARWIN_USER
288 VPATH+=:$(SRC_PATH)/darwin-user
289 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
291 # Leave some space for the regular program loading zone
292 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
294 LIBS+=-lmx
296 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
297         gdbstub.o gdbstub-xml.o ioport-user.o
299 # Note: this is a workaround. The real fix is to avoid compiling
300 # cpu_signal_handler() in cpu-exec.c.
301 signal.o: CFLAGS += $(HELPER_CFLAGS)
303 ARLIBS=libqemu.a
305 endif #CONFIG_DARWIN_USER
307 #########################################################
308 # BSD user emulator target
310 ifdef CONFIG_BSD_USER
312 VPATH+=:$(SRC_PATH)/bsd-user
313 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
315 ifeq ($(ARCH),i386)
316 ifdef TARGET_GPROF
317 USE_I386_LD=y
318 endif
319 ifdef CONFIG_STATIC
320 USE_I386_LD=y
321 endif
322 ifdef USE_I386_LD
323 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
324 else
325 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
326 # that the kernel ELF loader considers as an executable. I think this
327 # is the simplest way to make it self virtualizable!
328 LDFLAGS+=-Wl,-shared
329 endif
330 endif
332 ifeq ($(ARCH),x86_64)
333 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
334 endif
336 ifeq ($(ARCH),ppc)
337 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
338 endif
340 ifeq ($(ARCH),ppc64)
341 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
342 endif
344 ifeq ($(ARCH),s390)
345 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
346 endif
348 ifeq ($(ARCH),sparc)
349 # -static is used to avoid g1/g3 usage by the dynamic linker
350 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
351 endif
353 ifeq ($(ARCH),sparc64)
354 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
355 endif
357 ifeq ($(ARCH),alpha)
358 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
359 endif
361 ifeq ($(ARCH),ia64)
362 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
363 endif
365 ifeq ($(ARCH),arm)
366 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
367 endif
369 ifeq ($(ARCH),m68k)
370 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
371 endif
373 ifeq ($(ARCH),mips)
374 ifeq ($(HOST_WORDS_BIGENDIAN),y)
375 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
376 else
377 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
378 endif
379 endif
381 ifeq ($(ARCH),mips64)
382 ifeq ($(HOST_WORDS_BIGENDIAN),y)
383 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
384 else
385 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
386 endif
387 endif
389 obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
390         gdbstub.o gdbstub-xml.o ioport-user.o
391 obj-y += uaccess.o
393 # Note: this is a workaround. The real fix is to avoid compiling
394 # cpu_signal_handler() in cpu-exec.c.
395 signal.o: CFLAGS += $(HELPER_CFLAGS)
397 ARLIBS=libqemu.a ../libqemu_user.a
399 endif #CONFIG_BSD_USER
401 #########################################################
402 # System emulator target
403 ifndef CONFIG_USER_ONLY
405 obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
406         gdbstub.o gdbstub-xml.o msix.o ioport.o
407 # virtio has to be here due to weird dependency between PCI and virtio-net.
408 # need to fix this properly
409 obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
410 obj-$(CONFIG_KVM) += kvm.o kvm-all.o
412 LIBS+=-lz
413 ifdef CONFIG_ALSA
414 LIBS += -lasound
415 endif
416 ifdef CONFIG_ESD
417 LIBS += -lesd
418 endif
419 ifdef CONFIG_PA
420 LIBS += -lpulse-simple
421 endif
422 ifdef CONFIG_DSOUND
423 LIBS += -lole32 -ldxguid
424 endif
425 ifdef CONFIG_FMOD
426 LIBS += $(FMOD_LIBS)
427 endif
428 ifdef CONFIG_OSS
429 LIBS += $(OSS_LIBS)
430 endif
432 sound-obj-y =
433 sound-obj-$(CONFIG_SB16) += sb16.o
434 sound-obj-$(CONFIG_ES1370) += es1370.o
435 sound-obj-$(CONFIG_AC97) += ac97.o
436 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
437 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
438 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
440 ifdef CONFIG_ADLIB
441 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
442 endif
444 ifdef CONFIG_VNC_TLS
445 CPPFLAGS += $(VNC_TLS_CFLAGS)
446 LIBS += $(VNC_TLS_LIBS)
447 endif
449 ifdef CONFIG_VNC_SASL
450 CPPFLAGS += $(VNC_SASL_CFLAGS)
451 LIBS += $(VNC_SASL_LIBS)
452 endif
454 ifdef CONFIG_BLUEZ
455 LIBS += $(BLUEZ_LIBS)
456 endif
458 # xen backend driver support
459 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
460 ifeq ($(CONFIG_XEN), y)
461   LIBS += $(XEN_LIBS)
462 endif
464 # USB layer
465 obj-y += usb-ohci.o
467 # PCI network cards
468 obj-y += eepro100.o
469 obj-y += ne2000.o
470 obj-y += pcnet.o
471 obj-y += rtl8139.o
472 obj-y += e1000.o
474 # Generic watchdog support and some watchdog devices
475 obj-y += wdt_ib700.o wdt_i6300esb.o
477 # Hardware support
478 obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
479 obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
480 obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
481 obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
482 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
484 ifeq ($(TARGET_BASE_ARCH), i386)
485 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
486 endif
488 # shared objects
489 obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
490 # PREP target
491 obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
492 obj-ppc-y += prep_pci.o ppc_prep.o
493 # Mac shared devices
494 obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
495 # OldWorld PowerMac
496 obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
497 # NewWorld PowerMac
498 obj-ppc-y += unin_pci.o ppc_newworld.o
499 # PowerPC 4xx boards
500 obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
501 obj-ppc-y += ppc440.o ppc440_bamboo.o
502 # PowerPC E500 boards
503 obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
504 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
506 ifeq ($(TARGET_BASE_ARCH), ppc)
507 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
508 endif
510 obj-ppc-$(CONFIG_FDT) += device_tree.o
511 LIBS+= $(FDT_LIBS)
513 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
514 obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
515 obj-mips-y += g364fb.o jazz_led.o dp8393x.o
516 obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
517 obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
518 obj-mips-y += mipsnet.o
519 obj-mips-y += pflash_cfi01.o
520 obj-mips-y += vmware_vga.o
522 ifeq ($(TARGET_BASE_ARCH), mips)
523 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
524 endif
526 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
528 obj-microblaze-y += microblaze_pic_cpu.o
529 obj-microblaze-y += xilinx_intc.o
530 obj-microblaze-y += xilinx_timer.o
531 obj-microblaze-y += xilinx_uartlite.o
532 obj-microblaze-y += xilinx_ethlite.o
534 obj-microblaze-y += pflash_cfi02.o
536 obj-microblaze-$(CONFIG_FDT) += device_tree.o
537 LIBS+= $(FDT_LIBS)
539 # Boards
540 obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
542 # IO blocks
543 obj-cris-y += etraxfs_dma.o
544 obj-cris-y += etraxfs_pic.o
545 obj-cris-y += etraxfs_eth.o
546 obj-cris-y += etraxfs_timer.o
547 obj-cris-y += etraxfs_ser.o
549 obj-cris-y += pflash_cfi02.o
551 ifeq ($(TARGET_ARCH), sparc64)
552 obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
553 obj-sparc-y += fdc.o mc146818rtc.o serial.o
554 obj-sparc-y += cirrus_vga.o parallel.o
555 else
556 obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
557 obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
558 obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
559 endif
561 obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
562 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
563 obj-arm-y += versatile_pci.o
564 obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
565 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
566 obj-arm-y += pl061.o
567 obj-arm-y += arm-semi.o
568 obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
569 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
570 obj-arm-y += pflash_cfi01.o gumstix.o
571 obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
572 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
573 obj-arm-y += omap2.o omap_dss.o soc_dma.o
574 obj-arm-y += omap_sx1.o palm.o tsc210x.o
575 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
576 obj-arm-y += mst_fpga.o mainstone.o
577 obj-arm-y += musicpal.o pflash_cfi02.o
578 obj-arm-y += framebuffer.o
579 obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
580 obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
581 obj-arm-y += syborg_virtio.o
583 ifeq ($(TARGET_BASE_ARCH), arm)
584 CPPFLAGS += -DHAS_AUDIO
585 endif
587 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
588 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
589 obj-sh4-y += ide.o
591 obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
592 obj-m68k-y += m68k-semi.o dummy_m68k.o
594 ifdef CONFIG_COCOA
595 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
596 ifdef CONFIG_COREAUDIO
597 COCOA_LIBS+=-framework CoreAudio
598 endif
599 endif
600 ifdef CONFIG_SLIRP
601 CPPFLAGS+=-I$(SRC_PATH)/slirp
602 endif
604 # specific flags are needed for non soft mmu emulator
605 ifndef CONFIG_DARWIN
606 ifndef CONFIG_WIN32
607 ifndef CONFIG_SOLARIS
608 ifndef CONFIG_AIX
609 LIBS+=-lutil
610 endif
611 endif
612 endif
613 endif
614 ifdef TARGET_GPROF
615 vl.o: CFLAGS+=-p
616 LDFLAGS+=-p
617 endif
619 ifeq ($(ARCH),ia64)
620 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
621 endif
623 ifdef CONFIG_WIN32
624 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
625 endif
627 # profiling code
628 ifdef TARGET_GPROF
629 LDFLAGS+=-p
630 main.o: CFLAGS+=-p
631 endif
633 vl.o: CFLAGS+=$(SDL_CFLAGS)
635 vl.o: qemu-options.h
637 monitor.o: qemu-monitor.h
639 LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
640 ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
642 endif # !CONFIG_USER_ONLY
644 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
645         $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
648 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
649 ifeq ($(TARGET_XML_FILES),)
650         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
651 else
652         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
653 endif
655 qemu-options.h: $(SRC_PATH)/qemu-options.hx
656         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
658 qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
659         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
661 clean:
662         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
663         rm -f *.d */*.d tcg/*.o
664         rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
666 install: all
667 ifneq ($(PROGS),)
668         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
669 endif
671 # Include automatically generated dependency files
672 -include $(wildcard *.d */*.d)