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