X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=Makefile.target;h=0efc9d1c916c054e2eb05c81abbdc5bd5a4efca8;hb=18fba28c95d0f504d745e8e25c61f06e13601d10;hp=3f5a1ba8558feef713eb48c232077cc626850f8e;hpb=f72b519c86b0700473155194a39edf937007eab8;p=qemu diff --git a/Makefile.target b/Makefile.target index 3f5a1ba..0efc9d1 100644 --- a/Makefile.target +++ b/Makefile.target @@ -1,18 +1,42 @@ include config.mak -TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH) -VPATH=$(SRC_PATH):$(TARGET_PATH) -CFLAGS=-Wall -O2 -g +TARGET_BASE_ARCH:=$(TARGET_ARCH) +ifeq ($(TARGET_ARCH), x86_64) +TARGET_BASE_ARCH:=i386 +endif +ifeq ($(TARGET_ARCH), sparc64) +TARGET_BASE_ARCH:=sparc +endif +TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) +VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio +DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) +ifdef CONFIG_USER_ONLY +VPATH+=:$(SRC_PATH)/linux-user +DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +endif +CFLAGS=-Wall -O2 -g -fno-strict-aliasing +#CFLAGS+=-Werror LDFLAGS=-g LIBS= -DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) HELPER_CFLAGS=$(CFLAGS) -DYNGEN=../dyngen +DYNGEN=../dyngen$(EXESUF) # user emulator name -QEMU_USER=qemu-$(TARGET_ARCH) +ifeq ($(TARGET_ARCH),arm) + ifeq ($(TARGET_WORDS_BIGENDIAN),yes) + QEMU_USER=qemu-armeb + else + QEMU_USER=qemu-arm + endif +else + QEMU_USER=qemu-$(TARGET_ARCH) +endif # system emulator name ifdef CONFIG_SOFTMMU -QEMU_SYSTEM=qemu +ifeq ($(TARGET_ARCH), i386) +QEMU_SYSTEM=qemu$(EXESUF) +else +QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF) +endif else QEMU_SYSTEM=qemu-fast endif @@ -27,17 +51,42 @@ PROGS+=$(QEMU_SYSTEM) ifndef CONFIG_SOFTMMU CONFIG_STATIC=y endif +else +# the system emulator using soft mmu is portable +ifdef CONFIG_SOFTMMU +PROGS+=$(QEMU_SYSTEM) endif +endif # ARCH != i386 -ifeq ($(ARCH), ppc) +endif # TARGET_ARCH = i386 + +ifeq ($(TARGET_ARCH), x86_64) ifdef CONFIG_SOFTMMU PROGS+=$(QEMU_SYSTEM) endif +endif # TARGET_ARCH = x86_64 + +ifeq ($(TARGET_ARCH), ppc) + +ifeq ($(ARCH), ppc) +PROGS+=$(QEMU_SYSTEM) endif +ifeq ($(ARCH), i386) +ifdef CONFIG_SOFTMMU +PROGS+=$(QEMU_SYSTEM) endif +endif # ARCH = i386 -ifeq ($(TARGET_ARCH), ppc) +ifeq ($(ARCH), x86_64) +ifdef CONFIG_SOFTMMU +PROGS+=$(QEMU_SYSTEM) +endif +endif # ARCH = x86_64 + +endif # TARGET_ARCH = ppc + +ifeq ($(TARGET_ARCH), sparc) ifeq ($(ARCH), ppc) PROGS+=$(QEMU_SYSTEM) @@ -49,7 +98,20 @@ PROGS+=$(QEMU_SYSTEM) endif endif # ARCH = i386 -endif # TARGET_ARCH = ppc +ifeq ($(ARCH), x86_64) +ifdef CONFIG_SOFTMMU +PROGS+=$(QEMU_SYSTEM) +endif +endif # ARCH = x86_64 + +endif # TARGET_ARCH = sparc + +ifeq ($(TARGET_ARCH), sparc64) +ifdef CONFIG_SOFTMMU +PROGS+=$(QEMU_SYSTEM) +endif +endif # TARGET_ARCH = sparc64 + endif # !CONFIG_USER_ONLY ifdef CONFIG_STATIC @@ -60,7 +122,7 @@ ifeq ($(ARCH),i386) CFLAGS+=-fomit-frame-pointer OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2 ifeq ($(HAVE_GCC3_OPTIONS),yes) -OP_CFLAGS+= -falign-functions=0 +OP_CFLAGS+= -falign-functions=0 -fno-gcse else OP_CFLAGS+= -malign-functions=0 endif @@ -81,7 +143,13 @@ LDFLAGS+=-Wl,-shared endif endif +ifeq ($(ARCH),x86_64) +OP_CFLAGS=$(CFLAGS) -falign-functions=0 +LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +endif + ifeq ($(ARCH),ppc) +CFLAGS+= -D__powerpc__ OP_CFLAGS=$(CFLAGS) LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld endif @@ -134,10 +202,21 @@ ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls endif +ifeq ($(CONFIG_DARWIN),yes) +OP_CFLAGS+= -mdynamic-no-pic +LIBS+=-lmx +endif + ######################################################### -DEFINES+=-D_GNU_SOURCE +DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS+=-lm +ifndef CONFIG_USER_ONLY +LIBS+=-lz +endif +ifdef CONFIG_WIN32 +LIBS+=-lwinmm -lws2_32 -liphlpapi +endif # profiling code ifdef TARGET_GPROF @@ -145,7 +224,7 @@ LDFLAGS+=-p main.o: CFLAGS+=-p endif -OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o +OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o ifeq ($(TARGET_ARCH), i386) OBJS+= vm86.o endif @@ -158,7 +237,7 @@ SRCS:= $(OBJS:.o=.c) OBJS+= libqemu.a # cpu emulator library -LIBOBJS=thunk.o exec.o translate-all.o cpu-exec.o gdbstub.o \ +LIBOBJS=exec.o translate-all.o cpu-exec.o\ translate.o op.o ifeq ($(TARGET_ARCH), i386) @@ -168,13 +247,27 @@ LIBOBJS+=translate-copy.o endif endif +ifeq ($(TARGET_ARCH), x86_64) +LIBOBJS+=helper.o helper2.o +endif + ifeq ($(TARGET_ARCH), ppc) LIBOBJS+= op_helper.o helper.o endif +ifeq ($(TARGET_BASE_ARCH), sparc) +LIBOBJS+= op_helper.o helper.o +endif + # NOTE: the disassembler code is only needed for debugging LIBOBJS+=disas.o ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) +USE_I386_DIS=y +endif +ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) +USE_I386_DIS=y +endif +ifdef USE_I386_DIS LIBOBJS+=i386-dis.o endif ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) @@ -183,7 +276,7 @@ endif ifeq ($(findstring ppc, $(TARGET_ARCH) $(ARCH)),ppc) LIBOBJS+=ppc-dis.o endif -ifeq ($(findstring sparc, $(TARGET_ARCH) $(ARCH)),sparc) +ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) LIBOBJS+=sparc-dis.o endif ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) @@ -205,18 +298,56 @@ ifeq ($(ARCH),alpha) endif # must use static linking to avoid leaving stuff in virtual address space -VL_OBJS=vl.o block.o ide.o vga.o sb16.o dma.o oss.o fdc.o osdep.o -ifeq ($(TARGET_ARCH), i386) -VL_OBJS+=linux_boot.o +VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o +VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o + +SOUND_HW = sb16.o +AUDIODRV = audio.o noaudio.o wavaudio.o +ifdef CONFIG_SDL +AUDIODRV += sdlaudio.o +endif +ifdef CONFIG_OSS +AUDIODRV += ossaudio.o +endif + +pc.o: DEFINES := -DUSE_SB16 $(DEFINES) + +ifdef CONFIG_ADLIB +SOUND_HW += fmopl.o adlib.o +endif + +ifdef CONFIG_FMOD +AUDIODRV += fmodaudio.o +audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES) +LIBS += $(CONFIG_FMOD_LIB) +endif + +ifeq ($(TARGET_BASE_ARCH), i386) +# Hardware support +VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) +VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o +VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o endif ifeq ($(TARGET_ARCH), ppc) -VL_OBJS+= hw.o +VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) +VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o +VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o mixeng.o +endif +ifeq ($(TARGET_BASE_ARCH), sparc) +VL_OBJS+= sun4m.o tcx.o lance.o iommu.o m48t08.o magic-load.o slavio_intctl.o slavio_timer.o slavio_serial.o fdc.o +endif +ifdef CONFIG_GDBSTUB +VL_OBJS+=gdbstub.o endif ifdef CONFIG_SDL VL_OBJS+=sdl.o -ifdef CONFIG_STATIC -SDL_LIBS:=$(SDL_STATIC_LIBS) endif +ifdef CONFIG_SLIRP +DEFINES+=-I$(SRC_PATH)/slirp +SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ +slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ +tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o +VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) endif VL_LDFLAGS= @@ -227,11 +358,19 @@ endif ifndef CONFIG_SOFTMMU VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld endif +ifndef CONFIG_DARWIN +ifndef CONFIG_WIN32 +VL_LIBS=-lutil +endif +endif $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a - $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) + $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VL_LIBS) -sdl.o: sdl.c +sdl.o: sdl.c keymaps.c sdl_keysym.h + $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< + +sdlaudio.o: sdlaudio.c $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< depend: $(SRCS) @@ -262,16 +401,16 @@ op.o: op.c helper.o: helper.c $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< -ifeq ($(TARGET_ARCH), i386) -op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h +ifeq ($(TARGET_BASE_ARCH), i386) +op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h endif ifeq ($(TARGET_ARCH), arm) op.o: op.c op_template.h endif -ifeq ($(TARGET_ARCH), sparc) -op.o: op.c op_template.h +ifeq ($(TARGET_BASE_ARCH), sparc) +op.o: op.c op_template.h op_mem.h endif ifeq ($(TARGET_ARCH), ppc) @@ -279,6 +418,8 @@ op.o: op.c op_template.h op_mem.h op_helper.o: op_helper_mem.h endif +mixeng.o: mixeng.c mixeng.h mixeng_template.h + %.o: %.c $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< @@ -286,10 +427,12 @@ endif $(CC) $(DEFINES) -c -o $@ $< clean: - rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o + rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o install: all - install -m 755 -s $(PROGS) $(prefix)/bin +ifneq ($(PROGS),) + install -m 755 -s $(PROGS) "$(bindir)" +endif ifneq ($(wildcard .depend),) include .depend