Use signalfd() in io-thread
[qemu-kvm/fedora.git] / Makefile.target
blob46654f3a822feb180cb1fbf706de75eb6b21e07b
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 # op.c and helper.c need this on 32-bit x86 system to avoid
107 # a compiler spill error. This can probably go away
108 # once the SSE ops have been converted to TCG
109 ifeq ($(HAVE_GT_GCC_3_3), true)
110 I386_CFLAGS=-march=i586 -mtune=i686
111 endif
112 endif
114 ifeq ($(ARCH),ppc)
115 CPPFLAGS+= -D__powerpc__
116 endif
118 ifeq ($(ARCH),sparc)
119   CFLAGS+=-ffixed-g2 -ffixed-g3
120   OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
121   ifeq ($(CONFIG_SOLARIS),yes)
122     OP_CFLAGS+=-fno-omit-frame-pointer
123   else
124     CFLAGS+=-ffixed-g1 -ffixed-g6
125     HELPER_CFLAGS+=-ffixed-i0
126   endif
127 endif
129 ifeq ($(ARCH),sparc64)
130   CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
131   OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
132   ifneq ($(CONFIG_SOLARIS),yes)
133     OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
134   endif
135 endif
137 ifeq ($(ARCH),alpha)
138 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
139 # relocations for the constant constructions
140 # Ensure there's only a single GP
141 CFLAGS+=-msmall-data
142 endif
144 ifeq ($(ARCH),hppa)
145 OP_CFLAGS=-O1 -fno-delayed-branch
146 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
147 endif
149 ifeq ($(ARCH),ia64)
150 CFLAGS+=-mno-sdata
151 OP_CFLAGS+=-mno-sdata
152 endif
154 ifeq ($(ARCH),arm)
155 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
156 endif
158 ifeq ($(ARCH),m68k)
159 OP_CFLAGS+=-fomit-frame-pointer
160 endif
162 ifeq ($(ARCH),mips)
163 OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
164 endif
166 ifeq ($(ARCH),mips64)
167 OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
168 endif
170 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
171 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
172 OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
174 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__user=
175 LIBS+=-lm
176 ifdef CONFIG_WIN32
177 LIBS+=-lwinmm -lws2_32 -liphlpapi
178 endif
179 ifdef CONFIG_SOLARIS
180 LIBS+=-lsocket -lnsl -lresolv
181 ifdef NEEDS_LIBSUNMATH
182 LIBS+=-lsunmath
183 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
184 OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
185 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
186 endif
187 endif
189 all: $(PROGS)
191 #########################################################
192 # cpu emulator library
193 LIBOBJS=exec.o kqemu.o cpu-exec.o host-utils.o
195 ifeq ($(NO_CPU_EMULATION), 1)
196 LIBOBJS+=fake-exec.o
197 else
198 LIBOBJS+= translate-all.o translate.o
199 ifndef CONFIG_NO_DYNGEN_OP
200 LIBOBJS+=op.o
201 endif
202 # TCG code generator
203 LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
204 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
205 endif
206 ifeq ($(ARCH),sparc64)
207 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
208 endif
210 ifeq ($(USE_KVM), 1)
211 LIBOBJS+=qemu-kvm.o kvm-compatfd.o
212 endif
213 ifdef CONFIG_SOFTFLOAT
214 LIBOBJS+=fpu/softfloat.o
215 else
216 LIBOBJS+=fpu/softfloat-native.o
217 endif
218 CPPFLAGS+=-I$(SRC_PATH)/fpu
220 ifeq ($(TARGET_ARCH), i386)
221 LIBOBJS+=helper.o helper2.o
222 ifeq ($(USE_KVM), 1)
223 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
224 LIBOBJS+=qemu-kvm-helper.o
225 endif
226 endif
228 ifeq ($(TARGET_ARCH), x86_64)
229 LIBOBJS+=helper.o helper2.o
230 ifeq ($(USE_KVM), 1)
231 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
232 LIBOBJS+=qemu-kvm-helper.o
233 endif
234 endif
236 ifeq ($(TARGET_BASE_ARCH), ppc)
237 LIBOBJS+= op_helper.o helper.o
238 ifeq ($(USE_KVM), 1)
239 LIBOBJS+= qemu-kvm-powerpc.o
240 endif
241 endif
243 ifeq ($(TARGET_BASE_ARCH), mips)
244 LIBOBJS+= op_helper.o helper.o
245 endif
247 ifeq ($(TARGET_BASE_ARCH), sparc)
248 LIBOBJS+= op_helper.o helper.o
249 endif
251 ifeq ($(TARGET_BASE_ARCH), arm)
252 LIBOBJS+= op_helper.o helper.o neon_helper.o iwmmxt_helper.o
253 endif
255 ifeq ($(TARGET_BASE_ARCH), sh4)
256 LIBOBJS+= op_helper.o helper.o
257 endif
259 ifeq ($(TARGET_BASE_ARCH), m68k)
260 LIBOBJS+= op_helper.o helper.o
261 endif
263 ifeq ($(TARGET_BASE_ARCH), alpha)
264 LIBOBJS+= op_helper.o helper.o alpha_palcode.o
265 endif
267 ifeq ($(TARGET_BASE_ARCH), ia64)
268 LIBOBJS+=op_helper.o firmware.o
269 ifeq ($(USE_KVM), 1)
270 LIBOBJS+=qemu-kvm-ia64.o
271 endif
272 endif
274 ifeq ($(TARGET_BASE_ARCH), cris)
275 LIBOBJS+= op_helper.o helper.o
276 LIBOBJS+= cris-dis.o
278 ifndef CONFIG_USER_ONLY
279 LIBOBJS+= mmu.o
280 endif
281 endif
284 # NOTE: the disassembler code is only needed for debugging
285 LIBOBJS+=disas.o
286 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
287 USE_I386_DIS=y
288 endif
289 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
290 USE_I386_DIS=y
291 endif
292 ifdef USE_I386_DIS
293 LIBOBJS+=i386-dis.o
294 endif
295 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
296 LIBOBJS+=alpha-dis.o
297 endif
298 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
299 LIBOBJS+=ppc-dis.o
300 endif
301 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
302 LIBOBJS+=mips-dis.o
303 endif
304 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
305 LIBOBJS+=sparc-dis.o
306 endif
307 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
308 LIBOBJS+=arm-dis.o
309 endif
310 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
311 LIBOBJS+=m68k-dis.o
312 endif
313 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
314 LIBOBJS+=sh4-dis.o
315 endif
316 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
317 LIBOBJS+=hppa-dis.o
318 endif
319 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
320 LIBOBJS+=s390-dis.o
321 endif
323 # libqemu
325 ifndef CONFIG_NO_DYNGEN_OP
326 OPC_H = gen-op.h dyngen-opc.h op.h
327 endif
329 libqemu.a: $(LIBOBJS)
330         rm -f $@
331         $(AR) rcs $@ $(LIBOBJS)
333 translate.o: translate.c cpu.h $(OPC_H)
335 translate-all.o: translate-all.c cpu.h $(OPC_H)
337 tcg/tcg.o: cpu.h $(OPC_H)
339 tcg/tcg-dyngen.o: $(OPC_H)
341 tcg/tcg-runtime.o: $(OPC_H)
343 op.h: op.o $(DYNGEN)
344         $(DYNGEN) -o $@ $<
346 dyngen-opc.h: op.o $(DYNGEN)
347         $(DYNGEN) -c -o $@ $<
349 gen-op.h: op.o $(DYNGEN)
350         $(DYNGEN) -g -o $@ $<
352 op.o: op.c
353         $(CC) $(OP_CFLAGS) $(CPPFLAGS) $(I386_CFLAGS) -c -o $@ $<
355 machine.o: machine.c
356         $(CC) $(OP_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
358 # HELPER_CFLAGS is used for all the code compiled with static register
359 # variables
360 ifeq ($(TARGET_BASE_ARCH), i386)
361 # XXX: rename helper.c to op_helper.c
362 helper.o: helper.c
363         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $<
364 else
365 op_helper.o: op_helper.c
366         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
367 endif
369 cpu-exec.o: cpu-exec.c
370         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
372 qemu-kvm-helper.o: qemu-kvm-helper.c
373         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
375 #########################################################
376 # Linux user emulator target
378 ifdef CONFIG_LINUX_USER
380 ifndef TARGET_ABI_DIR
381   TARGET_ABI_DIR=$(TARGET_ARCH)
382 endif
383 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
384 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
386 ifdef CONFIG_STATIC
387 LDFLAGS+=-static
388 endif
390 ifeq ($(ARCH),i386)
391 ifdef TARGET_GPROF
392 USE_I386_LD=y
393 endif
394 ifdef CONFIG_STATIC
395 USE_I386_LD=y
396 endif
397 ifdef USE_I386_LD
398 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
399 else
400 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
401 # that the kernel ELF loader considers as an executable. I think this
402 # is the simplest way to make it self virtualizable!
403 LDFLAGS+=-Wl,-shared
404 endif
405 endif
407 ifeq ($(ARCH),x86_64)
408 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
409 endif
411 ifeq ($(ARCH),ppc)
412 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
413 endif
415 ifeq ($(ARCH),s390)
416 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
417 endif
419 ifeq ($(ARCH),sparc)
420 # -static is used to avoid g1/g3 usage by the dynamic linker    
421 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
422 endif
424 ifeq ($(ARCH),sparc64)
425 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
426 endif
428 ifeq ($(ARCH),alpha)
429 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
430 endif
432 ifeq ($(ARCH),ia64)
433 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
434 endif
436 ifeq ($(ARCH),arm)
437 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
438 endif
440 ifeq ($(ARCH),m68k)
441 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
442 endif
444 ifeq ($(ARCH),mips)
445 ifeq ($(WORDS_BIGENDIAN),yes)
446 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
447 else
448 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
449 endif
450 endif
452 ifeq ($(ARCH),mips64)
453 ifeq ($(WORDS_BIGENDIAN),yes)
454 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
455 else
456 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
457 endif
458 endif
460 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o \
461       elfload.o linuxload.o uaccess.o
462 LIBS+= $(AIOLIBS)
463 ifdef TARGET_HAS_BFLT
464 OBJS+= flatload.o
465 endif
466 ifdef TARGET_HAS_ELFLOAD32
467 OBJS+= elfload32.o
468 elfload32.o: elfload.c
469 endif
471 ifeq ($(TARGET_ARCH), i386)
472 OBJS+= vm86.o
473 endif
474 ifeq ($(TARGET_ARCH), arm)
475 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
476 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
477  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
478 endif
479 ifeq ($(TARGET_ARCH), m68k)
480 OBJS+= m68k-sim.o m68k-semi.o
481 endif
483 ifdef CONFIG_GDBSTUB
484 OBJS+=gdbstub.o
485 endif
487 OBJS+= libqemu.a
488 OBJS+= ../libqemu_common.a
490 # Note: this is a workaround. The real fix is to avoid compiling
491 # cpu_signal_handler() in cpu-exec.c.
492 signal.o: signal.c
493         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
495 $(QEMU_PROG): $(OBJS)
496         $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
497 ifeq ($(ARCH),alpha)
498 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
499 # the address space (31 bit so sign extending doesn't matter)
500         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
501 endif
503 endif #CONFIG_LINUX_USER
505 #########################################################
506 # Darwin user emulator target
508 ifdef CONFIG_DARWIN_USER
510 VPATH+=:$(SRC_PATH)/darwin-user
511 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
513 # Leave some space for the regular program loading zone
514 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
516 LIBS+=-lmx
518 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
520 OBJS+= libqemu.a
522 ifdef CONFIG_GDBSTUB
523 OBJS+=gdbstub.o
524 endif
526 # Note: this is a workaround. The real fix is to avoid compiling
527 # cpu_signal_handler() in cpu-exec.c.
528 signal.o: signal.c
529         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
531 $(QEMU_PROG): $(OBJS)
532         $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
534 endif #CONFIG_DARWIN_USER
536 #########################################################
537 # System emulator target
538 ifndef CONFIG_USER_ONLY
540 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o migration.o
541 ifdef CONFIG_WIN32
542 OBJS+=block-raw-win32.o
543 else
544 OBJS+=block-raw-posix.o
545 endif
547 LIBS+=-lz
548 ifdef CONFIG_ALSA
549 LIBS += -lasound
550 endif
551 ifdef CONFIG_ESD
552 LIBS += -lesd
553 endif
554 ifdef CONFIG_DSOUND
555 LIBS += -lole32 -ldxguid
556 endif
557 ifdef CONFIG_FMOD
558 LIBS += $(CONFIG_FMOD_LIB)
559 endif
561 SOUND_HW = sb16.o es1370.o
562 ifdef CONFIG_AC97
563 SOUND_HW += ac97.o
564 endif
565 ifdef CONFIG_ADLIB
566 SOUND_HW += fmopl.o adlib.o
567 endif
568 ifdef CONFIG_GUS
569 SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
570 endif
572 ifdef CONFIG_KVM_KERNEL_INC
573 CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
574 LIBS += -lkvm
575 DEPLIBS += ../libkvm/libkvm.a
576 endif
578 ifdef CONFIG_VNC_TLS
579 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
580 LIBS += $(CONFIG_VNC_TLS_LIBS)
581 endif
583 ifdef CONFIG_LIBFDT
584 LIBS += -lfdt
585 DEPLIBS += libfdt.a
586 endif
588 # SCSI layer
589 OBJS+= lsi53c895a.o esp.o
591 # USB layer
592 OBJS+= usb-ohci.o
594 # EEPROM emulation
595 OBJS += eeprom93xx.o
597 # PCI network cards
598 OBJS += eepro100.o
599 OBJS += ne2000.o
600 OBJS += pcnet.o
601 OBJS += rtl8139.o
602 OBJS += e1000.o
604 # PCI Hypercall
605 OBJS+= hypercall.o
607 # virtio devices
608 OBJS += virtio.o virtio-net.o virtio-blk.o
610 OBJS += device-hotplug.o
612 ifeq ($(TARGET_BASE_ARCH), i386)
613 # Hardware support
614 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
615 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
616 OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
617 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o extboot.o
618 ifeq ($(USE_KVM_PIT), 1)
619 OBJS+= i8254-kvm.o
620 endif
621 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
622 endif
623 ifeq ($(TARGET_BASE_ARCH), ia64)
624 # Hardware support
625 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
626 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o ipf.o
627 OBJS+= cirrus_vga.o parallel.o acpi.o piix_pci.o
628 OBJS+= usb-uhci.o smbus_eeprom.o
629 endif
630 ifeq ($(TARGET_BASE_ARCH), ppc)
631 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
632 # shared objects
633 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
634 OBJS+= cirrus_vga.o
635 # PREP target
636 OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
637 OBJS+= prep_pci.o ppc_prep.o
638 # Mac shared devices
639 OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
640 # OldWorld PowerMac
641 OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
642 # NewWorld PowerMac
643 OBJS+= unin_pci.o ppc_chrp.o
644 # PowerPC 4xx boards
645 OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
646 OBJS+= ppc440.o ppc440_bamboo.o device_tree.o
647 endif
648 ifeq ($(TARGET_BASE_ARCH), mips)
649 OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
650 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
651 OBJS+= g364fb.o jazz_led.o
652 OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
653 OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
654 OBJS+= mipsnet.o
655 OBJS+= pflash_cfi01.o
656 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
657 endif
658 ifeq ($(TARGET_BASE_ARCH), cris)
659 OBJS+= etraxfs.o
660 OBJS+= etraxfs_pic.o
661 OBJS+= etraxfs_timer.o
662 OBJS+= etraxfs_ser.o
664 OBJS+= ptimer.o
665 OBJS+= pflash_cfi01.o
666 endif
667 ifeq ($(TARGET_BASE_ARCH), sparc)
668 ifeq ($(TARGET_ARCH), sparc64)
669 OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
670 OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
671 OBJS+= cirrus_vga.o parallel.o ptimer.o
672 else
673 OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
674 OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o sparc32_dma.o
675 OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
676 endif
677 endif
678 ifeq ($(TARGET_BASE_ARCH), arm)
679 OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
680 OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
681 OBJS+= versatile_pci.o ptimer.o
682 OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
683 OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
684 OBJS+= pl061.o
685 OBJS+= arm-semi.o
686 OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
687 OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
688 OBJS+= pflash_cfi01.o gumstix.o
689 OBJS+= spitz.o ide.o serial.o nand.o ecc.o
690 OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
691 OBJS+= omap2.o omap_dss.o
692 OBJS+= palm.o tsc210x.o
693 OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
694 OBJS+= mst_fpga.o mainstone.o
695 OBJS+= musicpal.o pflash_cfi02.o
696 CPPFLAGS += -DHAS_AUDIO
697 endif
698 ifeq ($(TARGET_BASE_ARCH), sh4)
699 OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
700 OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
701 endif
702 ifeq ($(TARGET_BASE_ARCH), m68k)
703 OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
704 OBJS+= m68k-semi.o dummy_m68k.o
705 endif
706 ifdef CONFIG_GDBSTUB
707 OBJS+=gdbstub.o
708 endif
709 ifdef CONFIG_COCOA
710 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
711 ifdef CONFIG_COREAUDIO
712 COCOA_LIBS+=-framework CoreAudio
713 endif
714 endif
715 ifdef CONFIG_SLIRP
716 CPPFLAGS+=-I$(SRC_PATH)/slirp
717 endif
719 LIBS+=$(AIOLIBS)
720 # specific flags are needed for non soft mmu emulator
721 ifdef CONFIG_STATIC
722 LDFLAGS+=-static
723 endif
724 ifndef CONFIG_DARWIN
725 ifndef CONFIG_WIN32
726 ifndef CONFIG_SOLARIS
727 LIBS+=-lutil
728 endif
729 endif
730 endif
731 ifdef TARGET_GPROF
732 vl.o: CFLAGS+=-p
733 LDFLAGS+=-p
734 endif
736 ifeq ($(ARCH),ia64)
737 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
738 endif
740 ifdef CONFIG_WIN32
741 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
742 endif
744 # profiling code
745 ifdef TARGET_GPROF
746 LDFLAGS+=-p
747 main.o: CFLAGS+=-p
748 endif
749 ifeq ($(TARGET_ARCH), ia64)
750 firmware.o: firmware.c
751         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
752 endif
754 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
755         $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS)
757 endif # !CONFIG_USER_ONLY
759 %.o: %.c
760         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
762 %.o: %.S
763         $(CC) $(CPPFLAGS) -c -o $@ $<
765 clean:
766         rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o
767         rm -f *.d */*.d tcg/*.o
769 install: all
770 ifneq ($(PROGS),)
771         $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
772 endif
774 # Include automatically generated dependency files
775 -include $(wildcard *.d */*.d)