xen-vtx-unstable

annotate tools/ioemu/target-i386-dm/Makefile @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents adb70d525dbd dd668f7527cb
children e7c7196fa329
rev   line source
kaf24@5084 1 XEN_ROOT=../../..
kaf24@5084 2 include $(XEN_ROOT)/tools/Rules.mk
kaf24@5034 3 include config.mak
kaf24@5084 4 override TARGET_ARCH=i386
kaf24@5034 5
kaf24@6762 6 INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
kaf24@5034 7 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
kaf24@5034 8 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
kaf24@5624 9 DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) -I$(XEN_ROOT)/xen/include/public
kaf24@5624 10 DEFINES+= -I$(XEN_ROOT)/tools/libxc
kaf24@5034 11 ifdef CONFIG_USER_ONLY
kaf24@5034 12 VPATH+=:$(SRC_PATH)/linux-user
kaf24@5034 13 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
kaf24@5034 14 endif
kaf24@5034 15 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
kaf24@5034 16 LDFLAGS=-g
kaf24@5034 17 LIBS=
kaf24@5034 18 HELPER_CFLAGS=$(CFLAGS)
kaf24@5034 19 DYNGEN=../dyngen$(EXESUF)
kaf24@5034 20 # user emulator name
kaf24@5034 21 QEMU_USER=qemu-$(TARGET_ARCH)
kaf24@5034 22 # system emulator name
kaf24@5034 23 ifdef CONFIG_SOFTMMU
kaf24@5034 24 ifeq ($(TARGET_ARCH), i386)
kaf24@5034 25 QEMU_SYSTEM=qemu$(EXESUF)
kaf24@5034 26 else
kaf24@5034 27 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF)
kaf24@5034 28 endif
kaf24@5034 29 else
kaf24@5034 30 QEMU_SYSTEM=qemu-fast
kaf24@5034 31 endif
kaf24@5034 32
kaf24@5034 33 QEMU_SYSTEM=qemu-dm
kaf24@5644 34 PROGS=$(QEMU_SYSTEM)
kaf24@5034 35
kaf24@5034 36 ifdef CONFIG_USER_ONLY
kaf24@5034 37 PROGS=$(QEMU_USER)
kaf24@5034 38 else
kaf24@5034 39 ifeq ($(TARGET_ARCH), i386)
kaf24@5034 40
kaf24@5034 41 ifeq ($(ARCH), i386)
kaf24@5034 42 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 43 ifndef CONFIG_SOFTMMU
kaf24@5034 44 CONFIG_STATIC=y
kaf24@5034 45 endif
kaf24@5034 46 else
kaf24@5034 47 # the system emulator using soft mmu is portable
kaf24@5034 48 ifdef CONFIG_SOFTMMU
kaf24@5034 49 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 50 endif
kaf24@5034 51 endif # ARCH != i386
kaf24@5034 52
kaf24@5034 53 endif # TARGET_ARCH = i386
kaf24@5034 54
kaf24@5034 55 ifeq ($(TARGET_ARCH), ppc)
kaf24@5034 56
kaf24@5034 57 ifeq ($(ARCH), ppc)
kaf24@5034 58 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 59 endif
kaf24@5034 60
kaf24@5034 61 ifeq ($(ARCH), i386)
kaf24@5034 62 ifdef CONFIG_SOFTMMU
kaf24@5034 63 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 64 endif
kaf24@5034 65 endif # ARCH = i386
kaf24@5034 66
kaf24@5034 67 ifeq ($(ARCH), amd64)
kaf24@5034 68 ifdef CONFIG_SOFTMMU
kaf24@5034 69 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 70 endif
kaf24@5034 71 endif # ARCH = amd64
kaf24@5034 72
kaf24@5034 73 endif # TARGET_ARCH = ppc
kaf24@5034 74
kaf24@5034 75 ifeq ($(TARGET_ARCH), sparc)
kaf24@5034 76
kaf24@5034 77 ifeq ($(ARCH), ppc)
kaf24@5034 78 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 79 endif
kaf24@5034 80
kaf24@5034 81 ifeq ($(ARCH), i386)
kaf24@5034 82 ifdef CONFIG_SOFTMMU
kaf24@5034 83 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 84 endif
kaf24@5034 85 endif # ARCH = i386
kaf24@5034 86
kaf24@5034 87 ifeq ($(ARCH), amd64)
kaf24@5034 88 ifdef CONFIG_SOFTMMU
kaf24@5034 89 PROGS+=$(QEMU_SYSTEM)
kaf24@5034 90 endif
kaf24@5034 91 endif # ARCH = amd64
kaf24@5034 92
kaf24@5034 93 endif # TARGET_ARCH = sparc
kaf24@5034 94 endif # !CONFIG_USER_ONLY
kaf24@5034 95
kaf24@5034 96 ifdef CONFIG_STATIC
kaf24@5034 97 LDFLAGS+=-static
kaf24@5034 98 endif
kaf24@5034 99
kaf24@5034 100 ifeq ($(ARCH),i386)
kaf24@5034 101 CFLAGS+=-fomit-frame-pointer
kaf24@5034 102 OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
kaf24@5034 103 ifeq ($(HAVE_GCC3_OPTIONS),yes)
kaf24@5034 104 OP_CFLAGS+= -falign-functions=0 -fno-gcse
kaf24@5034 105 else
kaf24@5034 106 OP_CFLAGS+= -malign-functions=0
kaf24@5034 107 endif
kaf24@5034 108
kaf24@5034 109 ifdef TARGET_GPROF
kaf24@5034 110 USE_I386_LD=y
kaf24@5034 111 endif
kaf24@5034 112 ifdef CONFIG_STATIC
kaf24@5034 113 USE_I386_LD=y
kaf24@5034 114 endif
kaf24@5034 115 ifdef USE_I386_LD
kaf24@5034 116 LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld
kaf24@5034 117 else
kaf24@5034 118 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
kaf24@5034 119 # that the kernel ELF loader considers as an executable. I think this
kaf24@5034 120 # is the simplest way to make it self virtualizable!
kaf24@5034 121 LDFLAGS+=-Wl,-shared
kaf24@5034 122 endif
kaf24@5034 123 endif
kaf24@5034 124
kaf24@5034 125 ifeq ($(ARCH),amd64)
kaf24@5034 126 OP_CFLAGS=$(CFLAGS) -falign-functions=0
kaf24@5034 127 LDFLAGS+=-Wl,-T,$(SRC_PATH)/amd64.ld
kaf24@5034 128 endif
kaf24@5034 129
kaf24@5034 130 ifeq ($(ARCH),ppc)
kaf24@5034 131 CFLAGS+= -D__powerpc__
kaf24@5034 132 OP_CFLAGS=$(CFLAGS)
kaf24@5034 133 LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
kaf24@5034 134 endif
kaf24@5034 135
kaf24@5034 136 ifeq ($(ARCH),s390)
kaf24@5034 137 OP_CFLAGS=$(CFLAGS)
kaf24@5034 138 LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld
kaf24@5034 139 endif
kaf24@5034 140
kaf24@5034 141 ifeq ($(ARCH),sparc)
kaf24@5034 142 CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
kaf24@5034 143 LDFLAGS+=-m32
kaf24@5034 144 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
kaf24@5034 145 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
kaf24@5034 146 # -static is used to avoid g1/g3 usage by the dynamic linker
kaf24@5034 147 LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
kaf24@5034 148 endif
kaf24@5034 149
kaf24@5034 150 ifeq ($(ARCH),sparc64)
kaf24@5034 151 CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
kaf24@5034 152 LDFLAGS+=-m64
kaf24@5034 153 OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
kaf24@5034 154 endif
kaf24@5034 155
kaf24@5034 156 ifeq ($(ARCH),alpha)
kaf24@5034 157 # -msmall-data is not used because we want two-instruction relocations
kaf24@5034 158 # for the constant constructions
kaf24@5034 159 OP_CFLAGS=-Wall -O2 -g
kaf24@5034 160 # Ensure there's only a single GP
kaf24@5034 161 CFLAGS += -msmall-data
kaf24@5034 162 LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld
kaf24@5034 163 endif
kaf24@5034 164
kaf24@5034 165 ifeq ($(ARCH),ia64)
kaf24@5034 166 OP_CFLAGS=$(CFLAGS)
kaf24@5034 167 endif
kaf24@5034 168
kaf24@5034 169 ifeq ($(ARCH),arm)
kaf24@5034 170 OP_CFLAGS=$(CFLAGS) -mno-sched-prolog
kaf24@5034 171 LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
kaf24@5034 172 endif
kaf24@5034 173
kaf24@5034 174 ifeq ($(ARCH),m68k)
kaf24@5034 175 OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
kaf24@5034 176 LDFLAGS+=-Wl,-T,m68k.ld
kaf24@5034 177 endif
kaf24@5034 178
kaf24@5034 179 ifeq ($(HAVE_GCC3_OPTIONS),yes)
kaf24@5034 180 # very important to generate a return at the end of every operation
kaf24@5034 181 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
kaf24@5034 182 endif
kaf24@5034 183
kaf24@5034 184 ifeq ($(CONFIG_DARWIN),yes)
kaf24@5034 185 OP_CFLAGS+= -mdynamic-no-pic
kaf24@5034 186 endif
kaf24@5034 187
kaf24@5034 188 #########################################################
kaf24@5034 189
arun@5615 190 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DAPIC_SUPPORT
cl349@6388 191 LIBS+=-lm -L../../libxc -lxenctrl
kaf24@5034 192 ifndef CONFIG_USER_ONLY
kaf24@5034 193 LIBS+=-lz
kaf24@5034 194 endif
kaf24@5034 195 ifdef CONFIG_WIN32
kaf24@5034 196 LIBS+=-lwinmm -lws2_32 -liphlpapi
kaf24@5034 197 endif
kaf24@5034 198
kaf24@5034 199 # profiling code
kaf24@5034 200 ifdef TARGET_GPROF
kaf24@5034 201 LDFLAGS+=-p
kaf24@5034 202 main.o: CFLAGS+=-p
kaf24@5034 203 endif
kaf24@5034 204
kaf24@5034 205 OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o
kaf24@5034 206 ifeq ($(TARGET_ARCH), i386)
kaf24@5034 207 OBJS+= vm86.o
kaf24@5034 208 endif
kaf24@5034 209 ifeq ($(TARGET_ARCH), arm)
kaf24@5034 210 OBJS+=nwfpe/softfloat.o nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
kaf24@5034 211 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
kaf24@5034 212 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o
kaf24@5034 213 endif
kaf24@5034 214 SRCS:= $(OBJS:.o=.c)
kaf24@5034 215 OBJS+= libqemu.a
kaf24@5034 216
kaf24@5034 217 # cpu emulator library
kaf24@5034 218 LIBOBJS=
kaf24@5034 219
kaf24@5034 220 ifeq ($(TARGET_ARCH), i386)
kaf24@5034 221 LIBOBJS+= helper2.o
kaf24@5034 222 ifeq ($(ARCH), i386)
kaf24@5034 223 LIBOBJS+=translate-copy.o
kaf24@5034 224 endif
kaf24@5034 225 endif
kaf24@5034 226
kaf24@5034 227 ifeq ($(TARGET_ARCH), ppc)
kaf24@5034 228 LIBOBJS+= op_helper.o helper.o
kaf24@5034 229 endif
kaf24@5034 230
kaf24@5034 231 ifeq ($(TARGET_ARCH), sparc)
kaf24@5034 232 LIBOBJS+= op_helper.o helper.o
kaf24@5034 233 endif
kaf24@5034 234
kaf24@5034 235 all: $(PROGS)
kaf24@5034 236
kaf24@5034 237 $(QEMU_USER): $(OBJS)
kaf24@5034 238 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
kaf24@5034 239 ifeq ($(ARCH),alpha)
kaf24@5034 240 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
kaf24@5034 241 # the address space (31 bit so sign extending doesn't matter)
kaf24@5034 242 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
kaf24@5034 243 endif
kaf24@5034 244
kaf24@5034 245 # must use static linking to avoid leaving stuff in virtual address space
kaf24@5034 246 VL_OBJS=vl.o exec.o monitor.o osdep.o block.o readline.o pci.o console.o
arun@5611 247 VL_OBJS+=block-cow.o block-qcow.o block-vmdk.o block-cloop.o aes.o
arun@5615 248 VL_OBJS+=ioapic.o
arun@5611 249 #VL_OBJS+= block-cloop.o
kaf24@5034 250
kaf24@5034 251 SOUND_HW = sb16.o
kaf24@5034 252 AUDIODRV = audio.o noaudio.o wavaudio.o
kaf24@5034 253 ifdef CONFIG_SDL
kaf24@5034 254 AUDIODRV += sdlaudio.o
kaf24@5034 255 endif
kaf24@5034 256 ifdef CONFIG_OSS
kaf24@5034 257 AUDIODRV += ossaudio.o
kaf24@5034 258 endif
kaf24@5034 259
kaf24@5034 260 pc.o: DEFINES := -DUSE_SB16 $(DEFINES)
kaf24@5034 261
kaf24@5034 262 ifdef CONFIG_ADLIB
kaf24@5034 263 SOUND_HW += fmopl.o adlib.o
kaf24@5034 264 endif
kaf24@5034 265
kaf24@5034 266 ifdef CONFIG_FMOD
kaf24@5034 267 AUDIODRV += fmodaudio.o
kaf24@5034 268 audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
kaf24@5034 269 LIBS += $(CONFIG_FMOD_LIB)
kaf24@5034 270 endif
kaf24@5034 271
kaf24@5034 272 # Hardware support
kaf24@5034 273 VL_OBJS+= ide.o ne2000.o pckbd.o vga.o dma.o
arun@5140 274 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o port-e9.o
adsharma@6517 275 VL_OBJS+= cirrus_vga.o pcnet.o
kaf24@5034 276
kaf24@5034 277 ifeq ($(TARGET_ARCH), ppc)
kaf24@5034 278 VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
kaf24@5034 279 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
kaf24@5034 280 VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o mixeng.o
kaf24@5034 281 endif
kaf24@5034 282 ifeq ($(TARGET_ARCH), sparc)
kaf24@5034 283 VL_OBJS+= sun4m.o tcx.o lance.o iommu.o sched.o m48t08.o magic-load.o timer.o
kaf24@5034 284 endif
kaf24@5034 285 ifdef CONFIG_GDBSTUB
kaf24@5034 286 VL_OBJS+=gdbstub.o
kaf24@5034 287 endif
kaf24@5034 288 ifdef CONFIG_VNC
kaf24@5034 289 VL_OBJS+=vnc.o
kaf24@5034 290 endif
kaf24@5034 291 ifdef CONFIG_SDL
kaf24@5034 292 VL_OBJS+=sdl.o
kaf24@5034 293 endif
kaf24@5034 294 ifdef CONFIG_SLIRP
kaf24@5034 295 DEFINES+=-I$(SRC_PATH)/slirp
kaf24@5034 296 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
kaf24@5034 297 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
kaf24@5034 298 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
kaf24@5034 299 VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
kaf24@5034 300 endif
kaf24@5034 301
kaf24@5034 302 VL_LDFLAGS=
kaf24@5034 303 # specific flags are needed for non soft mmu emulator
kaf24@5034 304 ifdef CONFIG_STATIC
kaf24@5034 305 VL_LDFLAGS+=-static
kaf24@5034 306 endif
kaf24@5034 307 ifndef CONFIG_DARWIN
kaf24@5034 308 ifndef CONFIG_WIN32
kaf24@5034 309 VL_LIBS=-lutil
kaf24@5034 310 endif
kaf24@5034 311 endif
kaf24@5034 312
kaf24@5034 313 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
kaf24@5034 314 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS)
kaf24@5034 315
kaf24@5034 316 vnc.o: vnc.c keyboard_rdesktop.c
kaf24@5034 317 $(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
kaf24@5034 318
kaf24@5034 319 sdl.o: sdl.c keyboard_rdesktop.c
kaf24@5034 320 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
kaf24@5034 321
kaf24@5034 322 sdlaudio.o: sdlaudio.c
kaf24@5034 323 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
kaf24@5034 324
kaf24@5034 325 depend: $(SRCS)
kaf24@5034 326 $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
kaf24@5034 327
kaf24@5034 328 # libqemu
kaf24@5034 329
kaf24@5034 330 libqemu.a: $(LIBOBJS)
kaf24@5034 331 rm -f $@
kaf24@5034 332 $(AR) rcs $@ $(LIBOBJS)
kaf24@5034 333
kaf24@5034 334 translate.o: translate.c gen-op.h opc.h cpu.h
kaf24@5034 335
kaf24@5034 336 translate-all.o: translate-all.c op.h opc.h cpu.h
kaf24@5034 337
kaf24@5034 338 op.h: op.o $(DYNGEN)
kaf24@5034 339 $(DYNGEN) -o $@ $<
kaf24@5034 340
kaf24@5034 341 opc.h: op.o $(DYNGEN)
kaf24@5034 342 $(DYNGEN) -c -o $@ $<
kaf24@5034 343
kaf24@5034 344 gen-op.h: op.o $(DYNGEN)
kaf24@5034 345 $(DYNGEN) -g -o $@ $<
kaf24@5034 346
kaf24@5034 347 op.o: op.c
kaf24@5034 348 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
kaf24@5034 349
kaf24@5034 350 helper.o: helper.c
kaf24@5034 351 $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
kaf24@5034 352
kaf24@5034 353 ifeq ($(TARGET_ARCH), i386)
kaf24@5034 354 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h
kaf24@5034 355 endif
kaf24@5034 356
kaf24@5034 357 ifeq ($(TARGET_ARCH), arm)
kaf24@5034 358 op.o: op.c op_template.h
kaf24@5034 359 endif
kaf24@5034 360
kaf24@5034 361 ifeq ($(TARGET_ARCH), sparc)
kaf24@5034 362 op.o: op.c op_template.h op_mem.h
kaf24@5034 363 endif
kaf24@5034 364
kaf24@5034 365 ifeq ($(TARGET_ARCH), ppc)
kaf24@5034 366 op.o: op.c op_template.h op_mem.h
kaf24@5034 367 op_helper.o: op_helper_mem.h
kaf24@5034 368 endif
kaf24@5034 369
kaf24@5034 370 mixeng.o: mixeng.c mixeng.h mixeng_template.h
kaf24@5034 371
kaf24@5034 372 %.o: %.c
kaf24@5034 373 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
kaf24@5034 374
kaf24@5034 375 %.o: %.S
kaf24@5034 376 $(CC) $(DEFINES) -c -o $@ $<
kaf24@5034 377
kaf24@5034 378 clean:
kaf24@6088 379 rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
kaf24@5034 380
rneugeba@5096 381 distclean:
kaf24@6088 382 rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
rneugeba@5096 383
kaf24@5034 384 install: all
kaf24@5624 385 if [ ! -d $(INSTALL_DIR) ];then mkdir -p $(INSTALL_DIR);fi
kaf24@5034 386 if [ ! -d $(DESTDIR)$(configdir) ];then mkdir -p $(DESTDIR)$(configdir);fi
kaf24@5624 387 install -m 755 -s $(PROGS) "$(INSTALL_DIR)"
kaf24@5673 388 install -m 755 qemu-dm.debug "$(INSTALL_DIR)"
kaf24@5034 389 install -m 755 qemu-ifup "$(DESTDIR)$(configdir)"
kaf24@5034 390 ifneq ($(wildcard .depend),)
kaf24@5034 391 include .depend
kaf24@5034 392 endif