72
83
# We require -O2 to avoid the stack setup prologue in EXIT_TB
73
OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
84
OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
87
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
89
cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
90
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
92
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
93
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
94
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
95
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
96
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
97
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
98
OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
99
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
75
101
ifeq ($(ARCH),i386)
76
102
HELPER_CFLAGS+=-fomit-frame-pointer
77
103
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
78
ifeq ($(HAVE_GCC3_OPTIONS),yes)
79
OP_CFLAGS+= -falign-functions=0 -fno-gcse
81
OP_CFLAGS+= -malign-functions=0
83
104
ifdef TARGET_GPROF
116
137
ifeq ($(ARCH),sparc)
117
ifeq ($(CONFIG_SOLARIS),yes)
118
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
120
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
122
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
124
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
125
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
126
# -static is used to avoid g1/g3 usage by the dynamic linker
127
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
138
BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
139
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
140
ifeq ($(CONFIG_SOLARIS),yes)
141
OP_CFLAGS+=-fno-omit-frame-pointer
143
BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
144
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
145
# -static is used to avoid g1/g3 usage by the dynamic linker
146
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
131
150
ifeq ($(ARCH),sparc64)
132
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
134
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
135
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
151
BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
152
OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
153
ifneq ($(CONFIG_SOLARIS),yes)
154
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
155
OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
138
159
ifeq ($(ARCH),alpha)
162
183
ifeq ($(ARCH),mips)
184
OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
185
ifeq ($(WORDS_BIGENDIAN),yes)
163
186
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
188
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
166
ifeq ($(HAVE_GCC3_OPTIONS),yes)
167
# very important to generate a return at the end of every operation
168
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
192
ifeq ($(ARCH),mips64)
193
OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
194
ifeq ($(WORDS_BIGENDIAN),yes)
195
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
197
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
171
201
ifeq ($(CONFIG_DARWIN),yes)
321
368
# must use static linking to avoid leaving stuff in virtual address space
322
369
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o
323
370
VL_OBJS+=cutils.o
371
VL_OBJS+=host-utils.o
324
372
VL_OBJS+=block.o block-raw.o
325
VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o
373
VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o
326
375
ifdef CONFIG_WIN32
327
376
VL_OBJS+=tap-win32.o
330
379
SOUND_HW = sb16.o es1370.o
331
AUDIODRV = audio.o noaudio.o wavaudio.o
380
AUDIODRV = audio.o noaudio.o wavaudio.o mixeng.o
333
382
AUDIODRV += sdlaudio.o
357
406
AUDIODRV+= wavcapture.o
408
VL_OBJS += i2c.o smbus.o
360
411
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
363
414
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
415
VL_OBJS+= usb-wacom.o
418
VL_OBJS += eeprom93xx.o
365
420
# PCI network cards
366
VL_OBJS+= ne2000.o rtl8139.o pcnet.o
421
VL_OBJS += eepro100.o
368
426
ifeq ($(TARGET_BASE_ARCH), i386)
369
427
# Hardware support
370
428
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
371
429
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
372
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o
373
VL_OBJS+= usb-uhci.o smbus_eeprom.o
374
CPPFLAGS += -DHAS_AUDIO
430
VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
431
VL_OBJS+= usb-uhci.o smbus_eeprom.o vmmouse.o vmware_vga.o
432
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
376
434
ifeq ($(TARGET_BASE_ARCH), ppc)
377
435
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
378
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
379
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
380
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
436
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o pflash_cfi02.o
437
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o
438
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o ppc405_uc.o ppc405_boards.o
439
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
441
ifeq ($(TARGET_BASE_ARCH), mips)
442
VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o
443
VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
445
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
446
VL_OBJS+= piix_pci.o smbus_eeprom.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV)
381
447
CPPFLAGS += -DHAS_AUDIO
383
ifeq ($(TARGET_ARCH), mips)
384
VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
385
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o
386
VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV)
387
DEFINES += -DHAS_AUDIO
389
449
ifeq ($(TARGET_BASE_ARCH), sparc)
390
450
ifeq ($(TARGET_ARCH), sparc64)
391
451
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
392
452
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
393
VL_OBJS+= cirrus_vga.o parallel.o
453
VL_OBJS+= cirrus_vga.o parallel.o ptimer.o
395
455
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
396
456
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
457
VL_OBJS+= cs4231.o ptimer.o
400
460
ifeq ($(TARGET_BASE_ARCH), arm)
401
461
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
402
VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o
403
VL_OBJS+= versatile_pci.o
462
VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
463
VL_OBJS+= versatile_pci.o sd.o ptimer.o
404
464
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
405
465
VL_OBJS+= arm-semi.o
466
VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
467
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o
468
VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o $(AUDIODRV) wm8750.o
469
VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o palm.o
470
CPPFLAGS += -DHAS_AUDIO
407
472
ifeq ($(TARGET_BASE_ARCH), sh4)
408
473
VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
475
ifeq ($(TARGET_BASE_ARCH), m68k)
476
VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
477
VL_OBJS+= m68k-semi.o
410
479
ifdef CONFIG_GDBSTUB
411
480
VL_OBJS+=gdbstub.o
546
624
translate.o: translate.c translate_init.c
549
ifeq ($(TARGET_ARCH), mips)
550
op.o: op.c op_template.c fop_template.c op_mem.c
551
op_helper.o: op_helper_mem.c
627
ifeq ($(TARGET_BASE_ARCH), mips)
628
helper.o: cpu.h exec-all.h
629
op.o: op_template.c fop_template.c op_mem.c exec.h cpu.h
630
op_helper.o: op_helper_mem.c exec.h softmmu_template.h cpu.h
631
translate.o: translate_init.c exec-all.h disas.h
554
634
loader.o: loader.c elf_ops.h