]> git.proxmox.com Git - mirror_qemu.git/blame_incremental - Makefile.target
Fix the PXA2xx LCD dirty page detection a little more.
[mirror_qemu.git] / Makefile.target
... / ...
CommitLineData
1include config.mak
2
3TARGET_BASE_ARCH:=$(TARGET_ARCH)
4ifeq ($(TARGET_ARCH), x86_64)
5TARGET_BASE_ARCH:=i386
6endif
7ifeq ($(TARGET_ARCH), mipsn32)
8TARGET_BASE_ARCH:=mips
9endif
10ifeq ($(TARGET_ARCH), mips64)
11TARGET_BASE_ARCH:=mips
12endif
13ifeq ($(TARGET_ARCH), ppc64)
14TARGET_BASE_ARCH:=ppc
15endif
16ifeq ($(TARGET_ARCH), ppc64h)
17TARGET_BASE_ARCH:=ppc
18endif
19ifeq ($(TARGET_ARCH), ppcemb)
20TARGET_BASE_ARCH:=ppc
21endif
22ifeq ($(TARGET_ARCH), sparc64)
23TARGET_BASE_ARCH:=sparc
24endif
25TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
26VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
27CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
28#CFLAGS+=-Werror
29LIBS=
30# user emulator name
31ifndef TARGET_ARCH2
32TARGET_ARCH2=$(TARGET_ARCH)
33endif
34ifeq ($(TARGET_ARCH),arm)
35 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
36 TARGET_ARCH2=armeb
37 endif
38endif
39ifeq ($(TARGET_ARCH),sh4)
40 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
41 TARGET_ARCH2=sh4eb
42 endif
43endif
44ifeq ($(TARGET_ARCH),mips)
45 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
46 TARGET_ARCH2=mipsel
47 endif
48endif
49ifeq ($(TARGET_ARCH),mipsn32)
50 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
51 TARGET_ARCH2=mipsn32el
52 endif
53endif
54ifeq ($(TARGET_ARCH),mips64)
55 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
56 TARGET_ARCH2=mips64el
57 endif
58endif
59
60ifdef CONFIG_USER_ONLY
61# user emulator name
62QEMU_PROG=qemu-$(TARGET_ARCH2)
63else
64# system emulator name
65ifeq ($(TARGET_ARCH), i386)
66QEMU_PROG=qemu$(EXESUF)
67else
68QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
69endif
70endif
71
72PROGS=$(QEMU_PROG)
73
74# We require -O2 to avoid the stack setup prologue in EXIT_TB
75OP_CFLAGS := -O2 -g -fno-strict-aliasing
76OP_CFLAGS += -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls
77
78# cc-option
79# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
80
81cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
82 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
83
84OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
85OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
86OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
87OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
88OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
89OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
90OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
91OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
92OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
93
94HELPER_CFLAGS=
95
96ifeq ($(ARCH),i386)
97HELPER_CFLAGS+=-fomit-frame-pointer
98OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
99endif
100
101ifeq ($(ARCH),ppc)
102CPPFLAGS+= -D__powerpc__
103OP_CFLAGS+= -mlongcall
104endif
105
106ifeq ($(ARCH),sparc)
107 CFLAGS+=-ffixed-g2 -ffixed-g3
108 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
109 ifeq ($(CONFIG_SOLARIS),yes)
110 OP_CFLAGS+=-fno-omit-frame-pointer
111 else
112 CFLAGS+=-ffixed-g1 -ffixed-g6
113 HELPER_CFLAGS+=-ffixed-i0
114 endif
115endif
116
117ifeq ($(ARCH),sparc64)
118 OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
119 ifneq ($(CONFIG_SOLARIS),yes)
120 CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
121 OP_CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
122 else
123 CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
124 endif
125endif
126
127ifeq ($(ARCH),alpha)
128# -msmall-data is not used for OP_CFLAGS because we want two-instruction
129# relocations for the constant constructions
130# Ensure there's only a single GP
131CFLAGS+=-msmall-data
132endif
133
134ifeq ($(ARCH),hppa)
135OP_CFLAGS=-O1 -fno-delayed-branch
136BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
137endif
138
139ifeq ($(ARCH),ia64)
140CFLAGS+=-mno-sdata
141OP_CFLAGS+=-mno-sdata
142endif
143
144ifeq ($(ARCH),arm)
145OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
146endif
147
148ifeq ($(ARCH),m68k)
149OP_CFLAGS+=-fomit-frame-pointer
150endif
151
152ifeq ($(ARCH),mips)
153OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
154endif
155
156ifeq ($(ARCH),mips64)
157OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
158endif
159
160CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
161LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
162OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
163
164CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
165LIBS+=-lm
166ifdef CONFIG_WIN32
167LIBS+=-lwinmm -lws2_32 -liphlpapi
168endif
169ifdef CONFIG_SOLARIS
170LIBS+=-lsocket -lnsl -lresolv
171ifdef NEEDS_LIBSUNMATH
172LIBS+=-lsunmath
173LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
174OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
175CFLAGS+=-I/opt/SUNWspro/prod/include/cc
176endif
177endif
178
179kvm.o: CFLAGS+=$(KVM_CFLAGS)
180kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
181
182all: $(PROGS)
183
184#########################################################
185# cpu emulator library
186LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
187 translate.o host-utils.o
188# TCG code generator
189LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
190CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
191ifeq ($(ARCH),sparc64)
192CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
193endif
194ifdef CONFIG_SOFTFLOAT
195LIBOBJS+=fpu/softfloat.o
196else
197LIBOBJS+=fpu/softfloat-native.o
198endif
199CPPFLAGS+=-I$(SRC_PATH)/fpu
200LIBOBJS+= op_helper.o helper.o
201
202ifeq ($(TARGET_BASE_ARCH), arm)
203LIBOBJS+= neon_helper.o iwmmxt_helper.o
204endif
205
206ifeq ($(TARGET_BASE_ARCH), alpha)
207LIBOBJS+= alpha_palcode.o
208endif
209
210ifeq ($(TARGET_BASE_ARCH), cris)
211LIBOBJS+= cris-dis.o
212
213ifndef CONFIG_USER_ONLY
214LIBOBJS+= mmu.o
215endif
216endif
217
218# NOTE: the disassembler code is only needed for debugging
219LIBOBJS+=disas.o
220ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
221USE_I386_DIS=y
222endif
223ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
224USE_I386_DIS=y
225endif
226ifdef USE_I386_DIS
227LIBOBJS+=i386-dis.o
228endif
229ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
230LIBOBJS+=alpha-dis.o
231endif
232ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
233LIBOBJS+=ppc-dis.o
234endif
235ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
236LIBOBJS+=mips-dis.o
237endif
238ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
239LIBOBJS+=sparc-dis.o
240endif
241ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
242LIBOBJS+=arm-dis.o
243endif
244ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
245LIBOBJS+=m68k-dis.o
246endif
247ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
248LIBOBJS+=sh4-dis.o
249endif
250ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
251LIBOBJS+=hppa-dis.o
252endif
253ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
254LIBOBJS+=s390-dis.o
255endif
256
257# libqemu
258
259libqemu.a: $(LIBOBJS)
260 rm -f $@
261 $(AR) rcs $@ $(LIBOBJS)
262
263translate.o: translate.c cpu.h
264
265translate-all.o: translate-all.c cpu.h
266
267tcg/tcg.o: cpu.h
268
269machine.o: machine.c
270 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
271
272# HELPER_CFLAGS is used for all the code compiled with static register
273# variables
274op_helper.o: op_helper.c
275 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $<
276
277cpu-exec.o: cpu-exec.c
278 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
279
280#########################################################
281# Linux user emulator target
282
283ifdef CONFIG_LINUX_USER
284
285ifndef TARGET_ABI_DIR
286 TARGET_ABI_DIR=$(TARGET_ARCH)
287endif
288VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
289CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
290
291ifdef CONFIG_STATIC
292LDFLAGS+=-static
293endif
294
295ifeq ($(ARCH),i386)
296ifdef TARGET_GPROF
297USE_I386_LD=y
298endif
299ifdef CONFIG_STATIC
300USE_I386_LD=y
301endif
302ifdef USE_I386_LD
303LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
304else
305# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
306# that the kernel ELF loader considers as an executable. I think this
307# is the simplest way to make it self virtualizable!
308LDFLAGS+=-Wl,-shared
309endif
310endif
311
312ifeq ($(ARCH),x86_64)
313LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
314endif
315
316ifeq ($(ARCH),ppc)
317LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
318endif
319
320ifeq ($(ARCH),ppc64)
321LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
322endif
323
324ifeq ($(ARCH),s390)
325LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
326endif
327
328ifeq ($(ARCH),sparc)
329# -static is used to avoid g1/g3 usage by the dynamic linker
330LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
331endif
332
333ifeq ($(ARCH),sparc64)
334LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
335endif
336
337ifeq ($(ARCH),alpha)
338LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
339endif
340
341ifeq ($(ARCH),ia64)
342LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
343endif
344
345ifeq ($(ARCH),arm)
346LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
347endif
348
349ifeq ($(ARCH),m68k)
350LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
351endif
352
353ifeq ($(ARCH),mips)
354ifeq ($(WORDS_BIGENDIAN),yes)
355LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
356else
357LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
358endif
359endif
360
361ifeq ($(ARCH),mips64)
362ifeq ($(WORDS_BIGENDIAN),yes)
363LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
364else
365LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
366endif
367endif
368
369# profiling code
370ifdef TARGET_GPROF
371LDFLAGS+=-p
372CFLAGS+=-p
373endif
374
375OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
376 elfload.o linuxload.o uaccess.o
377LIBS+= $(AIOLIBS)
378ifdef TARGET_HAS_BFLT
379OBJS+= flatload.o
380endif
381ifdef TARGET_HAS_ELFLOAD32
382OBJS+= elfload32.o
383elfload32.o: elfload.c
384endif
385
386ifeq ($(TARGET_ARCH), i386)
387OBJS+= vm86.o
388endif
389ifeq ($(TARGET_ARCH), arm)
390OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
391nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
392 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
393endif
394ifeq ($(TARGET_ARCH), m68k)
395OBJS+= m68k-sim.o m68k-semi.o
396endif
397
398ifdef CONFIG_GDBSTUB
399OBJS+=gdbstub.o gdbstub-xml.o
400endif
401
402OBJS+= libqemu.a
403
404# Note: this is a workaround. The real fix is to avoid compiling
405# cpu_signal_handler() in cpu-exec.c.
406signal.o: signal.c
407 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
408
409$(QEMU_PROG): $(OBJS) ../libqemu_user.a
410 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
411ifeq ($(ARCH),alpha)
412# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
413# the address space (31 bit so sign extending doesn't matter)
414 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
415endif
416
417endif #CONFIG_LINUX_USER
418
419#########################################################
420# Darwin user emulator target
421
422ifdef CONFIG_DARWIN_USER
423
424VPATH+=:$(SRC_PATH)/darwin-user
425CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
426
427# Leave some space for the regular program loading zone
428LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
429
430LIBS+=-lmx
431
432OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
433
434OBJS+= libqemu.a
435
436ifdef CONFIG_GDBSTUB
437OBJS+=gdbstub.o gdbstub-xml.o
438endif
439
440# Note: this is a workaround. The real fix is to avoid compiling
441# cpu_signal_handler() in cpu-exec.c.
442signal.o: signal.c
443 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
444
445$(QEMU_PROG): $(OBJS)
446 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
447
448endif #CONFIG_DARWIN_USER
449
450#########################################################
451# BSD user emulator target
452
453ifdef CONFIG_BSD_USER
454
455VPATH+=:$(SRC_PATH)/bsd-user
456CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
457
458ifdef CONFIG_STATIC
459LDFLAGS+=-static
460endif
461
462ifeq ($(ARCH),i386)
463ifdef TARGET_GPROF
464USE_I386_LD=y
465endif
466ifdef CONFIG_STATIC
467USE_I386_LD=y
468endif
469ifdef USE_I386_LD
470LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
471else
472# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
473# that the kernel ELF loader considers as an executable. I think this
474# is the simplest way to make it self virtualizable!
475LDFLAGS+=-Wl,-shared
476endif
477endif
478
479ifeq ($(ARCH),x86_64)
480LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
481endif
482
483ifeq ($(ARCH),ppc)
484LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
485endif
486
487ifeq ($(ARCH),ppc64)
488LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
489endif
490
491ifeq ($(ARCH),s390)
492LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
493endif
494
495ifeq ($(ARCH),sparc)
496# -static is used to avoid g1/g3 usage by the dynamic linker
497LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
498endif
499
500ifeq ($(ARCH),sparc64)
501LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
502endif
503
504ifeq ($(ARCH),alpha)
505LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
506endif
507
508ifeq ($(ARCH),ia64)
509LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
510endif
511
512ifeq ($(ARCH),arm)
513LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
514endif
515
516ifeq ($(ARCH),m68k)
517LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
518endif
519
520ifeq ($(ARCH),mips)
521ifeq ($(WORDS_BIGENDIAN),yes)
522LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
523else
524LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
525endif
526endif
527
528ifeq ($(ARCH),mips64)
529ifeq ($(WORDS_BIGENDIAN),yes)
530LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
531else
532LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
533endif
534endif
535
536OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
537OBJS+= uaccess.o
538
539OBJS+= libqemu.a
540
541ifdef CONFIG_GDBSTUB
542OBJS+=gdbstub.o
543endif
544
545# Note: this is a workaround. The real fix is to avoid compiling
546# cpu_signal_handler() in cpu-exec.c.
547signal.o: signal.c
548 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
549
550$(QEMU_PROG): $(OBJS) ../libqemu_user.a
551 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
552
553endif #CONFIG_BSD_USER
554
555#########################################################
556# System emulator target
557ifndef CONFIG_USER_ONLY
558
559OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o
560OBJS+=fw_cfg.o
561ifdef CONFIG_KVM
562OBJS+=kvm.o kvm-all.o
563endif
564ifdef CONFIG_WIN32
565OBJS+=block-raw-win32.o
566else
567ifdef CONFIG_AIO
568OBJS+=posix-aio-compat.o
569endif
570OBJS+=block-raw-posix.o
571endif
572
573LIBS+=-lz
574ifdef CONFIG_ALSA
575LIBS += -lasound
576endif
577ifdef CONFIG_ESD
578LIBS += -lesd
579endif
580ifdef CONFIG_PA
581LIBS += -lpulse-simple
582endif
583ifdef CONFIG_DSOUND
584LIBS += -lole32 -ldxguid
585endif
586ifdef CONFIG_FMOD
587LIBS += $(CONFIG_FMOD_LIB)
588endif
589ifdef CONFIG_OSS
590LIBS += $(CONFIG_OSS_LIB)
591endif
592
593SOUND_HW = sb16.o es1370.o
594ifdef CONFIG_AC97
595SOUND_HW += ac97.o
596endif
597ifdef CONFIG_ADLIB
598SOUND_HW += fmopl.o adlib.o
599adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
600endif
601ifdef CONFIG_GUS
602SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
603endif
604ifdef CONFIG_CS4231A
605SOUND_HW += cs4231a.o
606endif
607
608ifdef CONFIG_VNC_TLS
609CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
610LIBS += $(CONFIG_VNC_TLS_LIBS)
611endif
612
613ifdef CONFIG_BLUEZ
614LIBS += $(CONFIG_BLUEZ_LIBS)
615endif
616
617# SCSI layer
618OBJS+= lsi53c895a.o esp.o
619
620# USB layer
621OBJS+= usb-ohci.o
622
623# EEPROM emulation
624OBJS += eeprom93xx.o
625
626# PCI network cards
627OBJS += eepro100.o
628OBJS += ne2000.o
629OBJS += pcnet.o
630OBJS += rtl8139.o
631OBJS += e1000.o
632
633ifeq ($(TARGET_BASE_ARCH), i386)
634# Hardware support
635OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
636OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
637OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
638OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
639# virtio support
640OBJS+= virtio.o virtio-blk.o virtio-balloon.o
641CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
642endif
643ifeq ($(TARGET_BASE_ARCH), ppc)
644CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
645# shared objects
646OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
647# PREP target
648OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
649OBJS+= prep_pci.o ppc_prep.o
650# Mac shared devices
651OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
652# OldWorld PowerMac
653OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
654# NewWorld PowerMac
655OBJS+= unin_pci.o ppc_chrp.o
656# PowerPC 4xx boards
657OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
658# virtio support
659OBJS+= virtio.o virtio-blk.o virtio-balloon.o
660endif
661ifeq ($(TARGET_BASE_ARCH), mips)
662OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
663OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
664OBJS+= g364fb.o jazz_led.o
665OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
666OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
667OBJS+= mipsnet.o
668OBJS+= pflash_cfi01.o
669CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
670endif
671ifeq ($(TARGET_BASE_ARCH), cris)
672OBJS+= etraxfs.o
673OBJS+= etraxfs_dma.o
674OBJS+= etraxfs_pic.o
675OBJS+= etraxfs_eth.o
676OBJS+= etraxfs_timer.o
677OBJS+= etraxfs_ser.o
678
679OBJS+= ptimer.o
680OBJS+= pflash_cfi02.o
681endif
682ifeq ($(TARGET_BASE_ARCH), sparc)
683ifeq ($(TARGET_ARCH), sparc64)
684OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
685OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
686OBJS+= cirrus_vga.o parallel.o ptimer.o
687else
688OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
689OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o sparc32_dma.o
690OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
691endif
692endif
693ifeq ($(TARGET_BASE_ARCH), arm)
694OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
695OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
696OBJS+= versatile_pci.o ptimer.o
697OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
698OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
699OBJS+= pl061.o
700OBJS+= arm-semi.o
701OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
702OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
703OBJS+= pflash_cfi01.o gumstix.o
704OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
705OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
706OBJS+= omap2.o omap_dss.o soc_dma.o
707OBJS+= palm.o tsc210x.o
708OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
709OBJS+= tsc2005.o bt-hci-csr.o
710OBJS+= mst_fpga.o mainstone.o
711OBJS+= musicpal.o pflash_cfi02.o
712CPPFLAGS += -DHAS_AUDIO
713endif
714ifeq ($(TARGET_BASE_ARCH), sh4)
715OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
716OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
717OBJS+= ide.o
718endif
719ifeq ($(TARGET_BASE_ARCH), m68k)
720OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
721OBJS+= m68k-semi.o dummy_m68k.o
722endif
723ifdef CONFIG_GDBSTUB
724OBJS+=gdbstub.o gdbstub-xml.o
725endif
726ifdef CONFIG_COCOA
727COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
728ifdef CONFIG_COREAUDIO
729COCOA_LIBS+=-framework CoreAudio
730endif
731endif
732ifdef CONFIG_SLIRP
733CPPFLAGS+=-I$(SRC_PATH)/slirp
734endif
735
736LIBS+=$(AIOLIBS)
737# specific flags are needed for non soft mmu emulator
738ifdef CONFIG_STATIC
739LDFLAGS+=-static
740endif
741ifndef CONFIG_DARWIN
742ifndef CONFIG_WIN32
743ifndef CONFIG_SOLARIS
744ifndef CONFIG_AIX
745LIBS+=-lutil
746endif
747endif
748endif
749endif
750ifdef TARGET_GPROF
751vl.o: CFLAGS+=-p
752LDFLAGS+=-p
753endif
754
755ifeq ($(ARCH),ia64)
756LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
757endif
758
759ifdef CONFIG_WIN32
760SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
761endif
762
763# profiling code
764ifdef TARGET_GPROF
765LDFLAGS+=-p
766main.o: CFLAGS+=-p
767endif
768
769$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
770 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
771
772endif # !CONFIG_USER_ONLY
773
774gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
775 rm -f $@
776ifeq ($(TARGET_XML_FILES),)
777 echo > $@
778else
779 $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
780endif
781
782%.o: %.c
783 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
784
785%.o: %.S
786 $(CC) $(CPPFLAGS) -c -o $@ $<
787
788clean:
789 rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
790 rm -f *.d */*.d tcg/*.o
791
792install: all
793ifneq ($(PROGS),)
794 $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
795endif
796
797# Include automatically generated dependency files
798-include $(wildcard *.d */*.d)