kvm: external module: fix pre-2.6.27 UP kernels
[qemu-kvm/fedora.git] / Makefile.target
blob308191b7ac656f9f7c0e5c3d9531e4d3b71c706a
1 CFLAGS=
2 LDFLAGS=
4 include config.mak
5 include $(SRC_PATH)/rules.mak
7 LDFLAGS_BASE:=$(LDFLAGS)
8 TARGET_BASE_ARCH:=$(TARGET_ARCH)
9 ifeq ($(TARGET_ARCH), x86_64)
10 TARGET_BASE_ARCH:=i386
11 endif
12 ifeq ($(TARGET_ARCH), mipsn32)
13 TARGET_BASE_ARCH:=mips
14 endif
15 ifeq ($(TARGET_ARCH), mips64)
16 TARGET_BASE_ARCH:=mips
17 endif
18 ifeq ($(TARGET_ARCH), ppc64)
19 TARGET_BASE_ARCH:=ppc
20 endif
21 ifeq ($(TARGET_ARCH), ppc64h)
22 TARGET_BASE_ARCH:=ppc
23 endif
24 ifeq ($(TARGET_ARCH), ppcemb)
25 TARGET_BASE_ARCH:=ppc
26 endif
27 ifeq ($(TARGET_ARCH), sparc64)
28 TARGET_BASE_ARCH:=sparc
29 endif
30 ifeq ($(TARGET_ARCH), ia64)
31 TARGET_BASE_ARCH:=ia64
32 endif
33 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
34 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
35 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
36 #CFLAGS+=-Werror
37 LIBS=
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 # cc-option
83 # Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
85 cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
86               > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
88 HELPER_CFLAGS=
90 ifeq ($(ARCH),i386)
91 HELPER_CFLAGS+=-fomit-frame-pointer
92 endif
94 ifeq ($(ARCH),sparc)
95   CFLAGS+=-ffixed-g2 -ffixed-g3
96   ifneq ($(CONFIG_SOLARIS),yes)
97     CFLAGS+=-ffixed-g1 -ffixed-g6
98     HELPER_CFLAGS+=-ffixed-i0
99   endif
100 endif
102 ifeq ($(ARCH),sparc64)
103   ifneq ($(CONFIG_SOLARIS),yes)
104     CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
105   else
106     CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
107   endif
108 endif
110 ifeq ($(ARCH),alpha)
111 # Ensure there's only a single GP
112 CFLAGS+=-msmall-data
113 endif
115 ifeq ($(ARCH),hppa)
116 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
117 endif
119 ifeq ($(ARCH),ia64)
120 CFLAGS+=-mno-sdata
121 endif
123 CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
124 LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
126 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__user=
127 LIBS+=-lm
128 ifdef CONFIG_WIN32
129 LIBS+=-lwinmm -lws2_32 -liphlpapi
130 endif
131 ifdef CONFIG_SOLARIS
132 LIBS+=-lsocket -lnsl -lresolv
133 ifdef NEEDS_LIBSUNMATH
134 LIBS+=-lsunmath
135 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
136 CFLAGS+=-I/opt/SUNWspro/prod/include/cc
137 endif
138 endif
140 kvm.o: CFLAGS+=$(KVM_CFLAGS)
141 kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
143 all: $(PROGS)
145 #########################################################
146 # cpu emulator library
147 LIBOBJS=exec.o kqemu.o cpu-exec.o host-utils.o
149 ifeq ($(NO_CPU_EMULATION), 1)
150 LIBOBJS+=fake-exec.o
151 else
152 LIBOBJS+= translate-all.o translate.o
153 # TCG code generator
154 LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
155 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
156 endif
157 ifeq ($(ARCH),sparc64)
158 CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
159 endif
161 ifeq ($(USE_KVM), 1)
162 LIBOBJS+=qemu-kvm.o
163 endif
164 ifdef CONFIG_SOFTFLOAT
165 LIBOBJS+=fpu/softfloat.o
166 else
167 LIBOBJS+=fpu/softfloat-native.o
168 endif
169 CPPFLAGS+=-I$(SRC_PATH)/fpu
170 LIBOBJS+= op_helper.o helper.o
172 ifeq ($(TARGET_ARCH), i386)
173 LIBOBJS+=helper.o
174 ifeq ($(USE_KVM), 1)
175 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
176 LIBOBJS+=qemu-kvm-helper.o
177 endif
178 endif
180 ifeq ($(TARGET_ARCH), x86_64)
181 LIBOBJS+=helper.o
182 ifeq ($(USE_KVM), 1)
183 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
184 LIBOBJS+=qemu-kvm-helper.o
185 endif
186 endif
188 LIBOBJS+= op_helper.o
190 ifneq ($(TARGET_ARCH), ia64)
191 LIBOBJS+= helper.o
192 endif
194 ifeq ($(TARGET_BASE_ARCH), arm)
195 LIBOBJS+= neon_helper.o iwmmxt_helper.o
196 endif
198 ifeq ($(TARGET_BASE_ARCH), alpha)
199 LIBOBJS+= alpha_palcode.o
200 endif
202 ifeq ($(TARGET_BASE_ARCH), ia64)
203 LIBOBJS+=op_helper.o firmware.o
204 ifeq ($(USE_KVM), 1)
205 LIBOBJS+=qemu-kvm-ia64.o
206 endif
207 endif
209 ifeq ($(TARGET_BASE_ARCH), cris)
210 LIBOBJS+= cris-dis.o
212 ifndef CONFIG_USER_ONLY
213 LIBOBJS+= mmu.o
214 endif
215 endif
218 # NOTE: the disassembler code is only needed for debugging
219 LIBOBJS+=disas.o
220 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
221 USE_I386_DIS=y
222 endif
223 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
224 USE_I386_DIS=y
225 endif
226 ifdef USE_I386_DIS
227 LIBOBJS+=i386-dis.o
228 endif
229 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
230 LIBOBJS+=alpha-dis.o
231 endif
232 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
233 LIBOBJS+=ppc-dis.o
234 endif
235 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
236 LIBOBJS+=mips-dis.o
237 endif
238 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
239 LIBOBJS+=sparc-dis.o
240 endif
241 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
242 LIBOBJS+=arm-dis.o
243 endif
244 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
245 LIBOBJS+=m68k-dis.o
246 endif
247 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
248 LIBOBJS+=sh4-dis.o
249 endif
250 ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
251 LIBOBJS+=hppa-dis.o
252 endif
253 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
254 LIBOBJS+=s390-dis.o
255 endif
257 # libqemu
259 libqemu.a: $(LIBOBJS)
261 translate.o: translate.c cpu.h
263 translate-all.o: translate-all.c cpu.h
265 tcg/tcg.o: cpu.h
267 # HELPER_CFLAGS is used for all the code compiled with static register
268 # variables
269 op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
271 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
273 qemu-kvm-helper.o: qemu-kvm-helper.c
274         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
276 #########################################################
277 # Linux user emulator target
279 ifdef CONFIG_LINUX_USER
281 ifndef TARGET_ABI_DIR
282   TARGET_ABI_DIR=$(TARGET_ARCH)
283 endif
284 VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
285 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
287 ifdef CONFIG_STATIC
288 LDFLAGS+=-static
289 endif
291 ifeq ($(ARCH),i386)
292 ifdef TARGET_GPROF
293 USE_I386_LD=y
294 endif
295 ifdef CONFIG_STATIC
296 USE_I386_LD=y
297 endif
298 ifdef USE_I386_LD
299 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
300 else
301 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
302 # that the kernel ELF loader considers as an executable. I think this
303 # is the simplest way to make it self virtualizable!
304 LDFLAGS+=-Wl,-shared
305 endif
306 endif
308 ifeq ($(ARCH),x86_64)
309 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
310 endif
312 ifeq ($(ARCH),ppc)
313 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
314 endif
316 ifeq ($(ARCH),ppc64)
317 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
318 endif
320 ifeq ($(ARCH),s390)
321 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
322 endif
324 ifeq ($(ARCH),sparc)
325 # -static is used to avoid g1/g3 usage by the dynamic linker    
326 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
327 endif
329 ifeq ($(ARCH),sparc64)
330 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
331 endif
333 ifeq ($(ARCH),alpha)
334 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
335 endif
337 ifeq ($(ARCH),ia64)
338 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
339 endif
341 ifeq ($(ARCH),arm)
342 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
343 endif
345 ifeq ($(ARCH),m68k)
346 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
347 endif
349 ifeq ($(ARCH),mips)
350 ifeq ($(WORDS_BIGENDIAN),yes)
351 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
352 else
353 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
354 endif
355 endif
357 ifeq ($(ARCH),mips64)
358 ifeq ($(WORDS_BIGENDIAN),yes)
359 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
360 else
361 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
362 endif
363 endif
365 # profiling code
366 ifdef TARGET_GPROF
367 LDFLAGS+=-p
368 CFLAGS+=-p
369 endif
371 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
372       elfload.o linuxload.o uaccess.o envlist.o
373 LIBS+= $(AIOLIBS)
374 ifdef TARGET_HAS_BFLT
375 OBJS+= flatload.o
376 endif
377 ifdef TARGET_HAS_ELFLOAD32
378 OBJS+= elfload32.o
379 elfload32.o: elfload.c
380 endif
382 ifeq ($(TARGET_ARCH), i386)
383 OBJS+= vm86.o
384 endif
385 ifeq ($(TARGET_ARCH), arm)
386 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
387 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
388  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
389 endif
390 ifeq ($(TARGET_ARCH), m68k)
391 OBJS+= m68k-sim.o m68k-semi.o
392 endif
394 ifdef CONFIG_GDBSTUB
395 OBJS+=gdbstub.o gdbstub-xml.o
396 endif
398 OBJS+= libqemu.a
400 # Note: this is a workaround. The real fix is to avoid compiling
401 # cpu_signal_handler() in cpu-exec.c.
402 signal.o: CFLAGS += $(HELPER_CFLAGS)
404 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
405         $(LINK)
406 ifeq ($(ARCH),alpha)
407 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
408 # the address space (31 bit so sign extending doesn't matter)
409         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
410 endif
412 endif #CONFIG_LINUX_USER
414 #########################################################
415 # Darwin user emulator target
417 ifdef CONFIG_DARWIN_USER
419 VPATH+=:$(SRC_PATH)/darwin-user
420 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
422 # Leave some space for the regular program loading zone
423 LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
425 LIBS+=-lmx
427 OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
429 OBJS+= libqemu.a
431 ifdef CONFIG_GDBSTUB
432 OBJS+=gdbstub.o gdbstub-xml.o
433 endif
435 # Note: this is a workaround. The real fix is to avoid compiling
436 # cpu_signal_handler() in cpu-exec.c.
437 signal.o: CFLAGS += $(HELPER_CFLAGS)
439 $(QEMU_PROG): $(OBJS)
440         $(LINK)
442 endif #CONFIG_DARWIN_USER
444 #########################################################
445 # BSD user emulator target
447 ifdef CONFIG_BSD_USER
449 VPATH+=:$(SRC_PATH)/bsd-user
450 CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
452 ifdef CONFIG_STATIC
453 LDFLAGS+=-static
454 endif
456 ifeq ($(ARCH),i386)
457 ifdef TARGET_GPROF
458 USE_I386_LD=y
459 endif
460 ifdef CONFIG_STATIC
461 USE_I386_LD=y
462 endif
463 ifdef USE_I386_LD
464 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
465 else
466 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
467 # that the kernel ELF loader considers as an executable. I think this
468 # is the simplest way to make it self virtualizable!
469 LDFLAGS+=-Wl,-shared
470 endif
471 endif
473 ifeq ($(ARCH),x86_64)
474 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
475 endif
477 ifeq ($(ARCH),ppc)
478 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
479 endif
481 ifeq ($(ARCH),ppc64)
482 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
483 endif
485 ifeq ($(ARCH),s390)
486 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
487 endif
489 ifeq ($(ARCH),sparc)
490 # -static is used to avoid g1/g3 usage by the dynamic linker
491 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
492 endif
494 ifeq ($(ARCH),sparc64)
495 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
496 endif
498 ifeq ($(ARCH),alpha)
499 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
500 endif
502 ifeq ($(ARCH),ia64)
503 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
504 endif
506 ifeq ($(ARCH),arm)
507 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
508 endif
510 ifeq ($(ARCH),m68k)
511 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
512 endif
514 ifeq ($(ARCH),mips)
515 ifeq ($(WORDS_BIGENDIAN),yes)
516 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
517 else
518 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
519 endif
520 endif
522 ifeq ($(ARCH),mips64)
523 ifeq ($(WORDS_BIGENDIAN),yes)
524 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
525 else
526 LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
527 endif
528 endif
530 OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
531 OBJS+= uaccess.o
533 OBJS+= libqemu.a
535 ifdef CONFIG_GDBSTUB
536 OBJS+=gdbstub.o
537 endif
539 # Note: this is a workaround. The real fix is to avoid compiling
540 # cpu_signal_handler() in cpu-exec.c.
541 signal.o: CFLAGS += $(HELPER_CFLAGS)
543 $(QEMU_PROG): $(OBJS) ../libqemu_user.a
544         $(LINK)
546 endif #CONFIG_BSD_USER
548 #########################################################
549 # System emulator target
550 ifndef CONFIG_USER_ONLY
552 OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o
553 # virtio has to be here due to weird dependency between PCI and virtio-net.
554 # need to fix this properly
555 OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
556 OBJS+=fw_cfg.o
557 ifdef CONFIG_KVM
558 OBJS+=kvm.o kvm-all.o
559 endif
560 ifdef CONFIG_WIN32
561 OBJS+=block-raw-win32.o
562 else
563 ifdef CONFIG_AIO
564 OBJS+=posix-aio-compat.o
565 endif
566 OBJS+=block-raw-posix.o
567 endif
569 ifdef CONFIG_AIO
570 OBJS+=compatfd.o
571 endif
573 LIBS+=-lz
574 ifdef CONFIG_ALSA
575 LIBS += -lasound
576 endif
577 ifdef CONFIG_ESD
578 LIBS += -lesd
579 endif
580 ifdef CONFIG_PA
581 LIBS += -lpulse-simple
582 endif
583 ifdef CONFIG_DSOUND
584 LIBS += -lole32 -ldxguid
585 endif
586 ifdef CONFIG_FMOD
587 LIBS += $(CONFIG_FMOD_LIB)
588 endif
589 ifdef CONFIG_OSS
590 LIBS += $(CONFIG_OSS_LIB)
591 endif
593 SOUND_HW = sb16.o es1370.o ac97.o
594 ifdef CONFIG_ADLIB
595 SOUND_HW += fmopl.o adlib.o
596 adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
597 endif
598 ifdef CONFIG_GUS
599 SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
600 endif
601 ifdef CONFIG_CS4231A
602 SOUND_HW += cs4231a.o
603 endif
605 ifdef CONFIG_KVM_KERNEL_INC
606 CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
607 LIBS += -lkvm
608 DEPLIBS += ../libkvm/libkvm.a
609 endif
611 ifdef CONFIG_VNC_TLS
612 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
613 LIBS += $(CONFIG_VNC_TLS_LIBS)
614 endif
616 ifdef CONFIG_BLUEZ
617 LIBS += $(CONFIG_BLUEZ_LIBS)
618 endif
620 # SCSI layer
621 OBJS+= lsi53c895a.o esp.o
623 # USB layer
624 OBJS+= usb-ohci.o
626 # EEPROM emulation
627 OBJS += eeprom93xx.o
629 # PCI network cards
630 OBJS += eepro100.o
631 OBJS += ne2000.o
632 OBJS += pcnet.o
633 OBJS += rtl8139.o
634 OBJS += e1000.o
636 OBJS += device-hotplug.o
638 ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1)
639 OBJS+= device-assignment.o
640 endif
642 ifeq ($(TARGET_BASE_ARCH), i386)
643 # Hardware support
644 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
645 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
646 OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
647 OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
648 OBJS+= extboot.o
649 # virtio support
650 OBJS+= virtio.o virtio-blk.o virtio-balloon.o
651 OBJS += virtio-net.o
652 ifeq ($(USE_KVM_PIT), 1)
653 OBJS+= i8254-kvm.o
654 endif
655 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
656 endif
657 ifeq ($(TARGET_BASE_ARCH), ia64)
658 # Hardware support
659 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
660 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o ipf.o
661 OBJS+= cirrus_vga.o parallel.o acpi.o piix_pci.o
662 OBJS+= usb-uhci.o smbus_eeprom.o
663 # virtio support
664 OBJS+= virtio.o virtio-blk.o virtio-balloon.o
665 OBJS+= virtio-net.o
666 endif
667 ifeq ($(TARGET_BASE_ARCH), ppc)
668 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
669 # shared objects
670 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
671 OBJS+= cirrus_vga.o
672 # PREP target
673 OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
674 OBJS+= prep_pci.o ppc_prep.o
675 # Mac shared devices
676 OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
677 # OldWorld PowerMac
678 OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
679 # NewWorld PowerMac
680 OBJS+= unin_pci.o ppc_chrp.o
681 # PowerPC 4xx boards
682 OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
683 OBJS+= ppc440.o ppc440_bamboo.o
684 ifdef FDT_LIBS
685 OBJS+= device_tree.o
686 LIBS+= $(FDT_LIBS)
687 endif
688 ifdef CONFIG_KVM
689 OBJS+= kvm_ppc.o
690 endif
691 endif
692 ifeq ($(TARGET_BASE_ARCH), mips)
693 OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
694 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
695 OBJS+= g364fb.o jazz_led.o
696 OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
697 OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
698 OBJS+= mipsnet.o
699 OBJS+= pflash_cfi01.o
700 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
701 endif
702 ifeq ($(TARGET_BASE_ARCH), cris)
703 # Boards
704 OBJS+= etraxfs.o axis_dev88.o
706 # IO blocks
707 OBJS+= etraxfs_dma.o
708 OBJS+= etraxfs_pic.o
709 OBJS+= etraxfs_eth.o
710 OBJS+= etraxfs_timer.o
711 OBJS+= etraxfs_ser.o
713 OBJS+= ptimer.o
714 OBJS+= pflash_cfi02.o nand.o
715 endif
716 ifeq ($(TARGET_BASE_ARCH), sparc)
717 ifeq ($(TARGET_ARCH), sparc64)
718 OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
719 OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
720 OBJS+= cirrus_vga.o parallel.o ptimer.o
721 else
722 OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
723 OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
724 OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
725 endif
726 endif
727 ifeq ($(TARGET_BASE_ARCH), arm)
728 OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
729 OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
730 OBJS+= versatile_pci.o ptimer.o
731 OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
732 OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
733 OBJS+= pl061.o
734 OBJS+= arm-semi.o
735 OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
736 OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
737 OBJS+= pflash_cfi01.o gumstix.o
738 OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
739 OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
740 OBJS+= omap2.o omap_dss.o soc_dma.o
741 OBJS+= omap_sx1.o palm.o tsc210x.o
742 OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
743 OBJS+= tsc2005.o bt-hci-csr.o
744 OBJS+= mst_fpga.o mainstone.o
745 OBJS+= musicpal.o pflash_cfi02.o
746 CPPFLAGS += -DHAS_AUDIO
747 endif
748 ifeq ($(TARGET_BASE_ARCH), sh4)
749 OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
750 OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
751 OBJS+= ide.o
752 endif
753 ifeq ($(TARGET_BASE_ARCH), m68k)
754 OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
755 OBJS+= m68k-semi.o dummy_m68k.o
756 endif
757 ifdef CONFIG_GDBSTUB
758 OBJS+=gdbstub.o gdbstub-xml.o
759 endif
760 ifdef CONFIG_COCOA
761 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
762 ifdef CONFIG_COREAUDIO
763 COCOA_LIBS+=-framework CoreAudio
764 endif
765 endif
766 ifdef CONFIG_SLIRP
767 CPPFLAGS+=-I$(SRC_PATH)/slirp
768 endif
770 LIBS+=$(AIOLIBS)
771 # specific flags are needed for non soft mmu emulator
772 ifdef CONFIG_STATIC
773 LDFLAGS+=-static
774 endif
775 ifndef CONFIG_DARWIN
776 ifndef CONFIG_WIN32
777 ifndef CONFIG_SOLARIS
778 ifndef CONFIG_AIX
779 LIBS+=-lutil
780 endif
781 endif
782 endif
783 endif
784 ifdef TARGET_GPROF
785 vl.o: CFLAGS+=-p
786 LDFLAGS+=-p
787 endif
789 ifeq ($(ARCH),ia64)
790 LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
791 endif
793 ifdef CONFIG_WIN32
794 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
795 endif
797 # profiling code
798 ifdef TARGET_GPROF
799 LDFLAGS+=-p
800 main.o: CFLAGS+=-p
801 endif
802 ifeq ($(TARGET_ARCH), ia64)
803 firmware.o: firmware.c
804         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
805 endif
807 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
809 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a $(DEPLIBS)
810         $(LINK)
812 endif # !CONFIG_USER_ONLY
814 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
815         rm -f $@
816 ifeq ($(TARGET_XML_FILES),)
817         echo > $@
818 else
819         $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
820 endif
822 clean:
823         rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
824         rm -f *.d */*.d tcg/*.o
826 install: all
827 ifneq ($(PROGS),)
828         $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
829 endif
831 # Include automatically generated dependency files
832 -include $(wildcard *.d */*.d)