Add Powerpc 440 board model "bamboo"
[qemu-kvm/fedora.git] / Makefile.target
blob2717c12a07daef8ee86b945c343936256effba7b
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 ifdef CONFIG_DARWIN_USER
36 VPATH+=:$(SRC_PATH)/darwin-user
37 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
38 endif
39 ifdef CONFIG_LINUX_USER
40 VPATH+=:$(SRC_PATH)/linux-user
41 ifndef TARGET_ABI_DIR
42   TARGET_ABI_DIR=$(TARGET_ARCH)
43 endif
44 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
45 endif
46 BASE_CFLAGS=
47 BASE_LDFLAGS=
48 #CFLAGS+=-Werror
49 LIBS=
50 HELPER_CFLAGS=$(CFLAGS)
51 DYNGEN=../dyngen$(EXESUF)
52 # user emulator name
53 TARGET_ARCH2=$(TARGET_ARCH)
54 ifeq ($(TARGET_ARCH),arm)
55   ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
56     TARGET_ARCH2=armeb
57   endif
58 endif
59 ifeq ($(TARGET_ARCH),sh4)
60   ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
61     TARGET_ARCH2=sh4eb
62   endif
63 endif
64 ifeq ($(TARGET_ARCH),mips)
65   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
66     TARGET_ARCH2=mipsel
67   endif
68 endif
69 ifeq ($(TARGET_ARCH),mipsn32)
70   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
71     TARGET_ARCH2=mipsn32el
72   endif
73 endif
74 ifeq ($(TARGET_ARCH),mips64)
75   ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
76     TARGET_ARCH2=mips64el
77   endif
78 endif
79 ifeq ($(TARGET_ARCH),sparc64)
80   ifeq ($(TARGET_ABI_DIR),sparc)
81     TARGET_ARCH2=sparc32plus
82   endif
83 endif
84 QEMU_USER=qemu-$(TARGET_ARCH2)
85 # system emulator name
86 ifdef CONFIG_SOFTMMU
87 ifeq ($(TARGET_ARCH), i386)
88 QEMU_SYSTEM=qemu$(EXESUF)
89 else
90 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
91 endif
92 else
93 QEMU_SYSTEM=qemu-fast
94 endif
96 ifdef CONFIG_USER_ONLY
97 PROGS=$(QEMU_USER)
98 else
99 PROGS+=$(QEMU_SYSTEM)
100 ifndef CONFIG_SOFTMMU
101 CONFIG_STATIC=y
102 endif
103 endif # !CONFIG_USER_ONLY
105 ifdef CONFIG_STATIC
106 BASE_LDFLAGS+=-static
107 endif
109 # We require -O2 to avoid the stack setup prologue in EXIT_TB
110 OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
112 # cc-option
113 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
115 cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
116               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
118 OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
119 OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
120 OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
121 OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
122 OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
123 OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
124 OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
125 OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
126 OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
128 ifeq ($(ARCH),i386)
129 HELPER_CFLAGS+=-fomit-frame-pointer
130 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
131 ifdef TARGET_GPROF
132 USE_I386_LD=y
133 endif
134 ifdef CONFIG_STATIC
135 USE_I386_LD=y
136 endif
137 ifdef USE_I386_LD
138 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
139 else
140 ifdef CONFIG_LINUX_USER
141 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
142 # that the kernel ELF loader considers as an executable. I think this
143 # is the simplest way to make it self virtualizable!
144 BASE_LDFLAGS+=-Wl,-shared
145 endif
146 endif
147 endif
149 ifeq ($(ARCH),x86_64)
150   ifneq ($(CONFIG_SOLARIS),yes)
151     BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
152   endif
153 endif
155 ifeq ($(ARCH),ppc)
156 CPPFLAGS+= -D__powerpc__
157 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
158 endif
160 ifeq ($(ARCH),s390)
161 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
162 endif
164 ifeq ($(ARCH),sparc)
165   BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
166   OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
167   ifeq ($(CONFIG_SOLARIS),yes)
168     OP_CFLAGS+=-fno-omit-frame-pointer
169   else
170     BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
171     HELPER_CFLAGS=$(CFLAGS) -ffixed-i0
172     # -static is used to avoid g1/g3 usage by the dynamic linker
173     BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
174   endif
175 endif
177 ifeq ($(ARCH),sparc64)
178   BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
179   OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
180   ifneq ($(CONFIG_SOLARIS),yes)
181     BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
182     OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
183   endif
184 endif
186 ifeq ($(ARCH),alpha)
187 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
188 # relocations for the constant constructions
189 # Ensure there's only a single GP
190 BASE_CFLAGS+=-msmall-data
191 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
192 endif
194 ifeq ($(ARCH),ia64)
195 BASE_CFLAGS+=-mno-sdata
196 OP_CFLAGS+=-mno-sdata
197 BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
198 endif
200 ifeq ($(ARCH),arm)
201 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
202 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
203 endif
205 ifeq ($(ARCH),m68k)
206 OP_CFLAGS+=-fomit-frame-pointer
207 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
208 endif
210 ifeq ($(ARCH),mips)
211 OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
212 ifeq ($(WORDS_BIGENDIAN),yes)
213 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
214 else
215 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
216 endif
217 endif
219 ifeq ($(ARCH),mips64)
220 OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
221 ifeq ($(WORDS_BIGENDIAN),yes)
222 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
223 else
224 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
225 endif
226 endif
228 ifeq ($(CONFIG_DARWIN),yes)
229 LIBS+=-lmx
230 endif
232 ifdef CONFIG_DARWIN_USER
233 # Leave some space for the regular program loading zone
234 BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
235 endif
237 BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
238 BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
239 OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
240 OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
242 #########################################################
244 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__user=
245 LIBS+=-lm
246 ifndef CONFIG_USER_ONLY
247 LIBS+=-lz
248 endif
249 ifdef CONFIG_WIN32
250 LIBS+=-lwinmm -lws2_32 -liphlpapi
251 endif
252 ifdef CONFIG_SOLARIS
253 LIBS+=-lsocket -lnsl -lresolv
254 ifdef NEEDS_LIBSUNMATH
255 LIBS+=-lsunmath
256 LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
257 OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
258 BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
259 endif
260 endif
262 # profiling code
263 ifdef TARGET_GPROF
264 BASE_LDFLAGS+=-p
265 main.o: BASE_CFLAGS+=-p
266 endif
268 ifdef CONFIG_LINUX_USER
269 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o \
270       elfload.o linuxload.o uaccess.o
271 LIBS+= $(AIOLIBS)
272 ifdef TARGET_HAS_BFLT
273 OBJS+= flatload.o
274 endif
275 ifdef TARGET_HAS_ELFLOAD32
276 OBJS+= elfload32.o
277 elfload32.o: elfload.c
278 endif
280 ifeq ($(TARGET_ARCH), i386)
281 OBJS+= vm86.o
282 endif
283 ifeq ($(TARGET_ARCH), arm)
284 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
285 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
286  nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
287 endif
288 ifeq ($(TARGET_ARCH), m68k)
289 OBJS+= m68k-sim.o m68k-semi.o
290 endif
291 endif #CONFIG_LINUX_USER
293 ifdef CONFIG_DARWIN_USER
294 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
295 endif
297 SRCS:= $(OBJS:.o=.c)
298 OBJS+= libqemu.a
300 # cpu emulator library
301 LIBOBJS=exec.o kqemu.o qemu-kvm.o translate-op.o translate-all.o cpu-exec.o\
302         translate.o op.o host-utils.o
303 ifdef CONFIG_SOFTFLOAT
304 LIBOBJS+=fpu/softfloat.o
305 else
306 LIBOBJS+=fpu/softfloat-native.o
307 endif
308 CPPFLAGS+=-I$(SRC_PATH)/fpu
310 ifeq ($(TARGET_ARCH), i386)
311 LIBOBJS+=helper.o helper2.o
312 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
313 LIBOBJS+=qemu-kvm-helper.o
314 endif
316 ifeq ($(TARGET_ARCH), x86_64)
317 LIBOBJS+=helper.o helper2.o
318 LIBOBJS+=qemu-kvm-x86.o kvm-tpr-opt.o
319 LIBOBJS+=qemu-kvm-helper.o
320 endif
322 ifeq ($(TARGET_BASE_ARCH), ppc)
323 LIBOBJS+= op_helper.o helper.o
324 LIBOBJS+= qemu-kvm-powerpc.o
325 endif
327 ifeq ($(TARGET_BASE_ARCH), mips)
328 LIBOBJS+= op_helper.o helper.o
329 endif
331 ifeq ($(TARGET_BASE_ARCH), sparc)
332 LIBOBJS+= op_helper.o helper.o
333 endif
335 ifeq ($(TARGET_BASE_ARCH), arm)
336 LIBOBJS+= op_helper.o helper.o
337 endif
339 ifeq ($(TARGET_BASE_ARCH), sh4)
340 LIBOBJS+= op_helper.o helper.o
341 endif
343 ifeq ($(TARGET_BASE_ARCH), m68k)
344 LIBOBJS+= op_helper.o helper.o
345 endif
347 ifeq ($(TARGET_BASE_ARCH), alpha)
348 LIBOBJS+= op_helper.o helper.o alpha_palcode.o
349 endif
351 ifeq ($(TARGET_BASE_ARCH), ia64)
352 LIBOBJS+=op_helper.o firmware.o
353 LIBOBJS+=qemu-kvm-ia64.o
354 endif
356 ifeq ($(TARGET_BASE_ARCH), cris)
357 LIBOBJS+= op_helper.o helper.o
358 LIBOBJS+= cris-dis.o
360 ifndef CONFIG_USER_ONLY
361 LIBOBJS+= mmu.o
362 endif
363 endif
366 # NOTE: the disassembler code is only needed for debugging
367 LIBOBJS+=disas.o
368 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
369 USE_I386_DIS=y
370 endif
371 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
372 USE_I386_DIS=y
373 endif
374 ifdef USE_I386_DIS
375 LIBOBJS+=i386-dis.o
376 endif
377 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
378 LIBOBJS+=alpha-dis.o
379 endif
380 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
381 LIBOBJS+=ppc-dis.o
382 endif
383 ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
384 LIBOBJS+=mips-dis.o
385 endif
386 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
387 LIBOBJS+=sparc-dis.o
388 endif
389 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
390 LIBOBJS+=arm-dis.o
391 endif
392 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
393 LIBOBJS+=m68k-dis.o
394 endif
395 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
396 LIBOBJS+=sh4-dis.o
397 endif
398 ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
399 LIBOBJS+=s390-dis.o
400 endif
402 ifdef CONFIG_GDBSTUB
403 OBJS+=gdbstub.o
404 endif
406 all: $(PROGS)
408 $(QEMU_USER): $(OBJS)
409         $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^  $(LIBS)
410 ifeq ($(ARCH),alpha)
411 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
412 # the address space (31 bit so sign extending doesn't matter)
413         echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
414 endif
416 # must use static linking to avoid leaving stuff in virtual address space
417 VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o migration.o
418 # XXX: suppress QEMU_TOOL tests
419 ifdef CONFIG_WIN32
420 VL_OBJS+=block-raw-win32.o
421 else
422 VL_OBJS+=block-raw-posix.o
423 endif
425 ifdef CONFIG_ALSA
426 LIBS += -lasound
427 endif
428 ifdef CONFIG_DSOUND
429 LIBS += -lole32 -ldxguid
430 endif
431 ifdef CONFIG_FMOD
432 LIBS += $(CONFIG_FMOD_LIB)
433 endif
435 SOUND_HW = sb16.o es1370.o
436 ifdef CONFIG_ADLIB
437 SOUND_HW += fmopl.o adlib.o
438 endif
440 ifdef CONFIG_KVM_KERNEL_INC
441 CFLAGS += -I $(CONFIG_KVM_KERNEL_INC)
442 LIBS += -lkvm
443 DEPLIBS += ../libkvm/libkvm.a
444 endif
446 ifdef CONFIG_VNC_TLS
447 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
448 LIBS += $(CONFIG_VNC_TLS_LIBS)
449 endif
451 # SCSI layer
452 VL_OBJS+= lsi53c895a.o
454 # USB layer
455 VL_OBJS+= usb-ohci.o
457 # EEPROM emulation
458 VL_OBJS += eeprom93xx.o
460 # PCI network cards
461 VL_OBJS += eepro100.o
462 VL_OBJS += ne2000.o
463 VL_OBJS += pcnet.o
464 VL_OBJS += rtl8139.o
466 # PCI Hypercall
467 VL_OBJS+= hypercall.o
469 # virtio devices
470 VL_OBJS += virtio.o virtio-net.o virtio-blk.o
472 ifeq ($(TARGET_BASE_ARCH), i386)
473 # Hardware support
474 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
475 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
476 VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
477 VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o extboot.o
478 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
479 endif
480 ifeq ($(TARGET_BASE_ARCH), ia64)
481 # Hardware support
482 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
483 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o ipf.o
484 VL_OBJS+= cirrus_vga.o parallel.o acpi.o piix_pci.o
485 VL_OBJS+= usb-uhci.o smbus_eeprom.o
486 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
487 endif
488 ifeq ($(TARGET_BASE_ARCH), ppc)
489 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
490 # shared objects
491 VL_OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
492 VL_OBJS+= cirrus_vga.o
493 # PREP target
494 VL_OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
495 VL_OBJS+= prep_pci.o ppc_prep.o
496 # Mac shared devices
497 VL_OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
498 # OldWorld PowerMac
499 VL_OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
500 # NewWorld PowerMac
501 VL_OBJS+= unin_pci.o ppc_chrp.o
502 # PowerPC 4xx boards
503 VL_OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
504 VL_OBJS+= ppc440.o ppc440_bamboo.o
505 endif
506 ifeq ($(TARGET_BASE_ARCH), mips)
507 VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
508 VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
509 VL_OBJS+= jazz_led.o
510 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
511 VL_OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
512 VL_OBJS+= mipsnet.o
513 CPPFLAGS += -DHAS_AUDIO
514 endif
515 ifeq ($(TARGET_BASE_ARCH), cris)
516 VL_OBJS+= etraxfs.o
517 VL_OBJS+= ptimer.o
518 VL_OBJS+= etraxfs_timer.o
519 VL_OBJS+= etraxfs_ser.o
520 endif
521 ifeq ($(TARGET_BASE_ARCH), sparc)
522 ifeq ($(TARGET_ARCH), sparc64)
523 VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
524 VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
525 VL_OBJS+= cirrus_vga.o parallel.o ptimer.o
526 else
527 VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
528 VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
529 VL_OBJS+= cs4231.o ptimer.o eccmemctl.o
530 endif
531 endif
532 ifeq ($(TARGET_BASE_ARCH), arm)
533 VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
534 VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
535 VL_OBJS+= versatile_pci.o ptimer.o
536 VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
537 VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
538 VL_OBJS+= pl061.o
539 VL_OBJS+= arm-semi.o
540 VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
541 VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
542 VL_OBJS+= pflash_cfi01.o gumstix.o
543 VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o
544 VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
545 VL_OBJS+= palm.o tsc210x.o
546 VL_OBJS+= mst_fpga.o mainstone.o
547 CPPFLAGS += -DHAS_AUDIO
548 endif
549 ifeq ($(TARGET_BASE_ARCH), sh4)
550 VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
551 VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
552 endif
553 ifeq ($(TARGET_BASE_ARCH), m68k)
554 VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
555 VL_OBJS+= m68k-semi.o dummy_m68k.o
556 endif
557 ifdef CONFIG_GDBSTUB
558 VL_OBJS+=gdbstub.o
559 endif
560 ifdef CONFIG_COCOA
561 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
562 ifdef CONFIG_COREAUDIO
563 COCOA_LIBS+=-framework CoreAudio
564 endif
565 endif
566 ifdef CONFIG_SLIRP
567 CPPFLAGS+=-I$(SRC_PATH)/slirp
568 endif
570 VL_LDFLAGS=$(VL_OS_LDFLAGS)
571 VL_LIBS=$(AIOLIBS)
572 # specific flags are needed for non soft mmu emulator
573 ifdef CONFIG_STATIC
574 VL_LDFLAGS+=-static
575 endif
576 ifndef CONFIG_SOFTMMU
577 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
578 endif
579 ifndef CONFIG_DARWIN
580 ifndef CONFIG_WIN32
581 ifndef CONFIG_SOLARIS
582 VL_LIBS+=-lutil
583 endif
584 endif
585 endif
586 ifdef TARGET_GPROF
587 vl.o: BASE_CFLAGS+=-p
588 VL_LDFLAGS+=-p
589 endif
591 ifeq ($(ARCH),ia64)
592 VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
593 endif
595 ifeq ($(ARCH),sparc64)
596   VL_LDFLAGS+=-m64
597   ifneq ($(CONFIG_SOLARIS),yes)
598     VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
599   endif
600 endif
602 ifeq ($(ARCH),x86_64)
603   VL_LDFLAGS+=-m64
604   ifneq ($(CONFIG_SOLARIS),yes)
605     VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
606   endif
607 endif
609 ifdef CONFIG_WIN32
610 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
611 endif
613 $(QEMU_SYSTEM): $(VL_OBJS) ../libqemu_common.a libqemu.a $(DEPLIBS)
614         $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
616 depend: $(SRCS)
617         $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
619 vldepend: $(VL_OBJS:.o=.c)
620         $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
622 # libqemu
624 libqemu.a: $(LIBOBJS)
625         rm -f $@
626         $(AR) rcs $@ $(LIBOBJS)
628 translate.o: translate.c gen-op.h opc.h cpu.h
630 translate-all.o: translate-all.c opc.h cpu.h
632 translate-op.o: translate-all.c op.h opc.h cpu.h
634 op.h: op.o $(DYNGEN)
635         $(DYNGEN) -o $@ $<
637 opc.h: op.o $(DYNGEN)
638         $(DYNGEN) -c -o $@ $<
640 gen-op.h: op.o $(DYNGEN)
641         $(DYNGEN) -g -o $@ $<
643 op.o: op.c
644         $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
646 # HELPER_CFLAGS is used for all the code compiled with static register
647 # variables
648 ifeq ($(TARGET_BASE_ARCH), i386)
649 # XXX: rename helper.c to op_helper.c
650 qemu-kvm-x86.o: qemu-kvm-x86.c qemu-kvm.h
652 helper.o: helper.c
653         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
654 else
655 op_helper.o: op_helper.c
656         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
657 endif
658 ifeq ($(TARGET_ARCH), ia64)
659 qemu-kvm-ia64.o: qemu-kvm-ia64.c qemu-kvm.h
660 firmware.o: firmware.c
661         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
662 endif
664 ifeq ($(TARGET_ARCH), ppc)
665 qemu-kvm-powerpc.o: qemu-kvm-powerpc.c qemu-kvm.h
666 endif
668 cpu-exec.o: cpu-exec.c
669         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
671 qemu-kvm.o: qemu-kvm.c qemu-kvm.h
672 ifeq ($(TARGET_BASE_ARCH), i386)
673 qemu-kvm-helper.o: qemu-kvm-helper.c
674 endif
676         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
678 # Note: this is a workaround. The real fix is to avoid compiling
679 # cpu_signal_handler() in cpu-exec.c.
680 signal.o: signal.c
681         $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
683 %.o: %.c
684         $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
686 %.o: %.S
687         $(CC) $(CPPFLAGS) -c -o $@ $<
689 clean:
690         rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o fpu/*.o
691         rm -f *.d */*.d
693 install: all
694 ifneq ($(PROGS),)
695         $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
696 endif
698 ifneq ($(wildcard .depend),)
699 include .depend
700 endif
702 ifeq (1, 0)
703 audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
704 fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
705 CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
706 endif
708 # Include automatically generated dependency files
709 -include $(wildcard *.d */*.d)