Commit 40293e58 authored by bellard's avatar bellard

Makefile cleanup - more generic support of 32 bit compilation on x86_64


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3937 c046a42c-6fe2-441c-8c8c-71466251a162
parent 111f061b
......@@ -7,17 +7,14 @@ include config-host.mak
VPATH=$(SRC_PATH):$(SRC_PATH)/hw
BASE_CFLAGS=
BASE_LDFLAGS=
BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LIBS=
ifdef CONFIG_STATIC
BASE_LDFLAGS += -static
LDFLAGS += -static
endif
ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
......@@ -117,16 +114,16 @@ OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
endif
cocoa.o: cocoa.m
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
sdl.o: sdl.c keymaps.c sdl_keysym.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $<
audio/sdlaudio.o: audio/sdlaudio.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
libqemu_common.a: $(OBJS)
rm -f $@
......@@ -142,17 +139,17 @@ endif
######################################################################
qemu-img$(EXESUF): qemu-img.o qemu-img-block.o $(QEMU_IMG_BLOCK_OBJS)
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
$(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
qemu-img-%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG $(BASE_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG -c -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
# dyngen host tool
dyngen$(EXESUF): dyngen.c
$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
$(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^
clean:
# avoid old build problems by removing potentially incorrect old files
......@@ -300,9 +297,5 @@ tarbin:
$(docdir)/qemu-tech.html \
$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
ifneq ($(wildcard .depend),)
include .depend
endif
# Include automatically generated dependency files
-include $(wildcard *.d audio/*.d slirp/*.d)
This diff is collapsed.
......@@ -115,7 +115,6 @@ case $targetos in
CYGWIN*)
mingw32="yes"
OS_CFLAGS="-mno-cygwin"
VL_OS_LDFLAGS="-mno-cygwin"
if [ "$cpu" = "i386" ] ; then
kqemu="yes"
fi
......@@ -349,7 +348,7 @@ fi
# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
#
case $cpu in
case "$cpu" in
sparc) if test -z "$sparc_cpu" ; then
ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
ARCH_LDFLAGS="-m32"
......@@ -369,19 +368,16 @@ case $cpu in
s390)
ARCH_CFLAGS="-march=z900"
;;
i386)
ARCH_CFLAGS="-m32"
ARCH_LDFLAGS="-m32"
;;
x86_64)
ARCH_CFLAGS="-m64"
ARCH_LDFLAGS="-m64"
;;
esac
if [ "$solaris" = "yes" -a "$cpu" = "x86_64" ] ; then
CFLAGS="${CFLAGS} -m64"
OS_CFLAGS="${OS_CFLAGS} -m64"
OS_LDFLAGS="${OS_LDFLAGS} -m64"
fi
if [ "$solaris" = "yes" -a "$cpu" = "i386" ] ; then
CFLAGS="${CFLAGS} -m32"
OS_CFLAGS="${OS_CFLAGS} -m32"
fi
if test x"$show_help" = x"yes" ; then
cat << EOF
......@@ -794,9 +790,11 @@ echo "CC=$cc" >> $config_mak
echo "HOST_CC=$host_cc" >> $config_mak
echo "AR=$ar" >> $config_mak
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
# XXX: only use CFLAGS and LDFLAGS ?
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
# compilation of dyngen tool (useful for win32 build on Linux host)
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
echo "VL_OS_LDFLAGS=$VL_OS_LDFLAGS" >> $config_mak
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
echo "CFLAGS=$CFLAGS" >> $config_mak
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment