Statistics
| Branch: | Revision:

root / Makefile.target @ d80438aa

History | View | Annotate | Download (16.9 kB)

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
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
64
CPPFLAGS+=-U_FORTIFY_SOURCE
65
LIBS+=-lm
66
ifdef CONFIG_WIN32
67
LIBS+=-lwinmm -lws2_32 -liphlpapi
68
endif
69
ifdef CONFIG_SOLARIS
70
LIBS+=-lsocket -lnsl -lresolv
71
ifdef NEEDS_LIBSUNMATH
72
LIBS+=-lsunmath
73
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
74
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
75
endif
76
endif
77

    
78
kvm.o: CFLAGS+=$(KVM_CFLAGS)
79
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
80

    
81
all: $(PROGS)
82
# Dummy command so that make thinks it has done something
83
	@true
84

    
85
#########################################################
86
# cpu emulator library
87
libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
88
libobj-$(CONFIG_KQEMU) += kqemu.o
89
# TCG code generator
90
libobj-y += tcg/tcg.o tcg/tcg-runtime.o
91
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
92
ifeq ($(ARCH),sparc64)
93
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
94
endif
95
ifdef CONFIG_SOFTFLOAT
96
libobj-y += fpu/softfloat.o
97
else
98
libobj-y += fpu/softfloat-native.o
99
endif
100
CPPFLAGS+=-I$(SRC_PATH)/fpu
101
libobj-y += op_helper.o helper.o
102

    
103
ifeq ($(TARGET_BASE_ARCH), arm)
104
libobj-y += neon_helper.o iwmmxt_helper.o
105
endif
106

    
107
ifeq ($(TARGET_BASE_ARCH), alpha)
108
libobj-y += alpha_palcode.o
109
endif
110

    
111
ifeq ($(TARGET_BASE_ARCH), cris)
112
libobj-y += cris-dis.o
113

    
114
ifndef CONFIG_USER_ONLY
115
libobj-y += mmu.o
116
endif
117
endif
118

    
119
# NOTE: the disassembler code is only needed for debugging
120
libobj-y += disas.o
121
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
122
USE_I386_DIS=y
123
endif
124
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
125
USE_I386_DIS=y
126
endif
127
libobj-$(USE_I386_DIS) += i386-dis.o
128
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
129
libobj-y += alpha-dis.o
130
endif
131
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
132
libobj-y += ppc-dis.o
133
endif
134
ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
135
libobj-y += microblaze-dis.o
136
ifndef CONFIG_USER_ONLY
137
libobj-y += mmu.o
138
endif
139
endif
140
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
141
libobj-y += mips-dis.o
142
endif
143
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
144
libobj-y += sparc-dis.o
145
endif
146
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
147
libobj-y += arm-dis.o
148
endif
149
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
150
libobj-y += m68k-dis.o
151
endif
152
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
153
libobj-y += sh4-dis.o
154
endif
155
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
156
libobj-y += hppa-dis.o
157
endif
158
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
159
libobj-y += s390-dis.o
160
endif
161

    
162
# libqemu
163

    
164
libqemu.a: $(libobj-y)
165

    
166
translate.o: translate.c cpu.h
167

    
168
translate-all.o: translate-all.c cpu.h
169

    
170
tcg/tcg.o: cpu.h
171

    
172
# HELPER_CFLAGS is used for all the code compiled with static register
173
# variables
174
op_helper.o: CFLAGS += $(HELPER_CFLAGS)
175

    
176
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
177

    
178
#########################################################
179
# Linux user emulator target
180

    
181
ifdef CONFIG_LINUX_USER
182

    
183
ifndef TARGET_ABI_DIR
184
  TARGET_ABI_DIR=$(TARGET_ARCH)
185
endif
186
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
187
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
188

    
189
ifdef CONFIG_STATIC
190
LDFLAGS+=-static
191
endif
192

    
193
ifeq ($(ARCH),i386)
194
ifdef TARGET_GPROF
195
USE_I386_LD=y
196
endif
197
ifdef CONFIG_STATIC
198
USE_I386_LD=y
199
endif
200
ifdef USE_I386_LD
201
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
202
else
203
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
204
# that the kernel ELF loader considers as an executable. I think this
205
# is the simplest way to make it self virtualizable!
206
LDFLAGS+=-Wl,-shared
207
endif
208
endif
209

    
210
ifeq ($(ARCH),x86_64)
211
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
212
endif
213

    
214
ifeq ($(ARCH),ppc)
215
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
216
endif
217

    
218
ifeq ($(ARCH),ppc64)
219
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
220
endif
221

    
222
ifeq ($(ARCH),s390)
223
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
224
endif
225

    
226
ifeq ($(ARCH),sparc)
227
# -static is used to avoid g1/g3 usage by the dynamic linker	
228
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
229
endif
230

    
231
ifeq ($(ARCH),sparc64)
232
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
233
endif
234

    
235
ifeq ($(ARCH),alpha)
236
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
237
endif
238

    
239
ifeq ($(ARCH),ia64)
240
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
241
endif
242

    
243
ifeq ($(ARCH),arm)
244
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
245
endif
246

    
247
ifeq ($(ARCH),m68k)
248
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
249
endif
250

    
251
ifeq ($(ARCH),mips)
252
ifeq ($(WORDS_BIGENDIAN),yes)
253
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
254
else
255
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
256
endif
257
endif
258

    
259
ifeq ($(ARCH),mips64)
260
ifeq ($(WORDS_BIGENDIAN),yes)
261
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
262
else
263
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
264
endif
265
endif
266

    
267
# profiling code
268
ifdef TARGET_GPROF
269
LDFLAGS+=-p
270
CFLAGS+=-p
271
endif
272

    
273
obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
274
      elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
275
      ioport-user.o
276
LIBS+= $(PTHREADLIBS)
277
LIBS+= $(CLOCKLIBS)
278
obj-$(TARGET_HAS_BFLT) += flatload.o
279

    
280
ifdef TARGET_HAS_ELFLOAD32
281
elfload32.o: elfload.c
282
endif
283
obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
284

    
285
ifeq ($(TARGET_ARCH), i386)
286
obj-y += vm86.o
287
endif
288

    
289
nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
290
nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
291
obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
292
obj-arm-y += arm-semi.o
293

    
294
obj-m68k-y += m68k-sim.o m68k-semi.o
295

    
296
# Note: this is a workaround. The real fix is to avoid compiling
297
# cpu_signal_handler() in cpu-exec.c.
298
signal.o: CFLAGS += $(HELPER_CFLAGS)
299

    
300
ARLIBS=../libqemu_user.a libqemu.a
301
endif #CONFIG_LINUX_USER
302

    
303
#########################################################
304
# Darwin user emulator target
305

    
306
ifdef CONFIG_DARWIN_USER
307

    
308
VPATH+=:$(SRC_PATH)/darwin-user
309
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
310

    
311
# Leave some space for the regular program loading zone
312
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
313

    
314
LIBS+=-lmx
315

    
316
obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
317
        gdbstub.o gdbstub-xml.o ioport-user.o
318

    
319
# Note: this is a workaround. The real fix is to avoid compiling
320
# cpu_signal_handler() in cpu-exec.c.
321
signal.o: CFLAGS += $(HELPER_CFLAGS)
322

    
323
ARLIBS=libqemu.a
324

    
325
endif #CONFIG_DARWIN_USER
326

    
327
#########################################################
328
# BSD user emulator target
329

    
330
ifdef CONFIG_BSD_USER
331

    
332
VPATH+=:$(SRC_PATH)/bsd-user
333
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
334

    
335
ifdef CONFIG_STATIC
336
LDFLAGS+=-static
337
endif
338

    
339
ifeq ($(ARCH),i386)
340
ifdef TARGET_GPROF
341
USE_I386_LD=y
342
endif
343
ifdef CONFIG_STATIC
344
USE_I386_LD=y
345
endif
346
ifdef USE_I386_LD
347
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
348
else
349
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
350
# that the kernel ELF loader considers as an executable. I think this
351
# is the simplest way to make it self virtualizable!
352
LDFLAGS+=-Wl,-shared
353
endif
354
endif
355

    
356
ifeq ($(ARCH),x86_64)
357
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
358
endif
359

    
360
ifeq ($(ARCH),ppc)
361
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
362
endif
363

    
364
ifeq ($(ARCH),ppc64)
365
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
366
endif
367

    
368
ifeq ($(ARCH),s390)
369
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
370
endif
371

    
372
ifeq ($(ARCH),sparc)
373
# -static is used to avoid g1/g3 usage by the dynamic linker
374
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
375
endif
376

    
377
ifeq ($(ARCH),sparc64)
378
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
379
endif
380

    
381
ifeq ($(ARCH),alpha)
382
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
383
endif
384

    
385
ifeq ($(ARCH),ia64)
386
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
387
endif
388

    
389
ifeq ($(ARCH),arm)
390
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
391
endif
392

    
393
ifeq ($(ARCH),m68k)
394
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
395
endif
396

    
397
ifeq ($(ARCH),mips)
398
ifeq ($(WORDS_BIGENDIAN),yes)
399
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
400
else
401
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
402
endif
403
endif
404

    
405
ifeq ($(ARCH),mips64)
406
ifeq ($(WORDS_BIGENDIAN),yes)
407
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
408
else
409
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
410
endif
411
endif
412

    
413
obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
414
        gdbstub.o gdbstub-xml.o ioport-user.o
415
obj-y += uaccess.o
416

    
417
# Note: this is a workaround. The real fix is to avoid compiling
418
# cpu_signal_handler() in cpu-exec.c.
419
signal.o: CFLAGS += $(HELPER_CFLAGS)
420

    
421
ARLIBS=libqemu.a ../libqemu_user.a
422

    
423
endif #CONFIG_BSD_USER
424

    
425
#########################################################
426
# System emulator target
427
ifndef CONFIG_USER_ONLY
428

    
429
obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
430
        gdbstub.o gdbstub-xml.o msix.o ioport.o
431
# virtio has to be here due to weird dependency between PCI and virtio-net.
432
# need to fix this properly
433
obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
434
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
435

    
436
LIBS+=-lz
437
ifdef CONFIG_ALSA
438
LIBS += -lasound
439
endif
440
ifdef CONFIG_ESD
441
LIBS += -lesd
442
endif
443
ifdef CONFIG_PA
444
LIBS += -lpulse-simple
445
endif
446
ifdef CONFIG_DSOUND
447
LIBS += -lole32 -ldxguid
448
endif
449
ifdef CONFIG_FMOD
450
LIBS += $(CONFIG_FMOD_LIB)
451
endif
452
ifdef CONFIG_OSS
453
LIBS += $(CONFIG_OSS_LIB)
454
endif
455

    
456
sound-obj-y =
457
sound-obj-$(CONFIG_SB16) += sb16.o
458
sound-obj-$(CONFIG_ES1370) += es1370.o
459
sound-obj-$(CONFIG_AC97) += ac97.o
460
sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
461
sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
462
sound-obj-$(CONFIG_CS4231A) += cs4231a.o
463

    
464
ifdef CONFIG_ADLIB
465
adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
466
endif
467

    
468
ifdef CONFIG_VNC_TLS
469
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
470
LIBS += $(CONFIG_VNC_TLS_LIBS)
471
endif
472

    
473
ifdef CONFIG_VNC_SASL
474
CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
475
LIBS += $(CONFIG_VNC_SASL_LIBS)
476
endif
477

    
478
ifdef CONFIG_BLUEZ
479
LIBS += $(CONFIG_BLUEZ_LIBS)
480
endif
481

    
482
# xen backend driver support
483
obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
484
ifeq ($(CONFIG_XEN), y)
485
  LIBS += $(XEN_LIBS)
486
endif
487

    
488
# USB layer
489
obj-y += usb-ohci.o
490

    
491
# PCI network cards
492
obj-y += eepro100.o
493
obj-y += ne2000.o
494
obj-y += pcnet.o
495
obj-y += rtl8139.o
496
obj-y += e1000.o
497

    
498
# Generic watchdog support and some watchdog devices
499
obj-y += wdt_ib700.o wdt_i6300esb.o
500

    
501
# Hardware support
502
obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
503
obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
504
obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
505
obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
506
obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
507

    
508
ifeq ($(TARGET_BASE_ARCH), i386)
509
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
510
endif
511

    
512
# shared objects
513
obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
514
# PREP target
515
obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
516
obj-ppc-y += prep_pci.o ppc_prep.o
517
# Mac shared devices
518
obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
519
# OldWorld PowerMac
520
obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
521
# NewWorld PowerMac
522
obj-ppc-y += unin_pci.o ppc_newworld.o
523
# PowerPC 4xx boards
524
obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
525
obj-ppc-y += ppc440.o ppc440_bamboo.o
526
# PowerPC E500 boards
527
obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
528
obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
529

    
530
ifeq ($(TARGET_BASE_ARCH), ppc)
531
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
532
endif
533

    
534
ifdef FDT_LIBS
535
obj-ppc-y += device_tree.o
536
LIBS+= $(FDT_LIBS)
537
endif
538

    
539
obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
540
obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
541
obj-mips-y += g364fb.o jazz_led.o dp8393x.o
542
obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
543
obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
544
obj-mips-y += mipsnet.o
545
obj-mips-y += pflash_cfi01.o
546
obj-mips-y += vmware_vga.o
547

    
548
ifeq ($(TARGET_BASE_ARCH), mips)
549
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
550
endif
551

    
552
obj-microblaze-y = petalogix_s3adsp1800_mmu.o
553

    
554
obj-microblaze-y += microblaze_pic_cpu.o
555
obj-microblaze-y += xilinx_intc.o
556
obj-microblaze-y += xilinx_timer.o
557
obj-microblaze-y += xilinx_uartlite.o
558
obj-microblaze-y += xilinx_ethlite.o
559

    
560
obj-microblaze-y += pflash_cfi02.o
561

    
562
ifdef FDT_LIBS
563
obj-microblaze-y += device_tree.o
564
LIBS+= $(FDT_LIBS)
565
endif
566

    
567
# Boards
568
obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
569

    
570
# IO blocks
571
obj-cris-y += etraxfs_dma.o
572
obj-cris-y += etraxfs_pic.o
573
obj-cris-y += etraxfs_eth.o
574
obj-cris-y += etraxfs_timer.o
575
obj-cris-y += etraxfs_ser.o
576

    
577
obj-cris-y += pflash_cfi02.o
578

    
579
ifeq ($(TARGET_ARCH), sparc64)
580
obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
581
obj-sparc-y += fdc.o mc146818rtc.o serial.o
582
obj-sparc-y += cirrus_vga.o parallel.o
583
else
584
obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
585
obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
586
obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
587
endif
588

    
589
obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
590
obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
591
obj-arm-y += versatile_pci.o
592
obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
593
obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
594
obj-arm-y += pl061.o
595
obj-arm-y += arm-semi.o
596
obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
597
obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
598
obj-arm-y += pflash_cfi01.o gumstix.o
599
obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
600
obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
601
obj-arm-y += omap2.o omap_dss.o soc_dma.o
602
obj-arm-y += omap_sx1.o palm.o tsc210x.o
603
obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
604
obj-arm-y += mst_fpga.o mainstone.o
605
obj-arm-y += musicpal.o pflash_cfi02.o
606
obj-arm-y += framebuffer.o
607
obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
608
obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
609
obj-arm-y += syborg_virtio.o
610

    
611
ifeq ($(TARGET_BASE_ARCH), arm)
612
CPPFLAGS += -DHAS_AUDIO
613
endif
614

    
615
obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
616
obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
617
obj-sh4-y += ide.o
618

    
619
obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
620
obj-m68k-y += m68k-semi.o dummy_m68k.o
621

    
622
ifdef CONFIG_COCOA
623
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
624
ifdef CONFIG_COREAUDIO
625
COCOA_LIBS+=-framework CoreAudio
626
endif
627
endif
628
ifdef CONFIG_SLIRP
629
CPPFLAGS+=-I$(SRC_PATH)/slirp
630
endif
631

    
632
# specific flags are needed for non soft mmu emulator
633
ifdef CONFIG_STATIC
634
LDFLAGS+=-static
635
endif
636
ifndef CONFIG_DARWIN
637
ifndef CONFIG_WIN32
638
ifndef CONFIG_SOLARIS
639
ifndef CONFIG_AIX
640
LIBS+=-lutil
641
endif
642
endif
643
endif
644
endif
645
ifdef TARGET_GPROF
646
vl.o: CFLAGS+=-p
647
LDFLAGS+=-p
648
endif
649

    
650
ifeq ($(ARCH),ia64)
651
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
652
endif
653

    
654
ifdef CONFIG_WIN32
655
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
656
endif
657

    
658
# profiling code
659
ifdef TARGET_GPROF
660
LDFLAGS+=-p
661
main.o: CFLAGS+=-p
662
endif
663

    
664
vl.o: CFLAGS+=$(SDL_CFLAGS)
665

    
666
vl.o: qemu-options.h
667

    
668
monitor.o: qemu-monitor.h
669

    
670
LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
671
ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
672

    
673
endif # !CONFIG_USER_ONLY
674

    
675
$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
676
	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
677

    
678

    
679
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
680
ifeq ($(TARGET_XML_FILES),)
681
	$(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
682
else
683
	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
684
endif
685

    
686
qemu-options.h: $(SRC_PATH)/qemu-options.hx
687
	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
688

    
689
qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
690
	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
691

    
692
clean:
693
	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
694
	rm -f *.d */*.d tcg/*.o
695
	rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
696

    
697
install: all
698
ifneq ($(PROGS),)
699
	$(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
700
endif
701

    
702
# Include automatically generated dependency files
703
-include $(wildcard *.d */*.d)