Untangle the various CFLAGS/LDFLAGS flavours. Allow overriding the
optional flags at make time. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2289 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
b371dc594b
commit
6f30fa853b
19
Makefile
19
Makefile
|
@ -5,19 +5,18 @@ include config-host.mak
|
||||||
.PHONY: all clean distclean dvi info install install-doc tar tarbin \
|
.PHONY: all clean distclean dvi info install install-doc tar tarbin \
|
||||||
speed test test2 html dvi info
|
speed test test2 html dvi info
|
||||||
|
|
||||||
CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I.
|
BASE_CFLAGS=
|
||||||
ifdef CONFIG_DARWIN
|
BASE_LDFLAGS=
|
||||||
CFLAGS+= -mdynamic-no-pic
|
|
||||||
endif
|
BASE_CFLAGS += $(OS_CFLAGS)
|
||||||
ifeq ($(ARCH),sparc)
|
ifeq ($(ARCH),sparc)
|
||||||
CFLAGS+=-mcpu=ultrasparc
|
BASE_CFLAGS += -mcpu=ultrasparc
|
||||||
endif
|
endif
|
||||||
LDFLAGS+=-g
|
CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||||
LIBS=
|
LIBS=
|
||||||
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
||||||
TOOLS=qemu-img$(EXESUF)
|
TOOLS=qemu-img$(EXESUF)
|
||||||
ifdef CONFIG_STATIC
|
ifdef CONFIG_STATIC
|
||||||
LDFLAGS+=-static
|
BASE_LDFLAGS += -static
|
||||||
endif
|
endif
|
||||||
ifdef BUILD_DOCS
|
ifdef BUILD_DOCS
|
||||||
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
|
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
|
||||||
|
@ -41,10 +40,10 @@ subdir-%: dyngen$(EXESUF)
|
||||||
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
|
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
|
||||||
|
|
||||||
qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c
|
qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c
|
||||||
$(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
|
$(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
|
||||||
|
|
||||||
dyngen$(EXESUF): dyngen.c
|
dyngen$(EXESUF): dyngen.c
|
||||||
$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
|
$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
# avoid old build problems by removing potentially incorrect old files
|
# avoid old build problems by removing potentially incorrect old files
|
||||||
|
|
131
Makefile.target
131
Makefile.target
|
@ -12,14 +12,14 @@ TARGET_BASE_ARCH:=sparc
|
||||||
endif
|
endif
|
||||||
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
|
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
|
||||||
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
|
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
|
||||||
DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
|
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
|
||||||
ifdef CONFIG_USER_ONLY
|
ifdef CONFIG_USER_ONLY
|
||||||
VPATH+=:$(SRC_PATH)/linux-user
|
VPATH+=:$(SRC_PATH)/linux-user
|
||||||
DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
|
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
|
||||||
endif
|
endif
|
||||||
CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
BASE_CFLAGS=
|
||||||
|
BASE_LDFLAGS=
|
||||||
#CFLAGS+=-Werror
|
#CFLAGS+=-Werror
|
||||||
LDFLAGS=-g
|
|
||||||
LIBS=
|
LIBS=
|
||||||
HELPER_CFLAGS=$(CFLAGS)
|
HELPER_CFLAGS=$(CFLAGS)
|
||||||
DYNGEN=../dyngen$(EXESUF)
|
DYNGEN=../dyngen$(EXESUF)
|
||||||
|
@ -62,18 +62,20 @@ endif
|
||||||
endif # !CONFIG_USER_ONLY
|
endif # !CONFIG_USER_ONLY
|
||||||
|
|
||||||
ifdef CONFIG_STATIC
|
ifdef CONFIG_STATIC
|
||||||
LDFLAGS+=-static
|
BASE_LDFLAGS+=-static
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# We require -O2 to avoid the stack setup prologue in EXIT_TB
|
||||||
|
OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
|
||||||
|
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer
|
HELPER_CFLAGS+=-fomit-frame-pointer
|
||||||
OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer
|
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
|
||||||
ifeq ($(HAVE_GCC3_OPTIONS),yes)
|
ifeq ($(HAVE_GCC3_OPTIONS),yes)
|
||||||
OP_CFLAGS+= -falign-functions=0 -fno-gcse
|
OP_CFLAGS+= -falign-functions=0 -fno-gcse
|
||||||
else
|
else
|
||||||
OP_CFLAGS+= -malign-functions=0
|
OP_CFLAGS+= -malign-functions=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef TARGET_GPROF
|
ifdef TARGET_GPROF
|
||||||
USE_I386_LD=y
|
USE_I386_LD=y
|
||||||
endif
|
endif
|
||||||
|
@ -81,76 +83,76 @@ ifdef CONFIG_STATIC
|
||||||
USE_I386_LD=y
|
USE_I386_LD=y
|
||||||
endif
|
endif
|
||||||
ifdef USE_I386_LD
|
ifdef USE_I386_LD
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
else
|
else
|
||||||
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
|
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
|
||||||
# that the kernel ELF loader considers as an executable. I think this
|
# that the kernel ELF loader considers as an executable. I think this
|
||||||
# is the simplest way to make it self virtualizable!
|
# is the simplest way to make it self virtualizable!
|
||||||
LDFLAGS+=-Wl,-shared
|
BASE_LDFLAGS+=-Wl,-shared
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
ifeq ($(ARCH),x86_64)
|
||||||
OP_CFLAGS=$(CFLAGS) -falign-functions=0
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),ppc)
|
ifeq ($(ARCH),ppc)
|
||||||
CFLAGS+= -D__powerpc__
|
CPPFLAGS+= -D__powerpc__
|
||||||
OP_CFLAGS=$(CFLAGS)
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),s390)
|
ifeq ($(ARCH),s390)
|
||||||
OP_CFLAGS=$(CFLAGS)
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),sparc)
|
ifeq ($(ARCH),sparc)
|
||||||
ifeq ($(CONFIG_SOLARIS),yes)
|
ifeq ($(CONFIG_SOLARIS),yes)
|
||||||
CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
|
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
|
||||||
LDFLAGS+=-m32
|
BASE_LDFLAGS+=-m32
|
||||||
OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
|
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
|
||||||
else
|
else
|
||||||
CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
|
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
|
||||||
LDFLAGS+=-m32
|
BASE_LDFLAGS+=-m32
|
||||||
OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
|
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
|
||||||
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
|
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
|
||||||
# -static is used to avoid g1/g3 usage by the dynamic linker
|
# -static is used to avoid g1/g3 usage by the dynamic linker
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),sparc64)
|
ifeq ($(ARCH),sparc64)
|
||||||
CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
|
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
|
||||||
LDFLAGS+=-m64
|
BASE_LDFLAGS+=-m64
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
|
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),alpha)
|
ifeq ($(ARCH),alpha)
|
||||||
# -msmall-data is not used because we want two-instruction relocations
|
# -msmall-data is not used for OP_CFLAGS because we want two-instruction
|
||||||
# for the constant constructions
|
# relocations for the constant constructions
|
||||||
OP_CFLAGS=-Wall -O2 -g
|
|
||||||
# Ensure there's only a single GP
|
# Ensure there's only a single GP
|
||||||
CFLAGS += -msmall-data
|
BASE_CFLAGS+=-msmall-data
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),ia64)
|
ifeq ($(ARCH),ia64)
|
||||||
CFLAGS += -mno-sdata
|
BASE_CFLAGS+=-mno-sdata
|
||||||
OP_CFLAGS=$(CFLAGS)
|
OP_CFLAGS+=-mno-sdata
|
||||||
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
|
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer
|
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
|
||||||
LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),m68k)
|
ifeq ($(ARCH),m68k)
|
||||||
OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
|
OP_CFLAGS+=-fomit-frame-pointer
|
||||||
LDFLAGS+=-Wl,-T,m68k.ld
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(ARCH),mips)
|
||||||
|
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_GCC3_OPTIONS),yes)
|
ifeq ($(HAVE_GCC3_OPTIONS),yes)
|
||||||
|
@ -159,13 +161,14 @@ OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_DARWIN),yes)
|
ifeq ($(CONFIG_DARWIN),yes)
|
||||||
OP_CFLAGS+= -mdynamic-no-pic
|
|
||||||
LIBS+=-lmx
|
LIBS+=-lmx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
OP_CFLAGS+=$(OS_CFLAGS)
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
|
|
||||||
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||||
LIBS+=-lm
|
LIBS+=-lm
|
||||||
ifndef CONFIG_USER_ONLY
|
ifndef CONFIG_USER_ONLY
|
||||||
LIBS+=-lz
|
LIBS+=-lz
|
||||||
|
@ -179,8 +182,8 @@ endif
|
||||||
|
|
||||||
# profiling code
|
# profiling code
|
||||||
ifdef TARGET_GPROF
|
ifdef TARGET_GPROF
|
||||||
LDFLAGS+=-p
|
BASE_LDFLAGS+=-p
|
||||||
main.o: CFLAGS+=-p
|
main.o: BASE_CFLAGS+=-p
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
|
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
|
||||||
|
@ -211,7 +214,7 @@ LIBOBJS+=fpu/softfloat.o
|
||||||
else
|
else
|
||||||
LIBOBJS+=fpu/softfloat-native.o
|
LIBOBJS+=fpu/softfloat-native.o
|
||||||
endif
|
endif
|
||||||
DEFINES+=-I$(SRC_PATH)/fpu
|
CPPFLAGS+=-I$(SRC_PATH)/fpu
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH), i386)
|
ifeq ($(TARGET_ARCH), i386)
|
||||||
LIBOBJS+=helper.o helper2.o
|
LIBOBJS+=helper.o helper2.o
|
||||||
|
@ -288,7 +291,7 @@ endif
|
||||||
all: $(PROGS)
|
all: $(PROGS)
|
||||||
|
|
||||||
$(QEMU_USER): $(OBJS)
|
$(QEMU_USER): $(OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
ifeq ($(ARCH),alpha)
|
ifeq ($(ARCH),alpha)
|
||||||
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
|
# 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)
|
# the address space (31 bit so sign extending doesn't matter)
|
||||||
|
@ -324,7 +327,7 @@ LIBS += -lole32 -ldxguid
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_FMOD
|
ifdef CONFIG_FMOD
|
||||||
AUDIODRV += fmodaudio.o
|
AUDIODRV += fmodaudio.o
|
||||||
audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
|
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
|
||||||
LIBS += $(CONFIG_FMOD_LIB)
|
LIBS += $(CONFIG_FMOD_LIB)
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_ADLIB
|
ifdef CONFIG_ADLIB
|
||||||
|
@ -347,14 +350,14 @@ VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
|
||||||
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
|
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
|
||||||
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o
|
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o
|
||||||
VL_OBJS+= usb-uhci.o
|
VL_OBJS+= usb-uhci.o
|
||||||
DEFINES += -DHAS_AUDIO
|
CPPFLAGS += -DHAS_AUDIO
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_BASE_ARCH), ppc)
|
ifeq ($(TARGET_BASE_ARCH), ppc)
|
||||||
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
|
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
|
||||||
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
|
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 heathrow_pic.o mixeng.o
|
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
|
||||||
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
|
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
|
||||||
DEFINES += -DHAS_AUDIO
|
CPPFLAGS += -DHAS_AUDIO
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_ARCH), mips)
|
ifeq ($(TARGET_ARCH), mips)
|
||||||
VL_OBJS+= mips_r4k.o mips_timer.o dma.o vga.o serial.o i8254.o i8259.o ide.o
|
VL_OBJS+= mips_r4k.o mips_timer.o dma.o vga.o serial.o i8254.o i8259.o ide.o
|
||||||
|
@ -395,7 +398,7 @@ COCOA_LIBS+=-framework CoreAudio
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_SLIRP
|
ifdef CONFIG_SLIRP
|
||||||
DEFINES+=-I$(SRC_PATH)/slirp
|
CPPFLAGS+=-I$(SRC_PATH)/slirp
|
||||||
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
|
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 \
|
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
|
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
|
||||||
|
@ -418,7 +421,7 @@ endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef TARGET_GPROF
|
ifdef TARGET_GPROF
|
||||||
vl.o: CFLAGS+=-p
|
vl.o: BASE_CFLAGS+=-p
|
||||||
VL_LDFLAGS+=-p
|
VL_LDFLAGS+=-p
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -439,22 +442,22 @@ $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
|
||||||
$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
|
$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
|
||||||
|
|
||||||
cocoa.o: cocoa.m
|
cocoa.o: cocoa.m
|
||||||
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
sdl.o: sdl.c keymaps.c sdl_keysym.h
|
sdl.o: sdl.c keymaps.c sdl_keysym.h
|
||||||
$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
|
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
|
||||||
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
sdlaudio.o: sdlaudio.c
|
sdlaudio.o: sdlaudio.c
|
||||||
$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
depend: $(SRCS)
|
depend: $(SRCS)
|
||||||
$(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
|
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
|
||||||
|
|
||||||
vldepend: $(VL_OBJS:.o=.c)
|
vldepend: $(VL_OBJS:.o=.c)
|
||||||
$(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
|
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
|
||||||
|
|
||||||
# libqemu
|
# libqemu
|
||||||
|
|
||||||
|
@ -478,26 +481,26 @@ gen-op.h: op.o $(DYNGEN)
|
||||||
$(DYNGEN) -g -o $@ $<
|
$(DYNGEN) -g -o $@ $<
|
||||||
|
|
||||||
op.o: op.c
|
op.o: op.c
|
||||||
$(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
# HELPER_CFLAGS is used for all the code compiled with static register
|
# HELPER_CFLAGS is used for all the code compiled with static register
|
||||||
# variables
|
# variables
|
||||||
ifeq ($(TARGET_BASE_ARCH), i386)
|
ifeq ($(TARGET_BASE_ARCH), i386)
|
||||||
# XXX: rename helper.c to op_helper.c
|
# XXX: rename helper.c to op_helper.c
|
||||||
helper.o: helper.c
|
helper.o: helper.c
|
||||||
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
else
|
else
|
||||||
op_helper.o: op_helper.c
|
op_helper.o: op_helper.c
|
||||||
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cpu-exec.o: cpu-exec.c
|
cpu-exec.o: cpu-exec.c
|
||||||
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
# Note: this is a workaround. The real fix is to avoid compiling
|
# Note: this is a workaround. The real fix is to avoid compiling
|
||||||
# cpu_signal_handler() in cpu-exec.c.
|
# cpu_signal_handler() in cpu-exec.c.
|
||||||
signal.o: signal.c
|
signal.o: signal.c
|
||||||
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
ifeq ($(TARGET_BASE_ARCH), i386)
|
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
|
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
|
||||||
|
@ -539,10 +542,10 @@ endif
|
||||||
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
|
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(CC) $(DEFINES) -c -o $@ $<
|
$(CC) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
|
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
|
||||||
|
|
|
@ -103,7 +103,7 @@ targetos=`uname -s`
|
||||||
case $targetos in
|
case $targetos in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
mingw32="yes"
|
mingw32="yes"
|
||||||
CFLAGS="-O2 -mno-cygwin"
|
OS_CFLAGS="-mno-cygwin"
|
||||||
;;
|
;;
|
||||||
MINGW32*)
|
MINGW32*)
|
||||||
mingw32="yes"
|
mingw32="yes"
|
||||||
|
@ -126,6 +126,7 @@ oss="yes"
|
||||||
Darwin)
|
Darwin)
|
||||||
bsd="yes"
|
bsd="yes"
|
||||||
darwin="yes"
|
darwin="yes"
|
||||||
|
OS_CFLAGS="-mdynamic-no-pic"
|
||||||
;;
|
;;
|
||||||
SunOS)
|
SunOS)
|
||||||
solaris="yes"
|
solaris="yes"
|
||||||
|
@ -243,6 +244,10 @@ for opt do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# default flags for all hosts
|
||||||
|
CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
|
||||||
|
LDFLAGS="$LDFLAGS -g"
|
||||||
|
|
||||||
if test x"$show_help" = x"yes" ; then
|
if test x"$show_help" = x"yes" ; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
|
@ -605,6 +610,7 @@ fi
|
||||||
echo "HOST_CC=$host_cc" >> $config_mak
|
echo "HOST_CC=$host_cc" >> $config_mak
|
||||||
echo "AR=$ar" >> $config_mak
|
echo "AR=$ar" >> $config_mak
|
||||||
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
|
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
|
||||||
|
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
|
||||||
echo "CFLAGS=$CFLAGS" >> $config_mak
|
echo "CFLAGS=$CFLAGS" >> $config_mak
|
||||||
echo "LDFLAGS=$LDFLAGS" >> $config_mak
|
echo "LDFLAGS=$LDFLAGS" >> $config_mak
|
||||||
echo "EXESUF=$EXESUF" >> $config_mak
|
echo "EXESUF=$EXESUF" >> $config_mak
|
||||||
|
|
Loading…
Reference in New Issue