SDL static config fix (Roman Zippel)
[qemu] / Makefile.target
index 0d38b1d..84f9df8 100644 (file)
@@ -11,12 +11,16 @@ CFLAGS=-Wall -O2 -g
 LDFLAGS=-g
 LIBS=
 HELPER_CFLAGS=$(CFLAGS)
-DYNGEN=../dyngen
+DYNGEN=../dyngen$(EXESUF)
 # user emulator name
 QEMU_USER=qemu-$(TARGET_ARCH)
 # 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
@@ -52,6 +56,12 @@ PROGS+=$(QEMU_SYSTEM)
 endif
 endif # ARCH = i386
 
+ifeq ($(ARCH), amd64)
+ifdef CONFIG_SOFTMMU
+PROGS+=$(QEMU_SYSTEM)
+endif
+endif # ARCH = amd64
+
 endif # TARGET_ARCH = ppc
 endif # !CONFIG_USER_ONLY
 
@@ -146,6 +156,9 @@ endif
 
 DEFINES+=-D_GNU_SOURCE
 LIBS+=-lm
+ifdef CONFIG_WIN32
+LIBS+=-lwinmm
+endif
 
 # profiling code
 ifdef TARGET_GPROF
@@ -166,7 +179,7 @@ SRCS:= $(OBJS:.o=.c)
 OBJS+= libqemu.a
 
 # cpu emulator library
-LIBOBJS=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)
@@ -219,17 +232,33 @@ ifeq ($(ARCH),alpha)
 endif
 
 # must use static linking to avoid leaving stuff in virtual address space
-VL_OBJS=vl.o osdep.o block.o monitor.o \
-        ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o \
-        fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
+VL_OBJS=vl.o osdep.o block.o monitor.o
+
+ifeq ($(TARGET_ARCH), i386)
+# Hardware support
+VL_OBJS+= ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o
+VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
+endif
 ifeq ($(TARGET_ARCH), ppc)
-VL_OBJS+= hw.o
+# Generic PPC support
+VL_OBJS+= ppc.o
+# PREP hardware support
+VL_OBJS+= ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o
+VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o ppc_prep.o
+#VL_OBJS+= hw.o of.o setup.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
+VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
 endif
 
 VL_LDFLAGS=
@@ -240,9 +269,12 @@ endif
 ifndef CONFIG_SOFTMMU
 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld 
 endif
+ifndef CONFIG_WIN32
+VL_LIBS=-lutil
+endif
 
 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
-       $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) -lutil 
+       $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VL_LIBS)
 
 sdl.o: sdl.c
        $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
@@ -299,10 +331,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