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