ia64/xen-unstable

annotate tools/ioemu/Makefile.target @ 17246:0f204e41cc93

stubdom: disable xen_blktap

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 13:13:31 2008 +0000 (2008-03-18)
parents f07a7ba63885
children ad55c06c9bbc
rev   line source
chris@10732 1 include config.mak
chris@10732 2
chris@10732 3 XEN_ROOT=../../..
chris@10732 4 include $(XEN_ROOT)/tools/Rules.mk
chris@10732 5
chris@10732 6 TARGET_BASE_ARCH:=$(TARGET_ARCH)
chris@10732 7 ifeq ($(TARGET_ARCH), x86_64)
chris@10732 8 TARGET_BASE_ARCH:=i386
chris@10732 9 endif
chris@10732 10 ifeq ($(TARGET_ARCH), ppc64)
chris@10732 11 TARGET_BASE_ARCH:=ppc
chris@10732 12 endif
chris@10732 13 ifeq ($(TARGET_ARCH), sparc64)
chris@10732 14 TARGET_BASE_ARCH:=sparc
chris@10732 15 endif
chris@10732 16 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)$(TARGET_SUB)
chris@10732 17 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
keir@17042 18 CPPFLAGS+=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
Christian@15060 19 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
keir@17223 20 CPPFLAGS+= -I$(XEN_ROOT)/tools/blktap/lib
Christian@15060 21 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
keir@16894 22 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
Christian@15060 23 ifdef CONFIG_DARWIN_USER
Christian@15060 24 VPATH+=:$(SRC_PATH)/darwin-user
Christian@15060 25 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
Christian@15060 26 endif
Christian@15060 27 ifdef CONFIG_LINUX_USER
chris@10732 28 VPATH+=:$(SRC_PATH)/linux-user
Christian@15060 29 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
chris@10732 30 endif
Christian@15060 31 BASE_CFLAGS=
Christian@15060 32 BASE_LDFLAGS=
kfraser@11893 33 SSE2 := $(call cc-option,$(CC),-msse2,)
chris@10732 34 ifeq ($(SSE2),-msse2)
chris@10732 35 CFLAGS += -DUSE_SSE2=1 -msse2
chris@10732 36 endif
chris@10732 37 #CFLAGS+=-Werror
chris@10732 38 LIBS=
chris@10732 39 HELPER_CFLAGS=$(CFLAGS)
chris@10732 40 DYNGEN=../dyngen$(EXESUF)
chris@10732 41 # user emulator name
chris@10732 42 TARGET_ARCH2=$(TARGET_ARCH)
chris@10732 43 ifeq ($(TARGET_ARCH),arm)
chris@10732 44 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
chris@10732 45 TARGET_ARCH2=armeb
chris@10732 46 endif
chris@10732 47 endif
chris@10985 48 ifeq ($(TARGET_ARCH),sh4)
chris@10985 49 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
chris@10985 50 TARGET_ARCH2=sh4eb
chris@10985 51 endif
chris@10985 52 endif
chris@10732 53 ifeq ($(TARGET_ARCH),mips)
chris@10732 54 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
chris@10732 55 TARGET_ARCH2=mipsel
chris@10732 56 endif
chris@10732 57 endif
chris@10732 58 QEMU_USER=qemu-$(TARGET_ARCH2)
chris@10732 59 # system emulator name
chris@10732 60 ifdef CONFIG_SOFTMMU
chris@10732 61 ifeq ($(TARGET_ARCH), i386)
chris@10732 62 QEMU_SYSTEM=qemu$(EXESUF)
chris@10732 63 else
chris@10732 64 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
chris@10732 65 endif
chris@10732 66 else
chris@10732 67 QEMU_SYSTEM=qemu-fast
chris@10732 68 endif
chris@10732 69
keir@17042 70 ifdef CONFIG_STUBDOM
keir@17042 71 QEMU_SYSTEM=qemu.a
keir@17042 72 else
chris@10732 73 QEMU_SYSTEM=qemu-dm
keir@17042 74 endif
chris@10732 75
chris@10732 76 ifdef CONFIG_USER_ONLY
chris@10732 77 PROGS=$(QEMU_USER)
chris@10732 78 else
chris@10732 79 PROGS+=$(QEMU_SYSTEM)
chris@10732 80 ifndef CONFIG_SOFTMMU
chris@10732 81 CONFIG_STATIC=y
chris@10732 82 endif
chris@10732 83 endif # !CONFIG_USER_ONLY
chris@10732 84
chris@10732 85 ifdef CONFIG_STATIC
Christian@15060 86 BASE_LDFLAGS+=-static
chris@10732 87 endif
chris@10732 88
Christian@15060 89 # We require -O2 to avoid the stack setup prologue in EXIT_TB
Christian@15060 90 OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
Christian@15060 91
chris@10732 92 ifeq ($(ARCH),i386)
Christian@15060 93 HELPER_CFLAGS+=-fomit-frame-pointer
Christian@15060 94 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
chris@10732 95 ifeq ($(HAVE_GCC3_OPTIONS),yes)
chris@10732 96 OP_CFLAGS+= -falign-functions=0 -fno-gcse
chris@10732 97 else
chris@10732 98 OP_CFLAGS+= -malign-functions=0
chris@10732 99 endif
chris@10732 100 ifdef TARGET_GPROF
chris@10732 101 USE_I386_LD=y
chris@10732 102 endif
chris@10732 103 ifdef CONFIG_STATIC
chris@10732 104 USE_I386_LD=y
chris@10732 105 endif
chris@10732 106 ifdef USE_I386_LD
Christian@15060 107 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 108 else
Christian@15060 109 ifdef CONFIG_LINUX_USER
chris@10732 110 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
chris@10732 111 # that the kernel ELF loader considers as an executable. I think this
chris@10732 112 # is the simplest way to make it self virtualizable!
Christian@15060 113 BASE_LDFLAGS+=-Wl,-shared
Christian@15060 114 endif
chris@10732 115 endif
chris@10732 116 endif
chris@10732 117
chris@10732 118 ifeq ($(ARCH),x86_64)
Christian@15060 119 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 120 endif
chris@10732 121
chris@10732 122 ifeq ($(ARCH),ppc)
Christian@15060 123 CPPFLAGS+= -D__powerpc__
Christian@15060 124 ifdef CONFIG_LINUX_USER
Christian@15060 125 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
Christian@15060 126 endif
chris@10732 127 endif
chris@10732 128
chris@10732 129 ifeq ($(ARCH),s390)
Christian@15060 130 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 131 endif
chris@10732 132
chris@10732 133 ifeq ($(ARCH),sparc)
chris@10985 134 ifeq ($(CONFIG_SOLARIS),yes)
Christian@15060 135 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
Christian@15060 136 BASE_LDFLAGS+=-m32
Christian@15060 137 OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
chris@10985 138 else
Christian@15060 139 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
Christian@15060 140 BASE_LDFLAGS+=-m32
Christian@15060 141 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
chris@10732 142 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
chris@10732 143 # -static is used to avoid g1/g3 usage by the dynamic linker
Christian@15060 144 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
chris@10732 145 endif
chris@10985 146 endif
chris@10732 147
chris@10732 148 ifeq ($(ARCH),sparc64)
Christian@15060 149 BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
Christian@15060 150 BASE_LDFLAGS+=-m64
Christian@15060 151 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
Christian@15060 152 OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
chris@10732 153 endif
chris@10732 154
chris@10732 155 ifeq ($(ARCH),alpha)
Christian@15060 156 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
Christian@15060 157 # relocations for the constant constructions
chris@10732 158 # Ensure there's only a single GP
Christian@15060 159 BASE_CFLAGS+=-msmall-data
Christian@15060 160 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 161 endif
chris@10732 162
chris@10732 163 ifeq ($(ARCH),ia64)
Christian@15060 164 BASE_CFLAGS+=-mno-sdata
Christian@15060 165 OP_CFLAGS+=-mno-sdata
Christian@15060 166 BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 167 endif
chris@10732 168
chris@10732 169 ifeq ($(ARCH),arm)
Christian@15060 170 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
Christian@15060 171 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 172 endif
chris@10732 173
chris@10732 174 ifeq ($(ARCH),m68k)
Christian@15060 175 OP_CFLAGS+=-fomit-frame-pointer
Christian@15060 176 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
Christian@15060 177 endif
Christian@15060 178
Christian@15060 179 ifeq ($(ARCH),mips)
Christian@15060 180 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
chris@10732 181 endif
chris@10732 182
chris@10732 183 ifeq ($(HAVE_GCC3_OPTIONS),yes)
chris@10732 184 # very important to generate a return at the end of every operation
chris@10732 185 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
chris@10732 186 endif
chris@10732 187
chris@10732 188 ifeq ($(CONFIG_DARWIN),yes)
chris@10732 189 LIBS+=-lmx
chris@10732 190 endif
chris@10732 191
Christian@15060 192 ifdef CONFIG_DARWIN_USER
Christian@15060 193 # Leave some space for the regular program loading zone
Christian@15060 194 BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
Christian@15060 195 endif
Christian@15060 196
Christian@15060 197 OP_CFLAGS+=$(OS_CFLAGS)
Christian@15060 198
chris@10732 199 #########################################################
chris@10732 200
Christian@15060 201 CPPFLAGS+=-D_GNU_SOURCE
Christian@15060 202 # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
chris@10732 203 LIBS+=-lm
chris@10732 204 LIBS+=-L../../libxc -lxenctrl -lxenguest
chris@10732 205 LIBS+=-L../../xenstore -lxenstore
chris@10732 206 ifndef CONFIG_USER_ONLY
chris@10732 207 LIBS+=-lz
chris@10732 208 endif
chris@10732 209 ifdef CONFIG_WIN32
chris@10732 210 LIBS+=-lwinmm -lws2_32 -liphlpapi
chris@10732 211 endif
chris@10732 212 ifdef CONFIG_SOLARIS
chris@10732 213 LIBS+=-lsocket -lnsl -lresolv
chris@10732 214 endif
chris@10732 215
chris@10732 216 # profiling code
chris@10732 217 ifdef TARGET_GPROF
Christian@15060 218 BASE_LDFLAGS+=-p
Christian@15060 219 main.o: BASE_CFLAGS+=-p
chris@10732 220 endif
chris@10732 221
Christian@15060 222 ifdef CONFIG_LINUX_USER
chris@10985 223 OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
chris@10985 224 elfload.o linuxload.o
chris@10985 225 ifdef TARGET_HAS_BFLT
chris@10985 226 OBJS+= flatload.o
chris@10985 227 endif
chris@10985 228
chris@10732 229 ifeq ($(TARGET_ARCH), i386)
chris@10732 230 OBJS+= vm86.o
chris@10732 231 endif
chris@10732 232 ifeq ($(TARGET_ARCH), arm)
chris@10732 233 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
chris@10732 234 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
chris@10732 235 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
chris@10732 236 endif
Christian@15060 237 ifeq ($(TARGET_ARCH), m68k)
Christian@15060 238 OBJS+= m68k-sim.o m68k-semi.o
Christian@15060 239 endif
Christian@15060 240 endif #CONFIG_LINUX_USER
Christian@15060 241
Christian@15060 242 ifdef CONFIG_DARWIN_USER
Christian@15060 243 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
Christian@15060 244 endif
Christian@15060 245
chris@10732 246 SRCS:= $(OBJS:.o=.c)
chris@10732 247 OBJS+= libqemu.a
chris@10732 248
chris@10732 249 # cpu emulator library
chris@10732 250 LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
chris@10732 251 translate.o op.o
chris@10732 252 ifdef CONFIG_SOFTFLOAT
chris@10732 253 LIBOBJS+=fpu/softfloat.o
chris@10732 254 else
chris@10732 255 LIBOBJS+=fpu/softfloat-native.o
chris@10732 256 endif
Christian@15060 257 CPPFLAGS+=-I$(SRC_PATH)/fpu
chris@10732 258
chris@10732 259 ifeq ($(TARGET_ARCH), i386)
chris@10732 260 LIBOBJS+=helper.o helper2.o
chris@10732 261 ifeq ($(ARCH), i386)
chris@10732 262 LIBOBJS+=translate-copy.o
chris@10732 263 endif
chris@10732 264 endif
chris@10732 265
chris@10732 266 ifeq ($(TARGET_ARCH), x86_64)
chris@10732 267 LIBOBJS+=helper.o helper2.o
chris@10732 268 endif
chris@10732 269
chris@10732 270 ifeq ($(TARGET_BASE_ARCH), ppc)
chris@10732 271 LIBOBJS+= op_helper.o helper.o
chris@10732 272 endif
chris@10732 273
chris@10732 274 ifeq ($(TARGET_ARCH), mips)
chris@10732 275 LIBOBJS+= op_helper.o helper.o
chris@10732 276 endif
chris@10732 277
chris@10732 278 ifeq ($(TARGET_BASE_ARCH), sparc)
chris@10732 279 LIBOBJS+= op_helper.o helper.o
chris@10732 280 endif
chris@10732 281
chris@10732 282 ifeq ($(TARGET_BASE_ARCH), arm)
chris@10732 283 LIBOBJS+= op_helper.o helper.o
chris@10732 284 endif
chris@10732 285
chris@10732 286 ifeq ($(TARGET_BASE_ARCH), sh4)
chris@10732 287 LIBOBJS+= op_helper.o helper.o
chris@10732 288 endif
chris@10732 289
Christian@15060 290 ifeq ($(TARGET_BASE_ARCH), m68k)
Christian@15060 291 LIBOBJS+= helper.o
Christian@15060 292 endif
Christian@15060 293
chris@10732 294 # NOTE: the disassembler code is only needed for debugging
chris@10732 295 LIBOBJS+=disas.o
chris@10732 296 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
chris@10732 297 USE_I386_DIS=y
chris@10732 298 endif
chris@10732 299 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
chris@10732 300 USE_I386_DIS=y
chris@10732 301 endif
chris@10732 302 ifdef USE_I386_DIS
chris@10732 303 LIBOBJS+=i386-dis.o
chris@10732 304 endif
chris@10732 305 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
chris@10732 306 LIBOBJS+=alpha-dis.o
chris@10732 307 endif
chris@10732 308 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
chris@10732 309 LIBOBJS+=ppc-dis.o
chris@10732 310 endif
chris@10732 311 ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips)
chris@10732 312 LIBOBJS+=mips-dis.o
chris@10732 313 endif
chris@10732 314 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
chris@10732 315 LIBOBJS+=sparc-dis.o
chris@10732 316 endif
chris@10732 317 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
chris@10732 318 LIBOBJS+=arm-dis.o
chris@10732 319 endif
chris@10732 320 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
chris@10732 321 LIBOBJS+=m68k-dis.o
chris@10732 322 endif
chris@10732 323 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
chris@10732 324 LIBOBJS+=sh4-dis.o
chris@10732 325 endif
chris@10732 326
chris@10732 327 ifdef CONFIG_GDBSTUB
chris@10732 328 OBJS+=gdbstub.o
chris@10732 329 endif
chris@10732 330
chris@10732 331 # qemu-dm objects
kfraser@11890 332 ifeq ($(ARCH),ia64)
awilliam@12670 333 LIBOBJS=helper2.o exec-dm.o i8259-dm.o piix_pci-dm.o
kfraser@11890 334 else
kfraser@12535 335 LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o piix_pci-dm.o
kfraser@11890 336 endif
chris@10732 337
chris@10732 338 all: $(PROGS)
chris@10732 339
chris@10732 340 $(QEMU_USER): $(OBJS)
Christian@15060 341 $(CC) $(CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS)
chris@10732 342 ifeq ($(ARCH),alpha)
chris@10732 343 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
chris@10732 344 # the address space (31 bit so sign extending doesn't matter)
chris@10732 345 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
chris@10732 346 endif
chris@10732 347
chris@10732 348 # must use static linking to avoid leaving stuff in virtual address space
Christian@15060 349 VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o isa_mmio.o
Christian@15060 350 VL_OBJS+=cutils.o
Christian@15060 351 VL_OBJS+=block.o block-raw.o
Christian@15060 352 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
keir@17042 353 ifdef CONFIG_STUBDOM
keir@17042 354 VL_OBJS+=block-vbd.o
keir@17042 355 endif
chris@10732 356 ifdef CONFIG_WIN32
chris@10732 357 VL_OBJS+=tap-win32.o
chris@10732 358 endif
chris@10732 359
keir@17042 360 ifdef CONFIG_STUBDOM
keir@17115 361 #CONFIG_PASSTHROUGH=1
keir@17042 362 else
keir@17042 363 ifeq (,$(wildcard /usr/include/pci))
keir@15938 364 $(warning *** pciutils-devl package not found - missing /usr/include/pci)
keir@15938 365 $(warning *** PCI passthrough capability has been disabled)
keir@17042 366 else
keir@17042 367 CONFIG_PASSTHROUGH=1
keir@17042 368 endif
keir@17042 369 endif
keir@17042 370
keir@17042 371 ifdef CONFIG_PASSTHROUGH
keir@15938 372 LIBS+=-lpci
keir@15938 373 VL_OBJS+= pass-through.o
keir@15938 374 CFLAGS += -DCONFIG_PASSTHROUGH
keir@15938 375 $(info *** PCI passthrough capability has been enabled ***)
keir@15938 376 endif
keir@15938 377
chris@10732 378 SOUND_HW = sb16.o es1370.o
chris@10732 379 AUDIODRV = audio.o noaudio.o wavaudio.o
chris@10732 380 ifdef CONFIG_SDL
chris@10732 381 AUDIODRV += sdlaudio.o
chris@10732 382 endif
chris@10732 383 ifdef CONFIG_OSS
chris@10732 384 AUDIODRV += ossaudio.o
chris@10732 385 endif
chris@10732 386 ifdef CONFIG_COREAUDIO
chris@10732 387 AUDIODRV += coreaudio.o
chris@10732 388 endif
chris@10732 389 ifdef CONFIG_ALSA
chris@10732 390 AUDIODRV += alsaaudio.o
chris@10732 391 LIBS += -lasound
chris@10732 392 endif
chris@10732 393 ifdef CONFIG_DSOUND
chris@10732 394 AUDIODRV += dsoundaudio.o
chris@10732 395 LIBS += -lole32 -ldxguid
chris@10732 396 endif
chris@10732 397 ifdef CONFIG_FMOD
chris@10732 398 AUDIODRV += fmodaudio.o
Christian@15060 399 audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
chris@10732 400 LIBS += $(CONFIG_FMOD_LIB)
chris@10732 401 endif
chris@10732 402 ifdef CONFIG_ADLIB
chris@10732 403 SOUND_HW += fmopl.o adlib.o
chris@10732 404 endif
chris@10985 405 AUDIODRV+= wavcapture.o
chris@10985 406
keir@16271 407 ifdef CONFIG_VNC_TLS
keir@16271 408 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
keir@16271 409 LIBS += $(CONFIG_VNC_TLS_LIBS)
keir@16271 410 endif
keir@16271 411
chris@10985 412 # SCSI layer
chris@10985 413 VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
chris@10732 414
chris@10732 415 # USB layer
chris@10985 416 VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
chris@10732 417
chris@10732 418 # PCI network cards
keir@17118 419 VL_OBJS+= ne2000.o rtl8139.o pcnet.o e100.o e1000.o
chris@10732 420
chris@10732 421 ifeq ($(TARGET_BASE_ARCH), i386)
chris@10732 422 # Hardware support
keir@17042 423 VL_OBJS+= ide.o pckbd.o ps2.o vga.o dma.o extboot.o
kfraser@11890 424 ifeq ($(ARCH),ia64)
awilliam@12670 425 VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
kfraser@11890 426 else
kfraser@11890 427 VL_OBJS+= fdc.o serial.o pc.o
kfraser@11890 428 endif
keir@17042 429 VL_OBJS+= cirrus_vga.o parallel.o acpi.o
Christian@15060 430 VL_OBJS+= usb-uhci.o smbus_eeprom.o
chris@10732 431 VL_OBJS+= piix4acpi.o
chris@10949 432 VL_OBJS+= xenstore.o
keir@17246 433 ifndef CONFIG_STUBDOM
keir@17223 434 VL_OBJS+= xen_blktap.o
keir@17246 435 endif
chris@11182 436 VL_OBJS+= xen_platform.o
keir@16228 437 VL_OBJS+= xen_machine_fv.o
keir@16229 438 VL_OBJS+= xen_machine_pv.o
keir@16230 439 VL_OBJS+= xenfb.o
keir@16235 440 VL_OBJS+= xen_console.o
keir@17042 441 ifndef CONFIG_STUBDOM
kaf24@12037 442 VL_OBJS+= tpm_tis.o
keir@17042 443 VL_OBJS+= $(SOUND_HW) $(AUDIODRV) mixeng.o
keir@17018 444 CPPFLAGS += -DHAS_TPM
Christian@15060 445 CPPFLAGS += -DHAS_AUDIO
chris@10732 446 endif
keir@17042 447 endif
chris@10732 448 ifeq ($(TARGET_BASE_ARCH), ppc)
keir@17042 449 VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o dma.o
chris@10732 450 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
chris@10732 451 VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
chris@10985 452 VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
keir@17042 453 ifndef CONFIG_STUBDOM
keir@17042 454 VL_OBJS+= $(SOUND_HW) $(AUDIODRV)
Christian@15060 455 CPPFLAGS += -DHAS_AUDIO
chris@10732 456 endif
keir@17042 457 endif
chris@10732 458 ifeq ($(TARGET_ARCH), mips)
Christian@15060 459 VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
Christian@15060 460 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o
keir@17042 461 VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o
keir@17042 462 ifndef CONFIG_STUBDOM
keir@17042 463 VL_OBJS+= $(SOUND_HW) $(AUDIODRV)
Christian@15060 464 DEFINES += -DHAS_AUDIO
chris@10732 465 endif
keir@17042 466 endif
chris@10732 467 ifeq ($(TARGET_BASE_ARCH), sparc)
chris@10732 468 ifeq ($(TARGET_ARCH), sparc64)
chris@10985 469 VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
chris@10732 470 VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
chris@10732 471 VL_OBJS+= cirrus_vga.o parallel.o
chris@10732 472 else
Christian@15060 473 VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
Christian@15060 474 VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
Christian@15060 475 VL_OBJS+= cs4231.o
chris@10732 476 endif
chris@10732 477 endif
chris@10732 478 ifeq ($(TARGET_BASE_ARCH), arm)
chris@10732 479 VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
chris@10732 480 VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o
chris@10985 481 VL_OBJS+= versatile_pci.o
Christian@15060 482 VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
Christian@15060 483 VL_OBJS+= arm-semi.o
chris@10732 484 endif
chris@10732 485 ifeq ($(TARGET_BASE_ARCH), sh4)
chris@10732 486 VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
chris@10732 487 endif
chris@10732 488 ifdef CONFIG_GDBSTUB
chris@10732 489 VL_OBJS+=gdbstub.o
chris@10732 490 endif
chris@10732 491 ifdef CONFIG_SDL
Christian@15060 492 VL_OBJS+=sdl.o x_keymap.o
chris@10732 493 endif
keir@16271 494 VL_OBJS+=vnc.o d3des.o
chris@10732 495 ifdef CONFIG_COCOA
chris@10732 496 VL_OBJS+=cocoa.o
chris@10732 497 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
chris@10732 498 ifdef CONFIG_COREAUDIO
chris@10732 499 COCOA_LIBS+=-framework CoreAudio
chris@10732 500 endif
chris@10732 501 endif
chris@10732 502 ifdef CONFIG_SLIRP
Christian@15060 503 CPPFLAGS+=-I$(SRC_PATH)/slirp
chris@10732 504 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
chris@10732 505 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
chris@10732 506 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
chris@10732 507 VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
chris@10732 508 endif
chris@10732 509
chris@10732 510 VL_LDFLAGS=
chris@10732 511 # specific flags are needed for non soft mmu emulator
chris@10732 512 ifdef CONFIG_STATIC
chris@10732 513 VL_LDFLAGS+=-static
chris@10732 514 endif
chris@10732 515 ifndef CONFIG_SOFTMMU
chris@10732 516 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
chris@10732 517 endif
chris@10732 518 ifndef CONFIG_DARWIN
chris@10732 519 ifndef CONFIG_WIN32
chris@10732 520 ifndef CONFIG_SOLARIS
chris@10985 521 VL_LIBS=-lutil -lrt
chris@10732 522 endif
chris@10732 523 endif
chris@10732 524 endif
chris@10732 525 ifdef TARGET_GPROF
Christian@15060 526 vl.o: BASE_CFLAGS+=-p
chris@10732 527 VL_LDFLAGS+=-p
chris@10732 528 endif
chris@10732 529
chris@10985 530 ifeq ($(ARCH),sparc64)
chris@10985 531 VL_LDFLAGS+=-m64
chris@10985 532 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld
chris@10985 533 endif
chris@10985 534
chris@10732 535 ifdef CONFIG_WIN32
chris@10732 536 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
chris@10732 537 endif
chris@10732 538
chris@10732 539 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
keir@17042 540 ifdef CONFIG_STUBDOM
keir@17042 541 $(AR) rcs $@ $(VL_OBJS)
keir@17042 542 else
chris@10732 543 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
keir@17042 544 endif
chris@10732 545
chris@10732 546 cocoa.o: cocoa.m
Christian@15060 547 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 548
chris@10732 549 sdl.o: sdl.c keymaps.c sdl_keysym.h
Christian@15060 550 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 551
keir@16271 552 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
Christian@15060 553 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 554
chris@10732 555 sdlaudio.o: sdlaudio.c
Christian@15060 556 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 557
chris@10732 558 depend: $(SRCS)
Christian@15060 559 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
chris@10732 560
chris@10732 561 vldepend: $(VL_OBJS:.o=.c)
Christian@15060 562 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
chris@10732 563
chris@10732 564 # libqemu
chris@10732 565
chris@10732 566 libqemu.a: $(LIBOBJS)
chris@10732 567 rm -f $@
chris@10732 568 $(AR) rcs $@ $(LIBOBJS)
chris@10732 569
chris@10732 570 translate.o: translate.c gen-op.h opc.h cpu.h
chris@10732 571
chris@10732 572 translate-all.o: translate-all.c opc.h cpu.h
chris@10732 573
chris@10732 574 translate-op.o: translate-all.c op.h opc.h cpu.h
chris@10732 575
chris@10732 576 op.h: op.o $(DYNGEN)
chris@10732 577 $(DYNGEN) -o $@ $<
chris@10732 578
chris@10732 579 opc.h: op.o $(DYNGEN)
chris@10732 580 $(DYNGEN) -c -o $@ $<
chris@10732 581
chris@10732 582 gen-op.h: op.o $(DYNGEN)
chris@10732 583 $(DYNGEN) -g -o $@ $<
chris@10732 584
chris@10732 585 op.o: op.c
Christian@15060 586 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
chris@10732 587
Christian@15060 588 # HELPER_CFLAGS is used for all the code compiled with static register
Christian@15060 589 # variables
Christian@15060 590 ifeq ($(TARGET_BASE_ARCH), i386)
Christian@15060 591 # XXX: rename helper.c to op_helper.c
chris@10732 592 helper.o: helper.c
Christian@15060 593 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
Christian@15060 594 else
Christian@15060 595 op_helper.o: op_helper.c
Christian@15060 596 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
Christian@15060 597 endif
Christian@15060 598
Christian@15060 599 cpu-exec.o: cpu-exec.c
Christian@15060 600 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
Christian@15060 601
Christian@15060 602 # Note: this is a workaround. The real fix is to avoid compiling
Christian@15060 603 # cpu_signal_handler() in cpu-exec.c.
Christian@15060 604 signal.o: signal.c
Christian@15060 605 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 606
chris@10732 607 ifeq ($(TARGET_BASE_ARCH), i386)
chris@10732 608 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
chris@10732 609 endif
chris@10732 610
chris@10732 611 ifeq ($(TARGET_ARCH), arm)
chris@10732 612 op.o: op.c op_template.h
chris@10732 613 pl110.o: pl110_template.h
chris@10732 614 endif
chris@10732 615
chris@10732 616 ifeq ($(TARGET_BASE_ARCH), sparc)
chris@10732 617 op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h
chris@10732 618 magic_load.o: elf_op.h
chris@10732 619 endif
chris@10732 620
chris@10732 621 ifeq ($(TARGET_BASE_ARCH), ppc)
chris@10732 622 op.o: op.c op_template.h op_mem.h
chris@10732 623 op_helper.o: op_helper_mem.h
chris@10732 624 translate.o: translate.c translate_init.c
chris@10732 625 endif
chris@10732 626
chris@10732 627 ifeq ($(TARGET_ARCH), mips)
Christian@15060 628 op.o: op.c op_template.c fop_template.c op_mem.c
chris@10732 629 op_helper.o: op_helper_mem.c
chris@10732 630 endif
chris@10732 631
chris@10732 632 loader.o: loader.c elf_ops.h
chris@10732 633
chris@10732 634 ifeq ($(TARGET_ARCH), sh4)
chris@10732 635 op.o: op.c op_mem.c cpu.h
chris@10732 636 op_helper.o: op_helper.c exec.h cpu.h
chris@10732 637 helper.o: helper.c exec.h cpu.h
chris@10732 638 sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h
chris@10732 639 shix.o: shix.c sh7750_regs.h sh7750_regnames.h
chris@10732 640 sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h
chris@10732 641 tc58128.o: tc58128.c
chris@10732 642 endif
chris@10732 643
chris@10985 644 $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
chris@10985 645
chris@10732 646 %.o: %.c
Christian@15060 647 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
chris@10732 648
chris@10732 649 %.o: %.S
Christian@15060 650 $(CC) $(CPPFLAGS) -c -o $@ $<
chris@10732 651
chris@10732 652 clean:
chris@10732 653 rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
chris@10732 654
chris@10732 655 distclean: clean
chris@10732 656 rm -rf config.mak config.h
chris@10732 657
chris@10732 658 install: all
chris@10732 659 mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"
chris@10732 660 ifneq ($(PROGS),)
kfraser@11837 661 $(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
chris@10732 662 endif
kfraser@11837 663 $(INSTALL_PROG) $(TARGET_PATH)/qemu-dm.debug "$(DESTDIR)$(bindir)"
kfraser@11837 664 $(INSTALL_PROG) $(TARGET_PATH)/qemu-ifup "$(DESTDIR)$(configdir)"
chris@10732 665
chris@10732 666 ifneq ($(wildcard .depend),)
chris@10732 667 include .depend
chris@10732 668 endif
chris@10732 669
chris@10732 670 ifeq (1, 0)
chris@10732 671 audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
chris@10732 672 fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
chris@10732 673 CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
chris@10732 674 endif