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