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