Merge commit '9637443f852a3abb61c0c8f33c567ff87928e845' into upstream-merge
[qemu-kvm/fedora.git] / Makefile.target
blob5c925c1e5ae9222de4fabc5d865f3f3f489c80aa
1 CFLAGS=
2 LDFLAGS=
4 include config.mak
5 include $(SRC_PATH)/rules.mak
7 LDFLAGS_BASE:=$(LDFLAGS)
9 ifndef TARGET_BASE_ARCH
10 TARGET_BASE_ARCH:=$(TARGET_ARCH)
11 endif
13 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
14 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
15 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
16 #CFLAGS+=-Werror
17 LIBS=
18 # user emulator name
19 ifndef TARGET_ARCH2
20 TARGET_ARCH2=$(TARGET_ARCH)
21 endif
23 ifdef CONFIG_USER_ONLY
24 # user emulator name
25 QEMU_PROG=qemu-$(TARGET_ARCH2)
26 else
27 # system emulator name
28 ifeq ($(TARGET_ARCH), i386)
29 QEMU_PROG=qemu$(EXESUF)
30 else
31 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
32 endif
33 endif
35 PROGS=$(QEMU_PROG)
37 # cc-option
38 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
40 cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
41               > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
43 HELPER_CFLAGS=
45 ifeq ($(ARCH),i386)
46 HELPER_CFLAGS+=-fomit-frame-pointer
47 endif
49 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
50 translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
51 endif
53 ifeq ($(ARCH),sparc)
54   ifneq ($(CONFIG_SOLARIS),y)
55     HELPER_CFLAGS+=-ffixed-i0
56   endif
57 endif
59 ifeq ($(ARCH),alpha)
60 # Ensure there's only a single GP
61 CFLAGS+=-msmall-data
62 endif
64 ifeq ($(ARCH),hppa)
65 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
66 endif
68 ifeq ($(ARCH),ia64)
69 CFLAGS+=-mno-sdata
70 endif
72 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
73 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
75 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
76 CPPFLAGS+=-U_FORTIFY_SOURCE
77 CPPFLAGS+=-D__user=
78 LIBS+=-lm
79 ifdef CONFIG_WIN32
80 LIBS+=-lwinmm -lws2_32 -liphlpapi
81 endif
82 ifdef CONFIG_SOLARIS
83 LIBS+=-lsocket -lnsl -lresolv
84 ifdef NEEDS_LIBSUNMATH
85 LIBS+=-lsunmath
86 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
87 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
88 endif
89 endif
91 kvm.o: CFLAGS+=$(KVM_CFLAGS)
92 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
94 CFLAGS += $(KVM_CFLAGS)
96 all: $(PROGS)
97 # Dummy command so that make thinks it has done something
98         @true
100 #########################################################
101 # cpu emulator library
102 libobj-y = exec.o cpu-exec.o host-utils.o
103 ifeq ($(NO_CPU_EMULATION), 1)
104 libobj-y += fack-exec.o
105 else
106 libobj-y += translate-all.o translate.o 
107 endif
108 libobj-$(CONFIG_KQEMU) += kqemu.o
109 # TCG code generator
110 ifneq ($(NO_CPU_EMULATION), 1)
111 libobj-y += tcg/tcg.o tcg/tcg-runtime.o
112 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
113 endif
114 ifeq ($(ARCH),sparc64)
115 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
116 endif
118 ifdef CONFIG_SOFTFLOAT
119 libobj-y += fpu/softfloat.o
120 else
121 libobj-y += fpu/softfloat-native.o
122 endif
123 CPPFLAGS+=-I$(SRC_PATH)/fpu
124 libobj-y += op_helper.o helper.o
126 ifeq ($(TARGET_ARCH), i386)
127 libobj-y += helper.o
128 libobj-$(CONFIG_KVM) += kvm-tpr-opt.o
129 libobj-$(CONFIG_KVM) += qemu-kvm-helper.o
130 endif
132 ifeq ($(TARGET_ARCH), x86_64)
133 libobj-y += helper.o
134 libobj-$(CONFIG_KVM) += kvm-tpr-opt.o
135 libobj-$(CONFIG_KVM) += qemu-kvm-helper.o
136 endif
138 libobj-y += op_helper.o
140 ifneq ($(TARGET_ARCH), ia64)
141 libobj-y += helper.o
142 endif
144 ifeq ($(TARGET_BASE_ARCH), arm)
145 libobj-y += neon_helper.o iwmmxt_helper.o
146 endif
148 ifeq ($(TARGET_BASE_ARCH), alpha)
149 libobj-y += alpha_palcode.o
150 endif
152 ifeq ($(TARGET_BASE_ARCH), ia64)
153 libobj-y += op_helper.o firmware.o
154 libobj-$(CONFIG_KVM) += qemu-kvm-ia64.o
155 endif
157 ifeq ($(TARGET_BASE_ARCH), cris)
158 libobj-y += cris-dis.o
160 ifndef CONFIG_USER_ONLY
161 libobj-y += mmu.o
162 endif
163 endif
166 # NOTE: the disassembler code is only needed for debugging
167 libobj-y += disas.o
168 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
169 USE_I386_DIS=y
170 endif
171 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
172 USE_I386_DIS=y
173 endif
174 libobj-$(USE_I386_DIS) += i386-dis.o
175 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
176 libobj-y += alpha-dis.o
177 endif
178 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
179 libobj-y += ppc-dis.o
180 endif
181 ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
182 libobj-y += microblaze-dis.o
183 ifndef CONFIG_USER_ONLY
184 libobj-y += mmu.o
185 endif
186 endif
187 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
188 libobj-y += mips-dis.o
189 endif
190 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
191 libobj-y += sparc-dis.o
192 endif
193 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
194 libobj-y += arm-dis.o
195 endif
196 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
197 libobj-y += m68k-dis.o
198 endif
199 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
200 libobj-y += sh4-dis.o
201 endif
202 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
203 libobj-y += hppa-dis.o
204 endif
205 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
206 libobj-y += s390-dis.o
207 endif
209 # libqemu
211 libqemu.a: $(libobj-y)
213 translate.o: translate.c cpu.h
215 translate-all.o: translate-all.c cpu.h
217 tcg/tcg.o: cpu.h
219 # HELPER_CFLAGS is used for all the code compiled with static register
220 # variables
221 op_helper.o: CFLAGS += $(HELPER_CFLAGS)
223 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
225 qemu-kvm-helper.o: qemu-kvm-helper.c
226         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
228 #########################################################
229 # Linux user emulator target
231 ifdef CONFIG_LINUX_USER
233 ifndef TARGET_ABI_DIR
234   TARGET_ABI_DIR=$(TARGET_ARCH)
235 endif
236 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
237 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
239 ifdef CONFIG_STATIC
240 LDFLAGS+=-static
241 endif
243 ifeq ($(ARCH),i386)
244 ifdef TARGET_GPROF
245 USE_I386_LD=y
246 endif
247 ifdef CONFIG_STATIC
248 USE_I386_LD=y
249 endif
250 ifdef USE_I386_LD
251 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
252 else
253 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
254 # that the kernel ELF loader considers as an executable. I think this
255 # is the simplest way to make it self virtualizable!
256 LDFLAGS+=-Wl,-shared
257 endif
258 endif
260 ifeq ($(ARCH),x86_64)
261 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
262 endif
264 ifeq ($(ARCH),ppc)
265 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
266 endif
268 ifeq ($(ARCH),ppc64)
269 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
270 endif
272 ifeq ($(ARCH),s390)
273 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
274 endif
276 ifeq ($(ARCH),sparc)
277 # -static is used to avoid g1/g3 usage by the dynamic linker    
278 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
279 endif
281 ifeq ($(ARCH),sparc64)
282 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
283 endif
285 ifeq ($(ARCH),alpha)
286 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
287 endif
289 ifeq ($(ARCH),ia64)
290 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
291 endif
293 ifeq ($(ARCH),arm)
294 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
295 endif
297 ifeq ($(ARCH),m68k)
298 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
299 endif
301 ifeq ($(ARCH),mips)
302 ifeq ($(WORDS_BIGENDIAN),yes)
303 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
304 else
305 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
306 endif
307 endif
309 ifeq ($(ARCH),mips64)
310 ifeq ($(WORDS_BIGENDIAN),yes)
311 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
312 else
313 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
314 endif
315 endif
317 # profiling code
318 ifdef TARGET_GPROF
319 LDFLAGS+=-p
320 CFLAGS+=-p
321 endif
323 obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
324       elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
325       ioport-user.o
326 LIBS+= $(PTHREADLIBS)
327 LIBS+= $(CLOCKLIBS)
328 obj-$(TARGET_HAS_BFLT) += flatload.o
330 ifdef TARGET_HAS_ELFLOAD32
331 elfload32.o: elfload.c
332 endif
333 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
335 ifeq ($(TARGET_ARCH), i386)
336 obj-y += vm86.o
337 endif
338 ifeq ($(TARGET_ARCH), arm)
339 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
340 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
341 obj-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
342 obj-y += arm-semi.o
343 endif
344 ifeq ($(TARGET_ARCH), m68k)
345 obj-y += m68k-sim.o m68k-semi.o
346 endif
348 # Note: this is a workaround. The real fix is to avoid compiling
349 # cpu_signal_handler() in cpu-exec.c.
350 signal.o: CFLAGS += $(HELPER_CFLAGS)
352 $(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a
353 $(QEMU_PROG): $(obj-y) ../libqemu_user.a libqemu.a
354         $(call LINK,$(obj-y))
355 ifeq ($(ARCH),alpha)
356 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
357 # the address space (31 bit so sign extending doesn't matter)
358         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
359 endif
361 endif #CONFIG_LINUX_USER
363 #########################################################
364 # Darwin user emulator target
366 ifdef CONFIG_DARWIN_USER
368 VPATH+=:$(SRC_PATH)/darwin-user
369 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
371 # Leave some space for the regular program loading zone
372 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
374 LIBS+=-lmx
376 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
377         gdbstub.o gdbstub-xml.o ioport-user.o
379 # Note: this is a workaround. The real fix is to avoid compiling
380 # cpu_signal_handler() in cpu-exec.c.
381 signal.o: CFLAGS += $(HELPER_CFLAGS)
383 $(QEMU_PROG): ARLIBS=libqemu.a
384 $(QEMU_PROG): $(obj-y) libqemu.a
385         $(call LINK,$(obj-y))
387 endif #CONFIG_DARWIN_USER
389 #########################################################
390 # BSD user emulator target
392 ifdef CONFIG_BSD_USER
394 VPATH+=:$(SRC_PATH)/bsd-user
395 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
397 ifdef CONFIG_STATIC
398 LDFLAGS+=-static
399 endif
401 ifeq ($(ARCH),i386)
402 ifdef TARGET_GPROF
403 USE_I386_LD=y
404 endif
405 ifdef CONFIG_STATIC
406 USE_I386_LD=y
407 endif
408 ifdef USE_I386_LD
409 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
410 else
411 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
412 # that the kernel ELF loader considers as an executable. I think this
413 # is the simplest way to make it self virtualizable!
414 LDFLAGS+=-Wl,-shared
415 endif
416 endif
418 ifeq ($(ARCH),x86_64)
419 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
420 endif
422 ifeq ($(ARCH),ppc)
423 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
424 endif
426 ifeq ($(ARCH),ppc64)
427 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
428 endif
430 ifeq ($(ARCH),s390)
431 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
432 endif
434 ifeq ($(ARCH),sparc)
435 # -static is used to avoid g1/g3 usage by the dynamic linker
436 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
437 endif
439 ifeq ($(ARCH),sparc64)
440 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
441 endif
443 ifeq ($(ARCH),alpha)
444 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
445 endif
447 ifeq ($(ARCH),ia64)
448 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
449 endif
451 ifeq ($(ARCH),arm)
452 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
453 endif
455 ifeq ($(ARCH),m68k)
456 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
457 endif
459 ifeq ($(ARCH),mips)
460 ifeq ($(WORDS_BIGENDIAN),yes)
461 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
462 else
463 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
464 endif
465 endif
467 ifeq ($(ARCH),mips64)
468 ifeq ($(WORDS_BIGENDIAN),yes)
469 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
470 else
471 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
472 endif
473 endif
475 obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
476         gdbstub.o gdbstub-xml.o ioport-user.o
477 obj-y += uaccess.o
479 # Note: this is a workaround. The real fix is to avoid compiling
480 # cpu_signal_handler() in cpu-exec.c.
481 signal.o: CFLAGS += $(HELPER_CFLAGS)
483 $(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a
484 $(QEMU_PROG): $(obj-y) libqemu.a ../libqemu_user.a
485         $(call LINK,$(obj-y))
487 endif #CONFIG_BSD_USER
489 #########################################################
490 # System emulator target
491 ifndef CONFIG_USER_ONLY
493 obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
494         gdbstub.o gdbstub-xml.o msix.o ioport.o
495 # virtio has to be here due to weird dependency between PCI and virtio-net.
496 # need to fix this properly
497 obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
498 obj-$(CONFIG_KVM) += kvm.o kvm-all.o
500 LIBS+=-lz
501 ifdef CONFIG_ALSA
502 LIBS += -lasound
503 endif
504 ifdef CONFIG_ESD
505 LIBS += -lesd
506 endif
507 ifdef CONFIG_PA
508 LIBS += -lpulse-simple
509 endif
510 ifdef CONFIG_DSOUND
511 LIBS += -lole32 -ldxguid
512 endif
513 ifdef CONFIG_FMOD
514 LIBS += $(CONFIG_FMOD_LIB)
515 endif
516 ifdef CONFIG_OSS
517 LIBS += $(CONFIG_OSS_LIB)
518 endif
520 sound-obj-y =
521 sound-obj-$(CONFIG_SB16) += sb16.o
522 sound-obj-$(CONFIG_ES1370) += es1370.o
523 sound-obj-$(CONFIG_AC97) += ac97.o
524 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
525 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
526 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
528 ifdef CONFIG_ADLIB
529 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
530 endif
532 ifdef CONFIG_VNC_TLS
533 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
534 LIBS += $(CONFIG_VNC_TLS_LIBS)
535 endif
537 ifdef CONFIG_VNC_SASL
538 CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
539 LIBS += $(CONFIG_VNC_SASL_LIBS)
540 endif
542 ifdef CONFIG_BLUEZ
543 LIBS += $(CONFIG_BLUEZ_LIBS)
544 endif
546 # xen backend driver support
547 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
548 ifeq ($(CONFIG_XEN), y)
549   LIBS += $(XEN_LIBS)
550 endif
552 # USB layer
553 obj-y += usb-ohci.o
555 # PCI network cards
556 obj-y += eepro100.o
557 obj-y += ne2000.o
558 obj-y += pcnet.o
559 obj-y += rtl8139.o
560 obj-y += e1000.o
562 # Generic watchdog support and some watchdog devices
563 obj-y += wdt_ib700.o wdt_i6300esb.o
565 # Hardware support
566 obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
567 obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
568 obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
569 obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
570 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
571 obj-i386-y += extboot.o
572 ifeq ($(USE_KVM_PIT), 1)
573 obj-i386-y += i8254-kvm.o
574 endif
575 ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1)
576 obj-i386-y += device-assignment.o
577 LIBS+=-lpci
578 endif
580 ifeq ($(TARGET_BASE_ARCH), i386)
581 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
582 endif
584 # Hardware support
585 obj-ia64-y += ide.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
586 obj-ia64-y += fdc.o mc146818rtc.o serial.o i8259.o ipf.o
587 obj-ia64-y += cirrus_vga.o parallel.o acpi.o piix_pci.o
588 obj-ia64-y += usb-uhci.o
590 ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1)
591 obj-ia64-y += device-assignment.o
592 LIBS+=-lpci
593 endif
595 # shared objects
596 obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
597 obj-ppc-y += cirrus_vga.o
598 # PREP target
599 obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
600 obj-ppc-y += prep_pci.o ppc_prep.o
601 # Mac shared devices
602 obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
603 # OldWorld PowerMac
604 obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
605 # NewWorld PowerMac
606 obj-ppc-y += unin_pci.o ppc_newworld.o
607 # PowerPC 4xx boards
608 obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
609 obj-ppc-y += ppc440.o ppc440_bamboo.o
610 # PowerPC E500 boards
611 obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
612 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
614 ifeq ($(TARGET_BASE_ARCH), ppc)
615 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
616 endif
618 ifdef FDT_LIBS
619 obj-ppc-y += device_tree.o
620 LIBS+= $(FDT_LIBS)
621 endif
623 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
624 obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
625 obj-mips-y += g364fb.o jazz_led.o dp8393x.o
626 obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
627 obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
628 obj-mips-y += mipsnet.o
629 obj-mips-y += pflash_cfi01.o
630 obj-mips-y += vmware_vga.o
632 ifeq ($(TARGET_BASE_ARCH), mips)
633 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
634 endif
636 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
638 obj-microblaze-y += microblaze_pic_cpu.o
639 obj-microblaze-y += xilinx_intc.o
640 obj-microblaze-y += xilinx_timer.o
641 obj-microblaze-y += xilinx_uartlite.o
642 obj-microblaze-y += xilinx_ethlite.o
644 obj-microblaze-y += pflash_cfi02.o
646 ifdef FDT_LIBS
647 obj-microblaze-y += device_tree.o
648 LIBS+= $(FDT_LIBS)
649 endif
651 # Boards
652 obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
654 # IO blocks
655 obj-cris-y += etraxfs_dma.o
656 obj-cris-y += etraxfs_pic.o
657 obj-cris-y += etraxfs_eth.o
658 obj-cris-y += etraxfs_timer.o
659 obj-cris-y += etraxfs_ser.o
661 obj-cris-y += pflash_cfi02.o
663 ifeq ($(TARGET_ARCH), sparc64)
664 obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
665 obj-sparc-y += fdc.o mc146818rtc.o serial.o
666 obj-sparc-y += cirrus_vga.o parallel.o
667 else
668 obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
669 obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
670 obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
671 endif
673 obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
674 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
675 obj-arm-y += versatile_pci.o
676 obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
677 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
678 obj-arm-y += pl061.o
679 obj-arm-y += arm-semi.o
680 obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
681 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
682 obj-arm-y += pflash_cfi01.o gumstix.o
683 obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
684 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
685 obj-arm-y += omap2.o omap_dss.o soc_dma.o
686 obj-arm-y += omap_sx1.o palm.o tsc210x.o
687 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
688 obj-arm-y += mst_fpga.o mainstone.o
689 obj-arm-y += musicpal.o pflash_cfi02.o
690 obj-arm-y += framebuffer.o
691 obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
692 obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
693 obj-arm-y += syborg_virtio.o
695 ifeq ($(TARGET_BASE_ARCH), arm)
696 CPPFLAGS += -DHAS_AUDIO
697 endif
699 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
700 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
701 obj-sh4-y += ide.o
703 obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
704 obj-m68k-y += m68k-semi.o dummy_m68k.o
706 ifdef CONFIG_COCOA
707 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
708 ifdef CONFIG_COREAUDIO
709 COCOA_LIBS+=-framework CoreAudio
710 endif
711 endif
712 ifdef CONFIG_SLIRP
713 CPPFLAGS+=-I$(SRC_PATH)/slirp
714 endif
716 # specific flags are needed for non soft mmu emulator
717 ifdef CONFIG_STATIC
718 LDFLAGS+=-static
719 endif
720 ifndef CONFIG_DARWIN
721 ifndef CONFIG_WIN32
722 ifndef CONFIG_SOLARIS
723 ifndef CONFIG_AIX
724 LIBS+=-lutil
725 endif
726 endif
727 endif
728 endif
729 ifdef TARGET_GPROF
730 vl.o: CFLAGS+=-p
731 LDFLAGS+=-p
732 endif
734 ifeq ($(ARCH),ia64)
735 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
736 endif
738 ifdef CONFIG_WIN32
739 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
740 endif
742 # profiling code
743 ifdef TARGET_GPROF
744 LDFLAGS+=-p
745 main.o: CFLAGS+=-p
746 endif
747 ifeq ($(TARGET_ARCH), ia64)
748 firmware.o: firmware.c
749         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
750 endif
752 vl.o: CFLAGS+=$(SDL_CFLAGS)
754 vl.o: qemu-options.h
756 monitor.o: qemu-monitor.h
758 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
759 $(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
760 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../libqemu_common.a libqemu.a $(HWLIB)
761         $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
763 $(QEMU_PROG): ARLIBS += $(DEPLIBS)
764 $(QEMU_PROG): $(DEPLIBS)
766 endif # !CONFIG_USER_ONLY
768 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
769 ifeq ($(TARGET_XML_FILES),)
770         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
771 else
772         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
773 endif
775 qemu-options.h: $(SRC_PATH)/qemu-options.hx
776         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
778 qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
779         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
781 clean:
782         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
783         rm -f *.d */*.d tcg/*.o
784         rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
786 install: all
787 ifneq ($(PROGS),)
788         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
789 endif
791 # Include automatically generated dependency files
792 -include $(wildcard *.d */*.d)