compute checksum for roms bigger than a segment
[qemu-kvm/fedora.git] / Makefile.target
blob72f14f6de767b306d61782a0ddde3f9174431725
1 CFLAGS=
2 LDFLAGS=
4 include config.mak
5 include $(SRC_PATH)/rules.mak
7 LDFLAGS_BASE:=$(LDFLAGS)
9 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
10 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
11 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
12 #CFLAGS+=-Werror
13 LIBS=
15 ifdef CONFIG_USER_ONLY
16 # user emulator name
17 QEMU_PROG=qemu-$(TARGET_ARCH2)
18 else
19 # system emulator name
20 ifeq ($(TARGET_ARCH), i386)
21 QEMU_PROG=qemu$(EXESUF)
22 else
23 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
24 endif
25 endif
27 PROGS=$(QEMU_PROG)
29 # cc-option
30 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
32 cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
33               > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
35 HELPER_CFLAGS=
37 ifeq ($(ARCH),i386)
38 HELPER_CFLAGS+=-fomit-frame-pointer
39 endif
41 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
42 translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
43 endif
45 ifeq ($(ARCH),sparc)
46   ifneq ($(CONFIG_SOLARIS),y)
47     HELPER_CFLAGS+=-ffixed-i0
48   endif
49 endif
51 ifeq ($(ARCH),alpha)
52 # Ensure there's only a single GP
53 CFLAGS+=-msmall-data
54 endif
56 ifeq ($(ARCH),ia64)
57 CFLAGS+=-mno-sdata
58 endif
60 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
61 CPPFLAGS+=-U_FORTIFY_SOURCE
62 CPPFLAGS+=-D__user=
63 LIBS+=-lm
64 ifdef CONFIG_WIN32
65 LIBS+=-lwinmm -lws2_32 -liphlpapi
66 endif
67 ifdef CONFIG_SOLARIS
68 LIBS+=-lsocket -lnsl -lresolv
69 ifdef NEEDS_LIBSUNMATH
70 LIBS+=-lsunmath
71 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
72 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
73 endif
74 endif
76 kvm.o: CFLAGS+=$(KVM_CFLAGS)
77 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
79 CFLAGS += $(KVM_CFLAGS)
81 all: $(PROGS)
82 # Dummy command so that make thinks it has done something
83         @true
85 #########################################################
86 # cpu emulator library
87 libobj-y = exec.o cpu-exec.o host-utils.o
88 ifeq ($(NO_CPU_EMULATION), 1)
89 libobj-y += fack-exec.o
90 else
91 libobj-y += translate-all.o translate.o 
92 endif
93 libobj-$(CONFIG_KQEMU) += kqemu.o
94 # TCG code generator
95 ifneq ($(NO_CPU_EMULATION), 1)
96 libobj-y += tcg/tcg.o tcg/tcg-runtime.o
97 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
98 endif
99 ifeq ($(ARCH),sparc64)
100 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
101 endif
103 ifdef CONFIG_SOFTFLOAT
104 libobj-y += fpu/softfloat.o
105 else
106 libobj-y += fpu/softfloat-native.o
107 endif
108 CPPFLAGS+=-I$(SRC_PATH)/fpu
109 libobj-y += op_helper.o helper.o
111 ifeq ($(TARGET_BASE_ARCH), i386)
112 libobj-y += helper.o
113 libobj-$(CONFIG_KVM) += kvm-tpr-opt.o
114 libobj-$(CONFIG_KVM) += qemu-kvm-helper.o
115 endif
117 libobj-y += op_helper.o
119 ifneq ($(TARGET_ARCH), ia64)
120 libobj-y += helper.o
121 endif
123 ifeq ($(TARGET_BASE_ARCH), arm)
124 libobj-y += neon_helper.o iwmmxt_helper.o
125 endif
127 ifeq ($(TARGET_BASE_ARCH), alpha)
128 libobj-y += alpha_palcode.o
129 endif
131 ifeq ($(TARGET_BASE_ARCH), ia64)
132 libobj-y += op_helper.o firmware.o
133 libobj-$(CONFIG_KVM) += qemu-kvm-ia64.o
134 endif
136 ifeq ($(TARGET_BASE_ARCH), cris)
137 libobj-y += cris-dis.o
139 ifndef CONFIG_USER_ONLY
140 libobj-y += mmu.o
141 endif
142 endif
145 # NOTE: the disassembler code is only needed for debugging
146 libobj-y += disas.o
147 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
148 USE_I386_DIS=y
149 endif
150 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
151 USE_I386_DIS=y
152 endif
153 libobj-$(USE_I386_DIS) += i386-dis.o
154 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
155 libobj-y += alpha-dis.o
156 endif
157 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
158 libobj-y += ppc-dis.o
159 endif
160 ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
161 libobj-y += microblaze-dis.o
162 ifndef CONFIG_USER_ONLY
163 libobj-y += mmu.o
164 endif
165 endif
166 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
167 libobj-y += mips-dis.o
168 endif
169 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
170 libobj-y += sparc-dis.o
171 endif
172 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
173 libobj-y += arm-dis.o
174 endif
175 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
176 libobj-y += m68k-dis.o
177 endif
178 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
179 libobj-y += sh4-dis.o
180 endif
181 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
182 libobj-y += hppa-dis.o
183 endif
184 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
185 libobj-y += s390-dis.o
186 endif
188 # libqemu
190 libqemu.a: $(libobj-y)
192 translate.o: translate.c cpu.h
194 translate-all.o: translate-all.c cpu.h
196 tcg/tcg.o: cpu.h
198 # HELPER_CFLAGS is used for all the code compiled with static register
199 # variables
200 op_helper.o: CFLAGS += $(HELPER_CFLAGS)
202 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
204 qemu-kvm-helper.o: qemu-kvm-helper.c
205         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
207 #########################################################
208 # Linux user emulator target
210 ifdef CONFIG_LINUX_USER
212 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
213 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
215 ifdef CONFIG_STATIC
216 LDFLAGS+=-static
217 endif
219 ifeq ($(ARCH),i386)
220 ifdef TARGET_GPROF
221 USE_I386_LD=y
222 endif
223 ifdef CONFIG_STATIC
224 USE_I386_LD=y
225 endif
226 ifdef USE_I386_LD
227 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
228 else
229 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
230 # that the kernel ELF loader considers as an executable. I think this
231 # is the simplest way to make it self virtualizable!
232 LDFLAGS+=-Wl,-shared
233 endif
234 endif
236 ifeq ($(ARCH),x86_64)
237 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
238 endif
240 ifeq ($(ARCH),ppc)
241 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
242 endif
244 ifeq ($(ARCH),ppc64)
245 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
246 endif
248 ifeq ($(ARCH),s390)
249 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
250 endif
252 ifeq ($(ARCH),sparc)
253 # -static is used to avoid g1/g3 usage by the dynamic linker    
254 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
255 endif
257 ifeq ($(ARCH),sparc64)
258 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
259 endif
261 ifeq ($(ARCH),alpha)
262 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
263 endif
265 ifeq ($(ARCH),ia64)
266 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
267 endif
269 ifeq ($(ARCH),arm)
270 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
271 endif
273 ifeq ($(ARCH),m68k)
274 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
275 endif
277 ifeq ($(ARCH),mips)
278 ifeq ($(WORDS_BIGENDIAN),yes)
279 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
280 else
281 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
282 endif
283 endif
285 ifeq ($(ARCH),mips64)
286 ifeq ($(WORDS_BIGENDIAN),yes)
287 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
288 else
289 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
290 endif
291 endif
293 # profiling code
294 ifdef TARGET_GPROF
295 LDFLAGS+=-p
296 CFLAGS+=-p
297 endif
299 obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
300       elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
301       ioport-user.o
302 obj-$(TARGET_HAS_BFLT) += flatload.o
304 ifdef TARGET_HAS_ELFLOAD32
305 elfload32.o: elfload.c
306 endif
307 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
309 ifeq ($(TARGET_ARCH), i386)
310 obj-y += vm86.o
311 endif
313 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
314 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
315 obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
316 obj-arm-y += arm-semi.o
318 obj-m68k-y += m68k-sim.o m68k-semi.o
320 # Note: this is a workaround. The real fix is to avoid compiling
321 # cpu_signal_handler() in cpu-exec.c.
322 signal.o: CFLAGS += $(HELPER_CFLAGS)
324 ARLIBS=../libqemu_user.a libqemu.a
325 endif #CONFIG_LINUX_USER
327 LIBS+= $(PTHREADLIBS)
328 LIBS+= $(CLOCKLIBS)
330 #########################################################
331 # Darwin user emulator target
333 ifdef CONFIG_DARWIN_USER
335 VPATH+=:$(SRC_PATH)/darwin-user
336 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
338 # Leave some space for the regular program loading zone
339 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
341 LIBS+=-lmx
343 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
344         gdbstub.o gdbstub-xml.o ioport-user.o
346 # Note: this is a workaround. The real fix is to avoid compiling
347 # cpu_signal_handler() in cpu-exec.c.
348 signal.o: CFLAGS += $(HELPER_CFLAGS)
350 ARLIBS=libqemu.a
352 endif #CONFIG_DARWIN_USER
354 #########################################################
355 # BSD user emulator target
357 ifdef CONFIG_BSD_USER
359 VPATH+=:$(SRC_PATH)/bsd-user
360 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
362 ifdef CONFIG_STATIC
363 LDFLAGS+=-static
364 endif
366 ifeq ($(ARCH),i386)
367 ifdef TARGET_GPROF
368 USE_I386_LD=y
369 endif
370 ifdef CONFIG_STATIC
371 USE_I386_LD=y
372 endif
373 ifdef USE_I386_LD
374 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
375 else
376 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
377 # that the kernel ELF loader considers as an executable. I think this
378 # is the simplest way to make it self virtualizable!
379 LDFLAGS+=-Wl,-shared
380 endif
381 endif
383 ifeq ($(ARCH),x86_64)
384 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
385 endif
387 ifeq ($(ARCH),ppc)
388 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
389 endif
391 ifeq ($(ARCH),ppc64)
392 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
393 endif
395 ifeq ($(ARCH),s390)
396 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
397 endif
399 ifeq ($(ARCH),sparc)
400 # -static is used to avoid g1/g3 usage by the dynamic linker
401 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
402 endif
404 ifeq ($(ARCH),sparc64)
405 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
406 endif
408 ifeq ($(ARCH),alpha)
409 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
410 endif
412 ifeq ($(ARCH),ia64)
413 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
414 endif
416 ifeq ($(ARCH),arm)
417 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
418 endif
420 ifeq ($(ARCH),m68k)
421 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
422 endif
424 ifeq ($(ARCH),mips)
425 ifeq ($(WORDS_BIGENDIAN),yes)
426 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
427 else
428 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
429 endif
430 endif
432 ifeq ($(ARCH),mips64)
433 ifeq ($(WORDS_BIGENDIAN),yes)
434 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
435 else
436 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
437 endif
438 endif
440 obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
441         gdbstub.o gdbstub-xml.o ioport-user.o
442 obj-y += uaccess.o
444 # Note: this is a workaround. The real fix is to avoid compiling
445 # cpu_signal_handler() in cpu-exec.c.
446 signal.o: CFLAGS += $(HELPER_CFLAGS)
448 ARLIBS=libqemu.a ../libqemu_user.a
450 endif #CONFIG_BSD_USER
452 #########################################################
453 # System emulator target
454 ifndef CONFIG_USER_ONLY
456 obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
457         gdbstub.o gdbstub-xml.o msix.o ioport.o
458 # virtio has to be here due to weird dependency between PCI and virtio-net.
459 # need to fix this properly
460 obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
461 obj-$(CONFIG_KVM) += kvm.o kvm-all.o
463 LIBS+=-lz
464 ifdef CONFIG_ALSA
465 LIBS += -lasound
466 endif
467 ifdef CONFIG_ESD
468 LIBS += -lesd
469 endif
470 ifdef CONFIG_PA
471 LIBS += -lpulse-simple
472 endif
473 ifdef CONFIG_DSOUND
474 LIBS += -lole32 -ldxguid
475 endif
476 ifdef CONFIG_FMOD
477 LIBS += $(CONFIG_FMOD_LIB)
478 endif
479 ifdef CONFIG_OSS
480 LIBS += $(CONFIG_OSS_LIB)
481 endif
483 sound-obj-y =
484 sound-obj-$(CONFIG_SB16) += sb16.o
485 sound-obj-$(CONFIG_ES1370) += es1370.o
486 sound-obj-$(CONFIG_AC97) += ac97.o
487 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
488 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
489 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
491 ifdef CONFIG_ADLIB
492 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
493 endif
495 ifdef CONFIG_VNC_TLS
496 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
497 LIBS += $(CONFIG_VNC_TLS_LIBS)
498 endif
500 ifdef CONFIG_VNC_SASL
501 CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
502 LIBS += $(CONFIG_VNC_SASL_LIBS)
503 endif
505 ifdef CONFIG_BLUEZ
506 LIBS += $(CONFIG_BLUEZ_LIBS)
507 endif
509 # xen backend driver support
510 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
511 ifeq ($(CONFIG_XEN), y)
512   LIBS += $(XEN_LIBS)
513 endif
515 # USB layer
516 obj-y += usb-ohci.o
518 # PCI network cards
519 obj-y += eepro100.o
520 obj-y += ne2000.o
521 obj-y += pcnet.o
522 obj-y += rtl8139.o
523 obj-y += e1000.o
525 # Generic watchdog support and some watchdog devices
526 obj-y += wdt_ib700.o wdt_i6300esb.o
528 # Hardware support
529 obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
530 obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
531 obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
532 obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
533 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
534 obj-i386-y += extboot.o
535 ifeq ($(USE_KVM_PIT), 1)
536 obj-i386-y += i8254-kvm.o
537 endif
538 ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1)
539 obj-i386-y += device-assignment.o
540 LIBS+=-lpci
541 endif
543 ifeq ($(TARGET_BASE_ARCH), i386)
544 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
545 endif
547 # Hardware support
548 obj-ia64-y += ide.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
549 obj-ia64-y += fdc.o mc146818rtc.o serial.o i8259.o ipf.o
550 obj-ia64-y += cirrus_vga.o parallel.o acpi.o piix_pci.o
551 obj-ia64-y += usb-uhci.o
553 ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1)
554 obj-ia64-y += device-assignment.o
555 LIBS+=-lpci
556 endif
558 # shared objects
559 obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
560 obj-ppc-y += cirrus_vga.o
561 # PREP target
562 obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
563 obj-ppc-y += prep_pci.o ppc_prep.o
564 # Mac shared devices
565 obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
566 # OldWorld PowerMac
567 obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
568 # NewWorld PowerMac
569 obj-ppc-y += unin_pci.o ppc_newworld.o
570 # PowerPC 4xx boards
571 obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
572 obj-ppc-y += ppc440.o ppc440_bamboo.o
573 # PowerPC E500 boards
574 obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
575 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
577 ifeq ($(TARGET_BASE_ARCH), ppc)
578 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
579 endif
581 ifdef FDT_LIBS
582 obj-ppc-y += device_tree.o
583 LIBS+= $(FDT_LIBS)
584 endif
586 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
587 obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
588 obj-mips-y += g364fb.o jazz_led.o dp8393x.o
589 obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
590 obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
591 obj-mips-y += mipsnet.o
592 obj-mips-y += pflash_cfi01.o
593 obj-mips-y += vmware_vga.o
595 ifeq ($(TARGET_BASE_ARCH), mips)
596 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
597 endif
599 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
601 obj-microblaze-y += microblaze_pic_cpu.o
602 obj-microblaze-y += xilinx_intc.o
603 obj-microblaze-y += xilinx_timer.o
604 obj-microblaze-y += xilinx_uartlite.o
605 obj-microblaze-y += xilinx_ethlite.o
607 obj-microblaze-y += pflash_cfi02.o
609 ifdef FDT_LIBS
610 obj-microblaze-y += device_tree.o
611 LIBS+= $(FDT_LIBS)
612 endif
614 # Boards
615 obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
617 # IO blocks
618 obj-cris-y += etraxfs_dma.o
619 obj-cris-y += etraxfs_pic.o
620 obj-cris-y += etraxfs_eth.o
621 obj-cris-y += etraxfs_timer.o
622 obj-cris-y += etraxfs_ser.o
624 obj-cris-y += pflash_cfi02.o
626 ifeq ($(TARGET_ARCH), sparc64)
627 obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
628 obj-sparc-y += fdc.o mc146818rtc.o serial.o
629 obj-sparc-y += cirrus_vga.o parallel.o
630 else
631 obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
632 obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
633 obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
634 endif
636 obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
637 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
638 obj-arm-y += versatile_pci.o
639 obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
640 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
641 obj-arm-y += pl061.o
642 obj-arm-y += arm-semi.o
643 obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
644 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
645 obj-arm-y += pflash_cfi01.o gumstix.o
646 obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
647 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
648 obj-arm-y += omap2.o omap_dss.o soc_dma.o
649 obj-arm-y += omap_sx1.o palm.o tsc210x.o
650 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
651 obj-arm-y += mst_fpga.o mainstone.o
652 obj-arm-y += musicpal.o pflash_cfi02.o
653 obj-arm-y += framebuffer.o
654 obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
655 obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
656 obj-arm-y += syborg_virtio.o
658 ifeq ($(TARGET_BASE_ARCH), arm)
659 CPPFLAGS += -DHAS_AUDIO
660 endif
662 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
663 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
664 obj-sh4-y += ide.o
666 obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
667 obj-m68k-y += m68k-semi.o dummy_m68k.o
669 ifdef CONFIG_COCOA
670 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
671 ifdef CONFIG_COREAUDIO
672 COCOA_LIBS+=-framework CoreAudio
673 endif
674 endif
675 ifdef CONFIG_SLIRP
676 CPPFLAGS+=-I$(SRC_PATH)/slirp
677 endif
679 # specific flags are needed for non soft mmu emulator
680 ifdef CONFIG_STATIC
681 LDFLAGS+=-static
682 endif
683 ifndef CONFIG_DARWIN
684 ifndef CONFIG_WIN32
685 ifndef CONFIG_SOLARIS
686 ifndef CONFIG_AIX
687 LIBS+=-lutil
688 endif
689 endif
690 endif
691 endif
692 ifdef TARGET_GPROF
693 vl.o: CFLAGS+=-p
694 LDFLAGS+=-p
695 endif
697 ifeq ($(ARCH),ia64)
698 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
699 endif
701 ifdef CONFIG_WIN32
702 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
703 endif
705 # profiling code
706 ifdef TARGET_GPROF
707 LDFLAGS+=-p
708 main.o: CFLAGS+=-p
709 endif
710 ifeq ($(TARGET_ARCH), ia64)
711 firmware.o: firmware.c
712         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
713 endif
715 vl.o: CFLAGS+=$(SDL_CFLAGS)
717 vl.o: qemu-options.h
719 monitor.o: qemu-monitor.h
721 LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
722 ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
724 $(QEMU_PROG): ARLIBS += $(DEPLIBS)
725 $(QEMU_PROG): $(DEPLIBS)
727 endif # !CONFIG_USER_ONLY
729 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
730         $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
733 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
734 ifeq ($(TARGET_XML_FILES),)
735         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
736 else
737         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
738 endif
740 qemu-options.h: $(SRC_PATH)/qemu-options.hx
741         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
743 qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
744         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
746 clean:
747         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
748         rm -f *.d */*.d tcg/*.o
749         rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
751 install: all
752 ifneq ($(PROGS),)
753         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
754 endif
756 # Include automatically generated dependency files
757 -include $(wildcard *.d */*.d)