include config.mak
include $(SRC_PATH)/rules.mak
-ifndef TARGET_BASE_ARCH
-TARGET_BASE_ARCH:=$(TARGET_ARCH)
-endif
-
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
#CFLAGS+=-Werror
LIBS=
-# user emulator name
-ifndef TARGET_ARCH2
-TARGET_ARCH2=$(TARGET_ARCH)
-endif
ifdef CONFIG_USER_ONLY
# user emulator name
PROGS=$(QEMU_PROG)
-# cc-option
-# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
-
-cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
-
HELPER_CFLAGS=
ifeq ($(ARCH),i386)
CFLAGS+=-mno-sdata
endif
-CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
-LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
-
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CPPFLAGS+=-U_FORTIFY_SOURCE
LIBS+=-lm
endif
ifdef CONFIG_SOLARIS
LIBS+=-lsocket -lnsl -lresolv
-ifdef NEEDS_LIBSUNMATH
+ifdef CONFIG_NEEDS_LIBSUNMATH
LIBS+=-lsunmath
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
ifdef CONFIG_LINUX_USER
-ifndef TARGET_ABI_DIR
- TARGET_ABI_DIR=$(TARGET_ARCH)
-endif
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
-
-ifeq ($(ARCH),i386)
-ifdef TARGET_GPROF
-USE_I386_LD=y
-endif
-ifdef CONFIG_STATIC
-USE_I386_LD=y
-endif
-ifdef USE_I386_LD
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
-# that the kernel ELF loader considers as an executable. I think this
-# is the simplest way to make it self virtualizable!
-LDFLAGS+=-Wl,-shared
-endif
-endif
-
-ifeq ($(ARCH),x86_64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ppc)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ppc64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),s390)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),sparc)
-# -static is used to avoid g1/g3 usage by the dynamic linker
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
-endif
-
-ifeq ($(ARCH),sparc64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),alpha)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ia64)
-LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),arm)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),m68k)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
-endif
-endif
-
-ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
-endif
-endif
-
# profiling code
ifdef TARGET_GPROF
LDFLAGS+=-p
obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
ioport-user.o
-LIBS+= $(PTHREADLIBS)
-LIBS+= $(CLOCKLIBS)
obj-$(TARGET_HAS_BFLT) += flatload.o
ifdef TARGET_HAS_ELFLOAD32
signal.o: CFLAGS += $(HELPER_CFLAGS)
ARLIBS=../libqemu_user.a libqemu.a
-
-ifeq ($(ARCH),alpha)
-# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
-# the address space (31 bit so sign extending doesn't matter)
- echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
-endif
-
endif #CONFIG_LINUX_USER
+LIBS+= $(PTHREADLIBS)
+LIBS+= $(CLOCKLIBS)
+
#########################################################
# Darwin user emulator target
VPATH+=:$(SRC_PATH)/bsd-user
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
-
-ifeq ($(ARCH),i386)
-ifdef TARGET_GPROF
-USE_I386_LD=y
-endif
-ifdef CONFIG_STATIC
-USE_I386_LD=y
-endif
-ifdef USE_I386_LD
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
-# that the kernel ELF loader considers as an executable. I think this
-# is the simplest way to make it self virtualizable!
-LDFLAGS+=-Wl,-shared
-endif
-endif
-
-ifeq ($(ARCH),x86_64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ppc)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ppc64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),s390)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),sparc)
-# -static is used to avoid g1/g3 usage by the dynamic linker
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
-endif
-
-ifeq ($(ARCH),sparc64)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),alpha)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),ia64)
-LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),arm)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),m68k)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
-ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
-endif
-endif
-
-ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-else
-LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
-endif
-endif
-
obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
gdbstub.o gdbstub-xml.o ioport-user.o
obj-y += uaccess.o
LIBS += -lole32 -ldxguid
endif
ifdef CONFIG_FMOD
-LIBS += $(CONFIG_FMOD_LIB)
+LIBS += $(FMOD_LIBS)
endif
ifdef CONFIG_OSS
-LIBS += $(CONFIG_OSS_LIB)
+LIBS += $(OSS_LIBS)
endif
sound-obj-y =
endif
ifdef CONFIG_VNC_TLS
-CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
-LIBS += $(CONFIG_VNC_TLS_LIBS)
+CPPFLAGS += $(VNC_TLS_CFLAGS)
+LIBS += $(VNC_TLS_LIBS)
endif
ifdef CONFIG_VNC_SASL
-CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
-LIBS += $(CONFIG_VNC_SASL_LIBS)
+CPPFLAGS += $(VNC_SASL_CFLAGS)
+LIBS += $(VNC_SASL_LIBS)
endif
ifdef CONFIG_BLUEZ
-LIBS += $(CONFIG_BLUEZ_LIBS)
+LIBS += $(BLUEZ_LIBS)
endif
# xen backend driver support
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
endif
-ifdef FDT_LIBS
-obj-ppc-y += device_tree.o
+obj-ppc-$(CONFIG_FDT) += device_tree.o
LIBS+= $(FDT_LIBS)
-endif
obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
obj-microblaze-y += pflash_cfi02.o
-ifdef FDT_LIBS
-obj-microblaze-y += device_tree.o
+obj-microblaze-$(CONFIG_FDT) += device_tree.o
LIBS+= $(FDT_LIBS)
-endif
# Boards
obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
endif
# specific flags are needed for non soft mmu emulator
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
ifndef CONFIG_DARWIN
ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS