Merge commit 'garage/master'
[qemu] / Makefile.target
1 include config.mak
2 include $(SRC_PATH)/rules.mak
3
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
60
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
72
73 PROGS=$(QEMU_PROG)
74
75 # cc-option
76 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
77
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 ;)
80
81 HELPER_CFLAGS=
82
83 ifeq ($(ARCH),i386)
84 HELPER_CFLAGS+=-fomit-frame-pointer
85 endif
86
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
90
91 ifeq ($(ARCH),sparc)
92   ifneq ($(CONFIG_SOLARIS),yes)
93     HELPER_CFLAGS+=-ffixed-i0
94   endif
95 endif
96
97 ifeq ($(ARCH),alpha)
98 # Ensure there's only a single GP
99 CFLAGS+=-msmall-data
100 endif
101
102 ifeq ($(ARCH),hppa)
103 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
104 endif
105
106 ifeq ($(ARCH),ia64)
107 CFLAGS+=-mno-sdata
108 endif
109
110 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
111 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
112
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
126
127 kvm.o: CFLAGS+=$(KVM_CFLAGS)
128 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
129
130 all: $(PROGS)
131
132 #########################################################
133 # cpu emulator library
134 LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
135         translate.o host-utils.o
136 # TCG code generator
137 LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
138 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
139 ifeq ($(ARCH),sparc64)
140 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
141 endif
142 ifdef CONFIG_SOFTFLOAT
143 LIBOBJS+=fpu/softfloat.o
144 else
145 LIBOBJS+=fpu/softfloat-native.o
146 endif
147 CPPFLAGS+=-I$(SRC_PATH)/fpu
148 LIBOBJS+= op_helper.o helper.o
149
150 ifeq ($(TARGET_BASE_ARCH), arm)
151 LIBOBJS+= neon_helper.o iwmmxt_helper.o
152 endif
153
154 ifeq ($(TARGET_BASE_ARCH), alpha)
155 LIBOBJS+= alpha_palcode.o
156 endif
157
158 ifeq ($(TARGET_BASE_ARCH), cris)
159 LIBOBJS+= cris-dis.o
160
161 ifndef CONFIG_USER_ONLY
162 LIBOBJS+= mmu.o
163 endif
164 endif
165
166 # NOTE: the disassembler code is only needed for debugging
167 LIBOBJS+=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 ifdef USE_I386_DIS
175 LIBOBJS+=i386-dis.o
176 endif
177 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
178 LIBOBJS+=alpha-dis.o
179 endif
180 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
181 LIBOBJS+=ppc-dis.o
182 endif
183 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
184 LIBOBJS+=mips-dis.o
185 endif
186 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
187 LIBOBJS+=sparc-dis.o
188 endif
189 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
190 LIBOBJS+=arm-dis.o
191 endif
192 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
193 LIBOBJS+=m68k-dis.o
194 endif
195 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
196 LIBOBJS+=sh4-dis.o
197 endif
198 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
199 LIBOBJS+=hppa-dis.o
200 endif
201 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
202 LIBOBJS+=s390-dis.o
203 endif
204
205 # libqemu
206
207 libqemu.a: $(LIBOBJS)
208
209 translate.o: translate.c cpu.h
210
211 translate-all.o: translate-all.c cpu.h
212
213 tcg/tcg.o: cpu.h
214
215 # HELPER_CFLAGS is used for all the code compiled with static register
216 # variables
217 op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
218
219 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
220
221 #########################################################
222 # Linux user emulator target
223
224 ifdef CONFIG_LINUX_USER
225
226 ifndef TARGET_ABI_DIR
227   TARGET_ABI_DIR=$(TARGET_ARCH)
228 endif
229 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
230 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
231
232 #sbox hack
233 ifdef CONFIG_STATIC
234 LDFLAGS+=-static -L/scratchbox/tools/lib
235 LIBS+=-lsb -ldl
236 endif
237
238 ifeq ($(ARCH),i386)
239 ifdef TARGET_GPROF
240 USE_I386_LD=y
241 endif
242 ifdef CONFIG_STATIC
243 USE_I386_LD=y
244 endif
245 ifdef USE_I386_LD
246 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
247 else
248 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
249 # that the kernel ELF loader considers as an executable. I think this
250 # is the simplest way to make it self virtualizable!
251 LDFLAGS+=-Wl,-shared
252 endif
253 endif
254
255 ifeq ($(ARCH),x86_64)
256 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
257 endif
258
259 ifeq ($(ARCH),ppc)
260 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
261 endif
262
263 ifeq ($(ARCH),ppc64)
264 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
265 endif
266
267 ifeq ($(ARCH),s390)
268 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
269 endif
270
271 ifeq ($(ARCH),sparc)
272 # -static is used to avoid g1/g3 usage by the dynamic linker    
273 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
274 endif
275
276 ifeq ($(ARCH),sparc64)
277 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
278 endif
279
280 ifeq ($(ARCH),alpha)
281 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
282 endif
283
284 ifeq ($(ARCH),ia64)
285 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
286 endif
287
288 ifeq ($(ARCH),arm)
289 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
290 endif
291
292 ifeq ($(ARCH),m68k)
293 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
294 endif
295
296 ifeq ($(ARCH),mips)
297 ifeq ($(WORDS_BIGENDIAN),yes)
298 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
299 else
300 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
301 endif
302 endif
303
304 ifeq ($(ARCH),mips64)
305 ifeq ($(WORDS_BIGENDIAN),yes)
306 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
307 else
308 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
309 endif
310 endif
311
312 # profiling code
313 ifdef TARGET_GPROF
314 LDFLAGS+=-p
315 CFLAGS+=-p
316 endif
317
318 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
319       elfload.o linuxload.o uaccess.o envlist.o
320 LIBS+= $(AIOLIBS)
321 ifdef TARGET_HAS_BFLT
322 OBJS+= flatload.o
323 endif
324 ifdef TARGET_HAS_ELFLOAD32
325 OBJS+= elfload32.o
326 elfload32.o: elfload.c
327 endif
328
329 ifeq ($(TARGET_ARCH), i386)
330 OBJS+= vm86.o
331 endif
332 ifeq ($(TARGET_ARCH), arm)
333 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
334 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
335  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
336 endif
337 ifeq ($(TARGET_ARCH), m68k)
338 OBJS+= m68k-sim.o m68k-semi.o
339 endif
340
341 ifdef CONFIG_GDBSTUB
342 OBJS+=gdbstub.o gdbstub-xml.o
343 endif
344
345 OBJS+= libqemu.a
346
347 # Note: this is a workaround. The real fix is to avoid compiling
348 # cpu_signal_handler() in cpu-exec.c.
349 signal.o: CFLAGS += $(HELPER_CFLAGS)
350
351 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
352         $(LINK)
353 ifeq ($(ARCH),alpha)
354 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
355 # the address space (31 bit so sign extending doesn't matter)
356         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
357 endif
358
359 endif #CONFIG_LINUX_USER
360
361 #########################################################
362 # Darwin user emulator target
363
364 ifdef CONFIG_DARWIN_USER
365
366 VPATH+=:$(SRC_PATH)/darwin-user
367 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
368
369 # Leave some space for the regular program loading zone
370 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
371
372 LIBS+=-lmx
373
374 OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
375
376 OBJS+= libqemu.a
377
378 ifdef CONFIG_GDBSTUB
379 OBJS+=gdbstub.o gdbstub-xml.o
380 endif
381
382 # Note: this is a workaround. The real fix is to avoid compiling
383 # cpu_signal_handler() in cpu-exec.c.
384 signal.o: CFLAGS += $(HELPER_CFLAGS)
385
386 $(QEMU_PROG): $(OBJS)
387         $(LINK)
388
389 endif #CONFIG_DARWIN_USER
390
391 #########################################################
392 # BSD user emulator target
393
394 ifdef CONFIG_BSD_USER
395
396 VPATH+=:$(SRC_PATH)/bsd-user
397 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
398
399 ifdef CONFIG_STATIC
400 LDFLAGS+=-static
401 endif
402
403 ifeq ($(ARCH),i386)
404 ifdef TARGET_GPROF
405 USE_I386_LD=y
406 endif
407 ifdef CONFIG_STATIC
408 USE_I386_LD=y
409 endif
410 ifdef USE_I386_LD
411 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
412 else
413 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
414 # that the kernel ELF loader considers as an executable. I think this
415 # is the simplest way to make it self virtualizable!
416 LDFLAGS+=-Wl,-shared
417 endif
418 endif
419
420 ifeq ($(ARCH),x86_64)
421 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
422 endif
423
424 ifeq ($(ARCH),ppc)
425 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
426 endif
427
428 ifeq ($(ARCH),ppc64)
429 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
430 endif
431
432 ifeq ($(ARCH),s390)
433 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
434 endif
435
436 ifeq ($(ARCH),sparc)
437 # -static is used to avoid g1/g3 usage by the dynamic linker
438 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
439 endif
440
441 ifeq ($(ARCH),sparc64)
442 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
443 endif
444
445 ifeq ($(ARCH),alpha)
446 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
447 endif
448
449 ifeq ($(ARCH),ia64)
450 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
451 endif
452
453 ifeq ($(ARCH),arm)
454 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
455 endif
456
457 ifeq ($(ARCH),m68k)
458 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
459 endif
460
461 ifeq ($(ARCH),mips)
462 ifeq ($(WORDS_BIGENDIAN),yes)
463 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
464 else
465 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
466 endif
467 endif
468
469 ifeq ($(ARCH),mips64)
470 ifeq ($(WORDS_BIGENDIAN),yes)
471 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
472 else
473 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
474 endif
475 endif
476
477 OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
478 OBJS+= uaccess.o
479
480 OBJS+= libqemu.a
481
482 ifdef CONFIG_GDBSTUB
483 OBJS+=gdbstub.o
484 endif
485
486 # Note: this is a workaround. The real fix is to avoid compiling
487 # cpu_signal_handler() in cpu-exec.c.
488 signal.o: CFLAGS += $(HELPER_CFLAGS)
489
490 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
491         $(LINK)
492
493 endif #CONFIG_BSD_USER
494
495 #########################################################
496 # System emulator target
497 ifndef CONFIG_USER_ONLY
498
499 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o dma-helpers.o
500 # virtio has to be here due to weird dependency between PCI and virtio-net.
501 # need to fix this properly
502 OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
503 OBJS+=fw_cfg.o
504 ifdef CONFIG_KVM
505 OBJS+=kvm.o kvm-all.o
506 endif
507 ifdef CONFIG_WIN32
508 OBJS+=block-raw-win32.o
509 else
510 ifdef CONFIG_AIO
511 OBJS+=posix-aio-compat.o
512 endif
513 OBJS+=block-raw-posix.o
514 endif
515
516 LIBS+=-lz
517 ifdef CONFIG_ALSA
518 LIBS += -lasound
519 endif
520 ifdef CONFIG_ESD
521 LIBS += -lesd
522 endif
523 ifdef CONFIG_PA
524 LIBS += -lpulse-simple
525 endif
526 ifdef CONFIG_DSOUND
527 LIBS += -lole32 -ldxguid
528 endif
529 ifdef CONFIG_FMOD
530 LIBS += $(CONFIG_FMOD_LIB)
531 endif
532 ifdef CONFIG_OSS
533 LIBS += $(CONFIG_OSS_LIB)
534 endif
535
536 SOUND_HW = sb16.o es1370.o ac97.o
537 ifdef CONFIG_ADLIB
538 SOUND_HW += fmopl.o adlib.o
539 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
540 endif
541 ifdef CONFIG_GUS
542 SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
543 endif
544 ifdef CONFIG_CS4231A
545 SOUND_HW += cs4231a.o
546 endif
547
548 ifdef CONFIG_VNC_TLS
549 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
550 LIBS += $(CONFIG_VNC_TLS_LIBS)
551 endif
552
553 ifdef CONFIG_VNC_SASL
554 CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
555 LIBS += $(CONFIG_VNC_SASL_LIBS)
556 endif
557
558 ifdef CONFIG_BLUEZ
559 LIBS += $(CONFIG_BLUEZ_LIBS)
560 endif
561
562 # SCSI layer
563 OBJS+= lsi53c895a.o esp.o
564
565 # USB layer
566 OBJS+= usb-ohci.o
567
568 # EEPROM emulation
569 OBJS += eeprom93xx.o
570
571 # PCI network cards
572 OBJS += eepro100.o
573 OBJS += ne2000.o
574 OBJS += pcnet.o
575 OBJS += rtl8139.o
576 OBJS += e1000.o
577
578 # Serial mouse
579 OBJS += msmouse.o
580
581 ifeq ($(TARGET_BASE_ARCH), i386)
582 # Hardware support
583 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
584 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
585 OBJS+= cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
586 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
587 OBJS += device-hotplug.o pci-hotplug.o
588 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
589 endif
590 ifeq ($(TARGET_BASE_ARCH), ppc)
591 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
592 # shared objects
593 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
594 # PREP target
595 OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
596 OBJS+= prep_pci.o ppc_prep.o
597 # Mac shared devices
598 OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
599 # OldWorld PowerMac
600 OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
601 # NewWorld PowerMac
602 OBJS+= unin_pci.o ppc_newworld.o
603 # PowerPC 4xx boards
604 OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
605 OBJS+= ppc440.o ppc440_bamboo.o
606 # PowerPC E500 boards
607 OBJS+= ppce500_pci.o ppce500_mpc8544ds.o
608 ifdef FDT_LIBS
609 OBJS+= device_tree.o
610 LIBS+= $(FDT_LIBS)
611 endif
612 ifdef CONFIG_KVM
613 OBJS+= kvm_ppc.o
614 endif
615 endif
616 ifeq ($(TARGET_BASE_ARCH), mips)
617 OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
618 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
619 OBJS+= g364fb.o jazz_led.o
620 OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
621 OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
622 OBJS+= mipsnet.o
623 OBJS+= pflash_cfi01.o
624 OBJS+= vmware_vga.o
625 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
626 endif
627 ifeq ($(TARGET_BASE_ARCH), cris)
628 # Boards
629 OBJS+= etraxfs.o axis_dev88.o
630
631 # IO blocks
632 OBJS+= etraxfs_dma.o
633 OBJS+= etraxfs_pic.o
634 OBJS+= etraxfs_eth.o
635 OBJS+= etraxfs_timer.o
636 OBJS+= etraxfs_ser.o
637
638 OBJS+= ptimer.o
639 OBJS+= pflash_cfi02.o nand.o
640 endif
641 ifeq ($(TARGET_BASE_ARCH), sparc)
642 ifeq ($(TARGET_ARCH), sparc64)
643 OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
644 OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
645 OBJS+= cirrus_vga.o parallel.o ptimer.o
646 else
647 OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
648 OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
649 OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
650 endif
651 endif
652 ifeq ($(TARGET_BASE_ARCH), arm)
653 OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
654 OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
655 OBJS+= versatile_pci.o ptimer.o
656 OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
657 OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
658 OBJS+= pl061.o
659 OBJS+= arm-semi.o
660 OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
661 OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
662 OBJS+= pflash_cfi01.o gumstix.o
663 OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
664 OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
665 OBJS+= omap2.o omap_dss.o soc_dma.o omap_spi.o
666 OBJS+= omap3.o omap3_boot.o omap3_mmc.o omap3_usb.o beagle.o twl4030.o
667 OBJS+= omap_sx1.o palm.o tsc210x.o
668 OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
669 OBJS+= tsc2005.o bt-hci-csr.o
670 OBJS+= mst_fpga.o mainstone.o
671 OBJS+= musicpal.o pflash_cfi02.o
672 OBJS+= framebuffer.o
673 CPPFLAGS += -DHAS_AUDIO
674 endif
675 ifeq ($(TARGET_BASE_ARCH), sh4)
676 OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
677 OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
678 OBJS+= ide.o
679 endif
680 ifeq ($(TARGET_BASE_ARCH), m68k)
681 OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
682 OBJS+= m68k-semi.o dummy_m68k.o
683 endif
684 ifdef CONFIG_GDBSTUB
685 OBJS+=gdbstub.o gdbstub-xml.o
686 endif
687 ifdef CONFIG_COCOA
688 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
689 ifdef CONFIG_COREAUDIO
690 COCOA_LIBS+=-framework CoreAudio
691 endif
692 endif
693 ifdef CONFIG_SLIRP
694 CPPFLAGS+=-I$(SRC_PATH)/slirp
695 endif
696
697 LIBS+=$(AIOLIBS)
698 # specific flags are needed for non soft mmu emulator
699 ifdef CONFIG_STATIC
700 LDFLAGS+=-static
701 endif
702 ifndef CONFIG_DARWIN
703 ifndef CONFIG_WIN32
704 ifndef CONFIG_SOLARIS
705 ifndef CONFIG_AIX
706 LIBS+=-lutil
707 endif
708 endif
709 endif
710 endif
711 ifdef TARGET_GPROF
712 vl.o: CFLAGS+=-p
713 LDFLAGS+=-p
714 endif
715
716 ifeq ($(ARCH),ia64)
717 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
718 endif
719
720 ifdef CONFIG_WIN32
721 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
722 endif
723
724 # profiling code
725 ifdef TARGET_GPROF
726 LDFLAGS+=-p
727 main.o: CFLAGS+=-p
728 endif
729
730 vl.o: qemu-options.h
731
732 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
733
734 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
735         $(LINK)
736
737 endif # !CONFIG_USER_ONLY
738
739 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
740 ifeq ($(TARGET_XML_FILES),)
741         $(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
742 else
743         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
744 endif
745
746 qemu-options.h: $(SRC_PATH)/qemu-options.hx
747         $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
748
749 clean:
750         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o qemu-options.h gdbstub-xml.c
751         rm -f *.d */*.d tcg/*.o
752
753 install: all
754 ifneq ($(PROGS),)
755         $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
756 endif
757
758 # Include automatically generated dependency files
759 -include $(wildcard *.d */*.d)