configure xen in a single place
[qemu/aliguori-queue.git] / Makefile.target
blob10379238319cbc3278dc1d66cbb551a0a7ab5cd8
1 include config.mak
2 include $(SRC_PATH)/rules.mak
4 ifndef TARGET_BASE_ARCH
5 TARGET_BASE_ARCH:=$(TARGET_ARCH)
6 endif
8 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
9 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
10 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
11 #CFLAGS+=-Werror
12 LIBS=
13 # user emulator name
14 ifndef TARGET_ARCH2
15 TARGET_ARCH2=$(TARGET_ARCH)
16 endif
18 ifdef CONFIG_USER_ONLY
19 # user emulator name
20 QEMU_PROG=qemu-$(TARGET_ARCH2)
21 else
22 # system emulator name
23 ifeq ($(TARGET_ARCH), i386)
24 QEMU_PROG=qemu$(EXESUF)
25 else
26 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
27 endif
28 endif
30 PROGS=$(QEMU_PROG)
32 # cc-option
33 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
35 cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
36               > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
38 HELPER_CFLAGS=
40 ifeq ($(ARCH),i386)
41 HELPER_CFLAGS+=-fomit-frame-pointer
42 endif
44 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
45 translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
46 endif
48 ifeq ($(ARCH),sparc)
49   ifneq ($(CONFIG_SOLARIS),y)
50     HELPER_CFLAGS+=-ffixed-i0
51   endif
52 endif
54 ifeq ($(ARCH),alpha)
55 # Ensure there's only a single GP
56 CFLAGS+=-msmall-data
57 endif
59 ifeq ($(ARCH),hppa)
60 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
61 endif
63 ifeq ($(ARCH),ia64)
64 CFLAGS+=-mno-sdata
65 endif
67 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
68 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
70 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
71 CPPFLAGS+=-U_FORTIFY_SOURCE
72 LIBS+=-lm
73 ifdef CONFIG_WIN32
74 LIBS+=-lwinmm -lws2_32 -liphlpapi
75 endif
76 ifdef CONFIG_SOLARIS
77 LIBS+=-lsocket -lnsl -lresolv
78 ifdef NEEDS_LIBSUNMATH
79 LIBS+=-lsunmath
80 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
81 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
82 endif
83 endif
85 kvm.o: CFLAGS+=$(KVM_CFLAGS)
86 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
88 all: $(PROGS)
89 # Dummy command so that make thinks it has done something
90         @true
92 #########################################################
93 # cpu emulator library
94 libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
95 libobj-$(CONFIG_KQEMU) += kqemu.o
96 # TCG code generator
97 libobj-y += tcg/tcg.o tcg/tcg-runtime.o
98 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
99 ifeq ($(ARCH),sparc64)
100 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
101 endif
102 ifdef CONFIG_SOFTFLOAT
103 libobj-y += fpu/softfloat.o
104 else
105 libobj-y += fpu/softfloat-native.o
106 endif
107 CPPFLAGS+=-I$(SRC_PATH)/fpu
108 libobj-y += op_helper.o helper.o
110 ifeq ($(TARGET_BASE_ARCH), arm)
111 libobj-y += neon_helper.o iwmmxt_helper.o
112 endif
114 ifeq ($(TARGET_BASE_ARCH), alpha)
115 libobj-y += alpha_palcode.o
116 endif
118 ifeq ($(TARGET_BASE_ARCH), cris)
119 libobj-y += cris-dis.o
121 ifndef CONFIG_USER_ONLY
122 libobj-y += mmu.o
123 endif
124 endif
126 # NOTE: the disassembler code is only needed for debugging
127 libobj-y += disas.o
128 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
129 USE_I386_DIS=y
130 endif
131 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
132 USE_I386_DIS=y
133 endif
134 libobj-$(USE_I386_DIS) += i386-dis.o
135 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
136 libobj-y += alpha-dis.o
137 endif
138 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
139 libobj-y += ppc-dis.o
140 endif
141 ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
142 libobj-y += microblaze-dis.o
143 ifndef CONFIG_USER_ONLY
144 libobj-y += mmu.o
145 endif
146 endif
147 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
148 libobj-y += mips-dis.o
149 endif
150 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
151 libobj-y += sparc-dis.o
152 endif
153 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
154 libobj-y += arm-dis.o
155 endif
156 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
157 libobj-y += m68k-dis.o
158 endif
159 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
160 libobj-y += sh4-dis.o
161 endif
162 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
163 libobj-y += hppa-dis.o
164 endif
165 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
166 libobj-y += s390-dis.o
167 endif
169 # libqemu
171 libqemu.a: $(libobj-y)
173 translate.o: translate.c cpu.h
175 translate-all.o: translate-all.c cpu.h
177 tcg/tcg.o: cpu.h
179 # HELPER_CFLAGS is used for all the code compiled with static register
180 # variables
181 op_helper.o: CFLAGS += $(HELPER_CFLAGS)
183 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
185 #########################################################
186 # Linux user emulator target
188 ifdef CONFIG_LINUX_USER
190 ifndef TARGET_ABI_DIR
191   TARGET_ABI_DIR=$(TARGET_ARCH)
192 endif
193 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
194 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
196 ifdef CONFIG_STATIC
197 LDFLAGS+=-static
198 endif
200 ifeq ($(ARCH),i386)
201 ifdef TARGET_GPROF
202 USE_I386_LD=y
203 endif
204 ifdef CONFIG_STATIC
205 USE_I386_LD=y
206 endif
207 ifdef USE_I386_LD
208 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
209 else
210 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
211 # that the kernel ELF loader considers as an executable. I think this
212 # is the simplest way to make it self virtualizable!
213 LDFLAGS+=-Wl,-shared
214 endif
215 endif
217 ifeq ($(ARCH),x86_64)
218 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
219 endif
221 ifeq ($(ARCH),ppc)
222 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
223 endif
225 ifeq ($(ARCH),ppc64)
226 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
227 endif
229 ifeq ($(ARCH),s390)
230 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
231 endif
233 ifeq ($(ARCH),sparc)
234 # -static is used to avoid g1/g3 usage by the dynamic linker    
235 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
236 endif
238 ifeq ($(ARCH),sparc64)
239 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
240 endif
242 ifeq ($(ARCH),alpha)
243 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
244 endif
246 ifeq ($(ARCH),ia64)
247 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
248 endif
250 ifeq ($(ARCH),arm)
251 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
252 endif
254 ifeq ($(ARCH),m68k)
255 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
256 endif
258 ifeq ($(ARCH),mips)
259 ifeq ($(WORDS_BIGENDIAN),yes)
260 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
261 else
262 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
263 endif
264 endif
266 ifeq ($(ARCH),mips64)
267 ifeq ($(WORDS_BIGENDIAN),yes)
268 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
269 else
270 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
271 endif
272 endif
274 # profiling code
275 ifdef TARGET_GPROF
276 LDFLAGS+=-p
277 CFLAGS+=-p
278 endif
280 obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
281       elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
282       ioport-user.o
283 LIBS+= $(PTHREADLIBS)
284 LIBS+= $(CLOCKLIBS)
285 obj-$(TARGET_HAS_BFLT) += flatload.o
287 ifdef TARGET_HAS_ELFLOAD32
288 elfload32.o: elfload.c
289 endif
290 obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
292 ifeq ($(TARGET_ARCH), i386)
293 obj-y += vm86.o
294 endif
295 ifeq ($(TARGET_ARCH), arm)
296 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
297 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
298 obj-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
299 obj-y += arm-semi.o
300 endif
301 ifeq ($(TARGET_ARCH), m68k)
302 obj-y += m68k-sim.o m68k-semi.o
303 endif
305 # Note: this is a workaround. The real fix is to avoid compiling
306 # cpu_signal_handler() in cpu-exec.c.
307 signal.o: CFLAGS += $(HELPER_CFLAGS)
309 $(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a
310 $(QEMU_PROG): $(obj-y) ../libqemu_user.a libqemu.a
311         $(call LINK,$(obj-y))
312 ifeq ($(ARCH),alpha)
313 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
314 # the address space (31 bit so sign extending doesn't matter)
315         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
316 endif
318 endif #CONFIG_LINUX_USER
320 #########################################################
321 # Darwin user emulator target
323 ifdef CONFIG_DARWIN_USER
325 VPATH+=:$(SRC_PATH)/darwin-user
326 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
328 # Leave some space for the regular program loading zone
329 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
331 LIBS+=-lmx
333 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
334         gdbstub.o gdbstub-xml.o ioport-user.o
336 # Note: this is a workaround. The real fix is to avoid compiling
337 # cpu_signal_handler() in cpu-exec.c.
338 signal.o: CFLAGS += $(HELPER_CFLAGS)
340 $(QEMU_PROG): ARLIBS=libqemu.a
341 $(QEMU_PROG): $(obj-y) libqemu.a
342         $(call LINK,$(obj-y))
344 endif #CONFIG_DARWIN_USER
346 #########################################################
347 # BSD user emulator target
349 ifdef CONFIG_BSD_USER
351 VPATH+=:$(SRC_PATH)/bsd-user
352 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
354 ifdef CONFIG_STATIC
355 LDFLAGS+=-static
356 endif
358 ifeq ($(ARCH),i386)
359 ifdef TARGET_GPROF
360 USE_I386_LD=y
361 endif
362 ifdef CONFIG_STATIC
363 USE_I386_LD=y
364 endif
365 ifdef USE_I386_LD
366 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
367 else
368 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
369 # that the kernel ELF loader considers as an executable. I think this
370 # is the simplest way to make it self virtualizable!
371 LDFLAGS+=-Wl,-shared
372 endif
373 endif
375 ifeq ($(ARCH),x86_64)
376 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
377 endif
379 ifeq ($(ARCH),ppc)
380 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
381 endif
383 ifeq ($(ARCH),ppc64)
384 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
385 endif
387 ifeq ($(ARCH),s390)
388 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
389 endif
391 ifeq ($(ARCH),sparc)
392 # -static is used to avoid g1/g3 usage by the dynamic linker
393 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
394 endif
396 ifeq ($(ARCH),sparc64)
397 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
398 endif
400 ifeq ($(ARCH),alpha)
401 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
402 endif
404 ifeq ($(ARCH),ia64)
405 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
406 endif
408 ifeq ($(ARCH),arm)
409 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
410 endif
412 ifeq ($(ARCH),m68k)
413 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
414 endif
416 ifeq ($(ARCH),mips)
417 ifeq ($(WORDS_BIGENDIAN),yes)
418 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
419 else
420 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
421 endif
422 endif
424 ifeq ($(ARCH),mips64)
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 obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
433         gdbstub.o gdbstub-xml.o ioport-user.o
434 obj-y += uaccess.o
436 # Note: this is a workaround. The real fix is to avoid compiling
437 # cpu_signal_handler() in cpu-exec.c.
438 signal.o: CFLAGS += $(HELPER_CFLAGS)
440 $(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a
441 $(QEMU_PROG): $(obj-y) libqemu.a ../libqemu_user.a
442         $(call LINK,$(obj-y))
444 endif #CONFIG_BSD_USER
446 #########################################################
447 # System emulator target
448 ifndef CONFIG_USER_ONLY
450 obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
451         gdbstub.o gdbstub-xml.o msix.o ioport.o
452 # virtio has to be here due to weird dependency between PCI and virtio-net.
453 # need to fix this properly
454 obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
455 obj-$(CONFIG_KVM) += kvm.o kvm-all.o
457 LIBS+=-lz
458 ifdef CONFIG_ALSA
459 LIBS += -lasound
460 endif
461 ifdef CONFIG_ESD
462 LIBS += -lesd
463 endif
464 ifdef CONFIG_PA
465 LIBS += -lpulse-simple
466 endif
467 ifdef CONFIG_DSOUND
468 LIBS += -lole32 -ldxguid
469 endif
470 ifdef CONFIG_FMOD
471 LIBS += $(CONFIG_FMOD_LIB)
472 endif
473 ifdef CONFIG_OSS
474 LIBS += $(CONFIG_OSS_LIB)
475 endif
477 sound-obj-y =
478 sound-obj-$(CONFIG_SB16) += sb16.o
479 sound-obj-$(CONFIG_ES1370) += es1370.o
480 sound-obj-$(CONFIG_AC97) += ac97.o
481 sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
482 sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
483 sound-obj-$(CONFIG_CS4231A) += cs4231a.o
485 ifdef CONFIG_ADLIB
486 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
487 endif
489 ifdef CONFIG_VNC_TLS
490 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
491 LIBS += $(CONFIG_VNC_TLS_LIBS)
492 endif
494 ifdef CONFIG_VNC_SASL
495 CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
496 LIBS += $(CONFIG_VNC_SASL_LIBS)
497 endif
499 ifdef CONFIG_BLUEZ
500 LIBS += $(CONFIG_BLUEZ_LIBS)
501 endif
503 # xen backend driver support
504 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
505 ifeq ($(CONFIG_XEN), y)
506   LIBS += $(XEN_LIBS)
507 endif
509 # USB layer
510 obj-y += usb-ohci.o
512 # PCI network cards
513 obj-y += eepro100.o
514 obj-y += ne2000.o
515 obj-y += pcnet.o
516 obj-y += rtl8139.o
517 obj-y += e1000.o
519 # Generic watchdog support and some watchdog devices
520 obj-y += wdt_ib700.o wdt_i6300esb.o
522 # Hardware support
523 obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
524 obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
525 obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
526 obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
527 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
529 ifeq ($(TARGET_BASE_ARCH), i386)
530 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
531 endif
533 # shared objects
534 obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
535 # PREP target
536 obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
537 obj-ppc-y += prep_pci.o ppc_prep.o
538 # Mac shared devices
539 obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
540 # OldWorld PowerMac
541 obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
542 # NewWorld PowerMac
543 obj-ppc-y += unin_pci.o ppc_newworld.o
544 # PowerPC 4xx boards
545 obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
546 obj-ppc-y += ppc440.o ppc440_bamboo.o
547 # PowerPC E500 boards
548 obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
549 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
551 ifeq ($(TARGET_BASE_ARCH), ppc)
552 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
553 endif
555 ifdef FDT_LIBS
556 obj-ppc-y += device_tree.o
557 LIBS+= $(FDT_LIBS)
558 endif
560 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
561 obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
562 obj-mips-y += g364fb.o jazz_led.o dp8393x.o
563 obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
564 obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
565 obj-mips-y += mipsnet.o
566 obj-mips-y += pflash_cfi01.o
567 obj-mips-y += vmware_vga.o
569 ifeq ($(TARGET_BASE_ARCH), mips)
570 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
571 endif
573 obj-microblaze-y = petalogix_s3adsp1800_mmu.o
575 obj-microblaze-y += microblaze_pic_cpu.o
576 obj-microblaze-y += xilinx_intc.o
577 obj-microblaze-y += xilinx_timer.o
578 obj-microblaze-y += xilinx_uartlite.o
579 obj-microblaze-y += xilinx_ethlite.o
581 obj-microblaze-y += pflash_cfi02.o
583 ifdef FDT_LIBS
584 obj-microblaze-y += device_tree.o
585 LIBS+= $(FDT_LIBS)
586 endif
588 # Boards
589 obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
591 # IO blocks
592 obj-cris-y += etraxfs_dma.o
593 obj-cris-y += etraxfs_pic.o
594 obj-cris-y += etraxfs_eth.o
595 obj-cris-y += etraxfs_timer.o
596 obj-cris-y += etraxfs_ser.o
598 obj-cris-y += pflash_cfi02.o
600 ifeq ($(TARGET_ARCH), sparc64)
601 obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
602 obj-sparc-y += fdc.o mc146818rtc.o serial.o
603 obj-sparc-y += cirrus_vga.o parallel.o
604 else
605 obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
606 obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
607 obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
608 endif
610 obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
611 obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
612 obj-arm-y += versatile_pci.o
613 obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
614 obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
615 obj-arm-y += pl061.o
616 obj-arm-y += arm-semi.o
617 obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
618 obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
619 obj-arm-y += pflash_cfi01.o gumstix.o
620 obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
621 obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
622 obj-arm-y += omap2.o omap_dss.o soc_dma.o
623 obj-arm-y += omap_sx1.o palm.o tsc210x.o
624 obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
625 obj-arm-y += mst_fpga.o mainstone.o
626 obj-arm-y += musicpal.o pflash_cfi02.o
627 obj-arm-y += framebuffer.o
628 obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
629 obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
630 obj-arm-y += syborg_virtio.o
632 ifeq ($(TARGET_BASE_ARCH), arm)
633 CPPFLAGS += -DHAS_AUDIO
634 endif
636 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
637 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
638 obj-sh4-y += ide.o
640 obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
641 obj-m68k-y += m68k-semi.o dummy_m68k.o
643 ifdef CONFIG_COCOA
644 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
645 ifdef CONFIG_COREAUDIO
646 COCOA_LIBS+=-framework CoreAudio
647 endif
648 endif
649 ifdef CONFIG_SLIRP
650 CPPFLAGS+=-I$(SRC_PATH)/slirp
651 endif
653 # specific flags are needed for non soft mmu emulator
654 ifdef CONFIG_STATIC
655 LDFLAGS+=-static
656 endif
657 ifndef CONFIG_DARWIN
658 ifndef CONFIG_WIN32
659 ifndef CONFIG_SOLARIS
660 ifndef CONFIG_AIX
661 LIBS+=-lutil
662 endif
663 endif
664 endif
665 endif
666 ifdef TARGET_GPROF
667 vl.o: CFLAGS+=-p
668 LDFLAGS+=-p
669 endif
671 ifeq ($(ARCH),ia64)
672 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
673 endif
675 ifdef CONFIG_WIN32
676 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
677 endif
679 # profiling code
680 ifdef TARGET_GPROF
681 LDFLAGS+=-p
682 main.o: CFLAGS+=-p
683 endif
685 vl.o: CFLAGS+=$(SDL_CFLAGS)
687 vl.o: qemu-options.h
689 monitor.o: qemu-monitor.h
691 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
692 $(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
693 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../libqemu_common.a libqemu.a $(HWLIB)
694         $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
696 endif # !CONFIG_USER_ONLY
698 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
699 ifeq ($(TARGET_XML_FILES),)
700         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
701 else
702         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
703 endif
705 qemu-options.h: $(SRC_PATH)/qemu-options.hx
706         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
708 qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
709         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
711 clean:
712         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
713         rm -f *.d */*.d tcg/*.o
714         rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
716 install: all
717 ifneq ($(PROGS),)
718         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
719 endif
721 # Include automatically generated dependency files
722 -include $(wildcard *.d */*.d)