kvm: bios: provide _MAT to acpi processor
[qemu-kvm/fedora.git] / Makefile.target
blobd0cde5491d165de28cea35c037f8e03f3659c3c7
1 CFLAGS=
2 LDFLAGS=
4 include config.mak
6 LDFLAGS_BASE:=$(LDFLAGS)
7 TARGET_BASE_ARCH:=$(TARGET_ARCH)
8 ifeq ($(TARGET_ARCH), x86_64)
9 TARGET_BASE_ARCH:=i386
10 endif
11 ifeq ($(TARGET_ARCH), mipsn32)
12 TARGET_BASE_ARCH:=mips
13 endif
14 ifeq ($(TARGET_ARCH), mips64)
15 TARGET_BASE_ARCH:=mips
16 endif
17 ifeq ($(TARGET_ARCH), ppc64)
18 TARGET_BASE_ARCH:=ppc
19 endif
20 ifeq ($(TARGET_ARCH), ppc64h)
21 TARGET_BASE_ARCH:=ppc
22 endif
23 ifeq ($(TARGET_ARCH), ppcemb)
24 TARGET_BASE_ARCH:=ppc
25 endif
26 ifeq ($(TARGET_ARCH), sparc64)
27 TARGET_BASE_ARCH:=sparc
28 endif
29 ifeq ($(TARGET_ARCH), ia64)
30 TARGET_BASE_ARCH:=ia64
31 endif
32 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
33 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
34 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MP -DNEED_CPU_H
35 #CFLAGS+=-Werror
36 LIBS=
37 DYNGEN=../dyngen$(EXESUF)
38 # user emulator name
39 ifndef TARGET_ARCH2
40 TARGET_ARCH2=$(TARGET_ARCH)
41 endif
42 ifeq ($(TARGET_ARCH),arm)
43   ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
44     TARGET_ARCH2=armeb
45   endif
46 endif
47 ifeq ($(TARGET_ARCH),sh4)
48   ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
49     TARGET_ARCH2=sh4eb
50   endif
51 endif
52 ifeq ($(TARGET_ARCH),mips)
53   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
54     TARGET_ARCH2=mipsel
55   endif
56 endif
57 ifeq ($(TARGET_ARCH),mipsn32)
58   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
59     TARGET_ARCH2=mipsn32el
60   endif
61 endif
62 ifeq ($(TARGET_ARCH),mips64)
63   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
64     TARGET_ARCH2=mips64el
65   endif
66 endif
68 ifdef CONFIG_USER_ONLY
69 # user emulator name
70 QEMU_PROG=qemu-$(TARGET_ARCH2)
71 else
72 # system emulator name
73 ifeq ($(TARGET_ARCH), i386)
74 QEMU_PROG=qemu$(EXESUF)
75 else
76 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
77 endif
78 endif
80 PROGS=$(QEMU_PROG)
82 # We require -O2 to avoid the stack setup prologue in EXIT_TB
83 OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
85 # cc-option
86 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
88 cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
89               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
91 OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
92 OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
93 OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
94 OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
95 OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
96 OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
97 OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
98 OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
99 OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
101 HELPER_CFLAGS=
103 ifeq ($(ARCH),i386)
104 HELPER_CFLAGS+=-fomit-frame-pointer
105 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
106 endif
108 ifeq ($(ARCH),ppc)
109 CPPFLAGS+= -D__powerpc__
110 endif
112 ifeq ($(ARCH),sparc)
113   CFLAGS+=-ffixed-g2 -ffixed-g3
114   OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
115   ifeq ($(CONFIG_SOLARIS),yes)
116     OP_CFLAGS+=-fno-omit-frame-pointer
117   else
118     CFLAGS+=-ffixed-g1 -ffixed-g6
119     HELPER_CFLAGS+=-ffixed-i0
120   endif
121 endif
123 ifeq ($(ARCH),sparc64)
124   CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
125   OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
126   ifneq ($(CONFIG_SOLARIS),yes)
127     OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
128   endif
129 endif
131 ifeq ($(ARCH),alpha)
132 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
133 # relocations for the constant constructions
134 # Ensure there's only a single GP
135 CFLAGS+=-msmall-data
136 endif
138 ifeq ($(ARCH),ia64)
139 CFLAGS+=-mno-sdata
140 OP_CFLAGS+=-mno-sdata
141 endif
143 ifeq ($(ARCH),arm)
144 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
145 endif
147 ifeq ($(ARCH),m68k)
148 OP_CFLAGS+=-fomit-frame-pointer
149 endif
151 ifeq ($(ARCH),mips)
152 OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
153 endif
155 ifeq ($(ARCH),mips64)
156 OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
157 endif
159 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
160 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
161 OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
163 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__user=
164 LIBS+=-lm
165 ifdef CONFIG_WIN32
166 LIBS+=-lwinmm -lws2_32 -liphlpapi
167 endif
168 ifdef CONFIG_SOLARIS
169 LIBS+=-lsocket -lnsl -lresolv
170 ifdef NEEDS_LIBSUNMATH
171 LIBS+=-lsunmath
172 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
173 OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
174 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
175 endif
176 endif
178 all: $(PROGS)
180 #########################################################
181 # cpu emulator library
182 LIBOBJS=exec.o kqemu.o cpu-exec.o host-utils.o
184 ifeq ($(NO_CPU_EMULATION), 1)
185 LIBOBJS+=fake-exec.o
186 else
187 LIBOBJS+= translate-all.o translate.o op.o
188 # TCG code generator
189 LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
190 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
191 endif
193 ifeq ($(USE_KVM), 1)
194 LIBOBJS+=qemu-kvm.o
195 endif
196 ifdef CONFIG_SOFTFLOAT
197 LIBOBJS+=fpu/softfloat.o
198 else
199 LIBOBJS+=fpu/softfloat-native.o
200 endif
201 CPPFLAGS+=-I$(SRC_PATH)/fpu
203 ifeq ($(TARGET_ARCH), i386)
204 LIBOBJS+=helper.o helper2.o
205 ifeq ($(USE_KVM), 1)
206 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
207 LIBOBJS+=qemu-kvm-helper.o
208 endif
209 endif
211 ifeq ($(TARGET_ARCH), x86_64)
212 LIBOBJS+=helper.o helper2.o
213 ifeq ($(USE_KVM), 1)
214 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
215 LIBOBJS+=qemu-kvm-helper.o
216 endif
217 endif
219 ifeq ($(TARGET_BASE_ARCH), ppc)
220 LIBOBJS+= op_helper.o helper.o
221 ifeq ($(USE_KVM), 1)
222 LIBOBJS+= qemu-kvm-powerpc.o
223 endif
224 endif
226 ifeq ($(TARGET_BASE_ARCH), mips)
227 LIBOBJS+= op_helper.o helper.o
228 endif
230 ifeq ($(TARGET_BASE_ARCH), sparc)
231 LIBOBJS+= op_helper.o helper.o
232 endif
234 ifeq ($(TARGET_BASE_ARCH), arm)
235 LIBOBJS+= op_helper.o helper.o
236 endif
238 ifeq ($(TARGET_BASE_ARCH), sh4)
239 LIBOBJS+= op_helper.o helper.o
240 endif
242 ifeq ($(TARGET_BASE_ARCH), m68k)
243 LIBOBJS+= op_helper.o helper.o
244 endif
246 ifeq ($(TARGET_BASE_ARCH), alpha)
247 LIBOBJS+= op_helper.o helper.o alpha_palcode.o
248 endif
250 ifeq ($(TARGET_BASE_ARCH), ia64)
251 LIBOBJS+=op_helper.o firmware.o
252 ifeq ($(USE_KVM), 1)
253 LIBOBJS+=qemu-kvm-ia64.o
254 endif
255 endif
257 ifeq ($(TARGET_BASE_ARCH), cris)
258 LIBOBJS+= op_helper.o helper.o
259 LIBOBJS+= cris-dis.o
261 ifndef CONFIG_USER_ONLY
262 LIBOBJS+= mmu.o
263 endif
264 endif
267 # NOTE: the disassembler code is only needed for debugging
268 LIBOBJS+=disas.o
269 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
270 USE_I386_DIS=y
271 endif
272 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
273 USE_I386_DIS=y
274 endif
275 ifdef USE_I386_DIS
276 LIBOBJS+=i386-dis.o
277 endif
278 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
279 LIBOBJS+=alpha-dis.o
280 endif
281 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
282 LIBOBJS+=ppc-dis.o
283 endif
284 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
285 LIBOBJS+=mips-dis.o
286 endif
287 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
288 LIBOBJS+=sparc-dis.o
289 endif
290 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
291 LIBOBJS+=arm-dis.o
292 endif
293 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
294 LIBOBJS+=m68k-dis.o
295 endif
296 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
297 LIBOBJS+=sh4-dis.o
298 endif
299 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
300 LIBOBJS+=s390-dis.o
301 endif
303 # libqemu
305 OPC_H = gen-op.h dyngen-opc.h op.h
307 libqemu.a: $(LIBOBJS)
308         rm -f $@
309         $(AR) rcs $@ $(LIBOBJS)
311 translate.o: translate.c cpu.h $(OPC_H)
313 translate-all.o: translate-all.c cpu.h $(OPC_H)
315 tcg/tcg.o: cpu.h $(OPC_H)
317 tcg/tcg-dyngen.o: $(OPC_H)
319 tcg/tcg-runtime.o: $(OPC_H)
321 op.h: op.o $(DYNGEN)
322         $(DYNGEN) -o $@ $<
324 dyngen-opc.h: op.o $(DYNGEN)
325         $(DYNGEN) -c -o $@ $<
327 gen-op.h: op.o $(DYNGEN)
328         $(DYNGEN) -g -o $@ $<
330 op.o: op.c
331         $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
333 # HELPER_CFLAGS is used for all the code compiled with static register
334 # variables
335 ifeq ($(TARGET_BASE_ARCH), i386)
336 # XXX: rename helper.c to op_helper.c
337 helper.o: helper.c
338         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
339 else
340 op_helper.o: op_helper.c
341         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
342 endif
344 cpu-exec.o: cpu-exec.c
345         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
347 qemu-kvm-helper.o: qemu-kvm-helper.c
348         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
350 #########################################################
351 # Linux user emulator target
353 ifdef CONFIG_LINUX_USER
355 VPATH+=:$(SRC_PATH)/linux-user
356 ifndef TARGET_ABI_DIR
357   TARGET_ABI_DIR=$(TARGET_ARCH)
358 endif
359 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
361 ifdef CONFIG_STATIC
362 LDFLAGS+=-static
363 endif
365 ifeq ($(ARCH),i386)
366 ifdef TARGET_GPROF
367 USE_I386_LD=y
368 endif
369 ifdef CONFIG_STATIC
370 USE_I386_LD=y
371 endif
372 ifdef USE_I386_LD
373 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
374 else
375 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
376 # that the kernel ELF loader considers as an executable. I think this
377 # is the simplest way to make it self virtualizable!
378 LDFLAGS+=-Wl,-shared
379 endif
380 endif
382 ifeq ($(ARCH),x86_64)
383 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
384 endif
386 ifeq ($(ARCH),ppc)
387 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
388 endif
390 ifeq ($(ARCH),s390)
391 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
392 endif
394 ifeq ($(ARCH),sparc)
395 # -static is used to avoid g1/g3 usage by the dynamic linker    
396 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
397 endif
399 ifeq ($(ARCH),sparc64)
400 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
401 endif
403 ifeq ($(ARCH),alpha)
404 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
405 endif
407 ifeq ($(ARCH),ia64)
408 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
409 endif
411 ifeq ($(ARCH),arm)
412 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
413 endif
415 ifeq ($(ARCH),m68k)
416 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
417 endif
419 ifeq ($(ARCH),mips)
420 ifeq ($(WORDS_BIGENDIAN),yes)
421 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
422 else
423 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
424 endif
425 endif
427 ifeq ($(ARCH),mips64)
428 ifeq ($(WORDS_BIGENDIAN),yes)
429 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
430 else
431 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
432 endif
433 endif
435 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o \
436       elfload.o linuxload.o uaccess.o
437 LIBS+= $(AIOLIBS)
438 ifdef TARGET_HAS_BFLT
439 OBJS+= flatload.o
440 endif
441 ifdef TARGET_HAS_ELFLOAD32
442 OBJS+= elfload32.o
443 elfload32.o: elfload.c
444 endif
446 ifeq ($(TARGET_ARCH), i386)
447 OBJS+= vm86.o
448 endif
449 ifeq ($(TARGET_ARCH), arm)
450 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
451 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
452  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
453 endif
454 ifeq ($(TARGET_ARCH), m68k)
455 OBJS+= m68k-sim.o m68k-semi.o
456 endif
458 ifdef CONFIG_GDBSTUB
459 OBJS+=gdbstub.o
460 endif
462 OBJS+= libqemu.a
464 # Note: this is a workaround. The real fix is to avoid compiling
465 # cpu_signal_handler() in cpu-exec.c.
466 signal.o: signal.c
467         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
469 $(QEMU_PROG): $(OBJS)
470         $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
471 ifeq ($(ARCH),alpha)
472 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
473 # the address space (31 bit so sign extending doesn't matter)
474         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
475 endif
477 endif #CONFIG_LINUX_USER
479 #########################################################
480 # Darwin user emulator target
482 ifdef CONFIG_DARWIN_USER
484 VPATH+=:$(SRC_PATH)/darwin-user
485 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
487 # Leave some space for the regular program loading zone
488 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
490 LIBS+=-lmx
492 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
494 OBJS+= libqemu.a
496 ifdef CONFIG_GDBSTUB
497 OBJS+=gdbstub.o
498 endif
500 # Note: this is a workaround. The real fix is to avoid compiling
501 # cpu_signal_handler() in cpu-exec.c.
502 signal.o: signal.c
503         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
505 $(QEMU_PROG): $(OBJS)
506         $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
508 endif #CONFIG_DARWIN_USER
510 #########################################################
511 # System emulator target
512 ifndef CONFIG_USER_ONLY
514 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o migration.o
515 ifdef CONFIG_WIN32
516 OBJS+=block-raw-win32.o
517 else
518 OBJS+=block-raw-posix.o
519 endif
521 LIBS+=-lz
522 ifdef CONFIG_ALSA
523 LIBS += -lasound
524 endif
525 ifdef CONFIG_ESD
526 LIBS += -lesd
527 endif
528 ifdef CONFIG_DSOUND
529 LIBS += -lole32 -ldxguid
530 endif
531 ifdef CONFIG_FMOD
532 LIBS += $(CONFIG_FMOD_LIB)
533 endif
535 SOUND_HW = sb16.o es1370.o
536 ifdef CONFIG_AC97
537 SOUND_HW += ac97.o
538 endif
539 ifdef CONFIG_ADLIB
540 SOUND_HW += fmopl.o adlib.o
541 endif
542 ifdef CONFIG_GUS
543 SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
544 endif
546 ifdef CONFIG_KVM_KERNEL_INC
547 CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
548 LIBS += -lkvm
549 DEPLIBS += ../libkvm/libkvm.a
550 endif
552 ifdef CONFIG_VNC_TLS
553 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
554 LIBS += $(CONFIG_VNC_TLS_LIBS)
555 endif
557 # SCSI layer
558 OBJS+= lsi53c895a.o
560 # USB layer
561 OBJS+= usb-ohci.o
563 # EEPROM emulation
564 OBJS += eeprom93xx.o
566 # PCI network cards
567 OBJS += eepro100.o
568 OBJS += ne2000.o
569 OBJS += pcnet.o
570 OBJS += rtl8139.o
571 OBJS += e1000.o
573 # PCI Hypercall
574 OBJS+= hypercall.o
576 # virtio devices
577 OBJS += virtio.o virtio-net.o virtio-blk.o
579 ifeq ($(TARGET_BASE_ARCH), i386)
580 # Hardware support
581 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
582 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
583 OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
584 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o extboot.o
585 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
586 endif
587 ifeq ($(TARGET_BASE_ARCH), ia64)
588 # Hardware support
589 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
590 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o ipf.o
591 OBJS+= cirrus_vga.o parallel.o acpi.o piix_pci.o
592 OBJS+= usb-uhci.o smbus_eeprom.o
593 endif
594 ifeq ($(TARGET_BASE_ARCH), ppc)
595 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
596 # shared objects
597 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
598 OBJS+= cirrus_vga.o
599 # PREP target
600 OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
601 OBJS+= prep_pci.o ppc_prep.o
602 # Mac shared devices
603 OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
604 # OldWorld PowerMac
605 OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
606 # NewWorld PowerMac
607 OBJS+= unin_pci.o ppc_chrp.o
608 # PowerPC 4xx boards
609 OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
610 OBJS+= ppc440.o ppc440_bamboo.o
611 endif
612 ifeq ($(TARGET_BASE_ARCH), mips)
613 OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
614 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
615 OBJS+= jazz_led.o
616 OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
617 OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
618 OBJS+= mipsnet.o
619 OBJS+= pflash_cfi01.o
620 CPPFLAGS += -DHAS_AUDIO
621 endif
622 ifeq ($(TARGET_BASE_ARCH), cris)
623 OBJS+= etraxfs.o
624 OBJS+= ptimer.o
625 OBJS+= etraxfs_timer.o
626 OBJS+= etraxfs_ser.o
627 endif
628 ifeq ($(TARGET_BASE_ARCH), sparc)
629 ifeq ($(TARGET_ARCH), sparc64)
630 OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
631 OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
632 OBJS+= cirrus_vga.o parallel.o ptimer.o
633 else
634 OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
635 OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
636 OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
637 endif
638 endif
639 ifeq ($(TARGET_BASE_ARCH), arm)
640 OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
641 OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
642 OBJS+= versatile_pci.o ptimer.o
643 OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
644 OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
645 OBJS+= pl061.o
646 OBJS+= arm-semi.o
647 OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
648 OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
649 OBJS+= pflash_cfi01.o gumstix.o
650 OBJS+= spitz.o ide.o serial.o nand.o ecc.o
651 OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
652 OBJS+= palm.o tsc210x.o
653 OBJS+= mst_fpga.o mainstone.o
654 CPPFLAGS += -DHAS_AUDIO
655 endif
656 ifeq ($(TARGET_BASE_ARCH), sh4)
657 OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
658 OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
659 endif
660 ifeq ($(TARGET_BASE_ARCH), m68k)
661 OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
662 OBJS+= m68k-semi.o dummy_m68k.o
663 endif
664 ifdef CONFIG_GDBSTUB
665 OBJS+=gdbstub.o
666 endif
667 ifdef CONFIG_COCOA
668 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
669 ifdef CONFIG_COREAUDIO
670 COCOA_LIBS+=-framework CoreAudio
671 endif
672 endif
673 ifdef CONFIG_SLIRP
674 CPPFLAGS+=-I$(SRC_PATH)/slirp
675 endif
677 LIBS+=$(AIOLIBS)
678 # specific flags are needed for non soft mmu emulator
679 ifdef CONFIG_STATIC
680 LDFLAGS+=-static
681 endif
682 ifndef CONFIG_DARWIN
683 ifndef CONFIG_WIN32
684 ifndef CONFIG_SOLARIS
685 LIBS+=-lutil
686 endif
687 endif
688 endif
689 ifdef TARGET_GPROF
690 vl.o: CFLAGS+=-p
691 LDFLAGS+=-p
692 endif
694 ifeq ($(ARCH),ia64)
695 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
696 endif
698 ifdef CONFIG_WIN32
699 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
700 endif
702 # profiling code
703 ifdef TARGET_GPROF
704 LDFLAGS+=-p
705 main.o: CFLAGS+=-p
706 endif
707 ifeq ($(TARGET_ARCH), ia64)
708 firmware.o: firmware.c
709         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
710 endif
712 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
713         $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS)
715 endif # !CONFIG_USER_ONLY
717 %.o: %.c
718         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
720 %.o: %.S
721         $(CC) $(CPPFLAGS) -c -o $@ $<
723 clean:
724         rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o
725         rm -f *.d */*.d tcg/*.o
727 install: all
728 ifneq ($(PROGS),)
729         $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
730 endif
732 # Include automatically generated dependency files
733 -include $(wildcard *.d */*.d)