LIBS=
DEFINES=-DHAVE_BYTESWAP_H
HELPER_CFLAGS=$(CFLAGS)
+PROGS=qemu
ifdef CONFIG_STATIC
LDFLAGS+=-static
ifeq ($(ARCH),i386)
CFLAGS+=-fomit-frame-pointer
OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
-ifeq ($(GCC_MAJOR),3)
+ifeq ($(HAVE_GCC3_OPTIONS),yes)
OP_CFLAGS+= -falign-functions=0
else
OP_CFLAGS+= -malign-functions=0
# is the simplest way to make it self virtualizable!
LDFLAGS+=-Wl,-shared
endif
+ifeq ($(TARGET_ARCH), i386)
+PROGS+=vl
+endif
endif
ifeq ($(ARCH),ppc)
LDFLAGS+=-Wl,-T,arm.ld
endif
-ifeq ($(GCC_MAJOR),3)
+ifeq ($(HAVE_GCC3_OPTIONS),yes)
# very important to generate a return at the end of every operation
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
endif
OBJS += ia64-syscall.o
endif
-all: qemu qemu-doc.html
+all: $(PROGS) qemu-doc.html
qemu: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
endif
+# must use static linking to avoid leaving stuff in virtual address space
+vl: vl.o libqemu.a
+ $(CC) -static -Wl,-T,i386-vl.ld -o $@ $^ $(LIBS)
+
depend: $(SRCS)
$(CC) -MM $(CFLAGS) $^ 1>.depend
distclean: clean
rm -f config.mak config.h
-install: qemu
- install -m 755 -s qemu $(prefix)/bin
+install: $(PROGS)
+ install -m 755 -s $(PROGS) $(prefix)/bin
# various test targets
test speed: qemu
dyngen.c dyngen.h dyngen-exec.h ioctls.h syscall_types.h \
Makefile elf.h elfload.c main.c signal.c qemu.h \
syscall.c syscall_defs.h vm86.c path.c mmap.c \
-ppc.ld alpha.ld s390.ld sparc.ld arm.ld\
+i386.ld ppc.ld alpha.ld s390.ld sparc.ld arm.ld\
+vl.c i386-vl.ld\
thunk.c cpu-exec.c translate.c cpu-all.h thunk.h exec.h\
exec.c cpu-exec.c\
cpu-i386.h op-i386.c helper-i386.c syscall-i386.h translate-i386.c \
tests/Makefile \
tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h \
tests/test-i386-muldiv.h tests/test-i386-code16.S tests/test-i386-vm86.S \
-tests/hello.c tests/hello \
+tests/hello-i386.c tests/hello-i386 \
tests/hello-arm.c tests/hello-arm \
tests/sha1.c \
tests/testsig.c tests/testclone.c tests/testthread.c \