From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSwpT-0004P0-8t for qemu-devel@nongnu.org; Thu, 07 Jan 2010 13:11:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSwpO-0004Lg-LP for qemu-devel@nongnu.org; Thu, 07 Jan 2010 13:11:26 -0500 Received: from [199.232.76.173] (port=49417 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSwpO-0004LN-16 for qemu-devel@nongnu.org; Thu, 07 Jan 2010 13:11:22 -0500 Received: from mx20.gnu.org ([199.232.41.8]:18783) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSwpN-00069A-Ae for qemu-devel@nongnu.org; Thu, 07 Jan 2010 13:11:21 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSwpM-00052z-An for qemu-devel@nongnu.org; Thu, 07 Jan 2010 13:11:20 -0500 Received: by pwj11 with SMTP id 11so13239471pwj.2 for ; Thu, 07 Jan 2010 10:11:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1262805845-10801-1-git-send-email-andreas.faerber@web.de> References: <1262805845-10801-1-git-send-email-andreas.faerber@web.de> From: Blue Swirl Date: Thu, 7 Jan 2010 18:10:58 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH v3] Drop --whole-archive and static libraries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: qemu-devel@nongnu.org, =?UTF-8?Q?Andreas_F=C3=A4rber?= , Juan Quintela , Paolo Bonzini , "Kirill A. Shutemov" , Palle Lyckegaard Thanks, applied. On Wed, Jan 6, 2010 at 7:24 PM, Andreas F=C3=A4rber wrote: > From: Andreas F=C3=A4rber > > Juan has contributed a cool Makefile infrastructure that enables us to dr= op > static libraries completely: > > Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,use= r-}, > and link those object files directly into the executables. > > Replace HWLIB by HWDIR, specifying only the directory. > > Drop --whole-archive and ARLIBS in Makefiles and configure. > > Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all > common objects after generating a target-specific header; add dependency > rules to Makefile and Makefile.target instead. > > v2: > - Don't try to include /config.mak for user emulators > - Changes to user object paths ("Quickfix for libuser.a drop") were obsol= eted > =C2=A0by "user_only: compile everything with -fpie" (Kirill A. Shutemov) > > v3: > - Fix dependency modelling for tools > - Remove comment on GENERATED_HEADERS obsoleted by this patch > > Signed-off-by: Andreas F=C3=A4rber > Cc: Blue Swirl > Cc: Palle Lyckegaard > Cc: Ben Taylor > Cc: Juan Quintela > Cc: Kirill A. Shutemov > Cc: Paolo Bonzini > --- > =C2=A0Makefile =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0138 +++++--------------= ----------------------------- > =C2=A0Makefile.hw =C2=A0 =C2=A0 | =C2=A0 33 +----------- > =C2=A0Makefile.objs =C2=A0 | =C2=A0155 ++++++++++++++++++++++++++++++++++= +++++++++++++++++++++ > =C2=A0Makefile.target | =C2=A0 33 +++++++++--- > =C2=A0Makefile.user =C2=A0 | =C2=A0 =C2=A09 +--- > =C2=A0configure =C2=A0 =C2=A0 =C2=A0 | =C2=A0 34 +------------ > =C2=A0rules.mak =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A04 +- > =C2=A07 files changed, 202 insertions(+), 204 deletions(-) > =C2=A0create mode 100644 Makefile.objs > > diff --git a/Makefile b/Makefile > index c1fa08c..2ca341b 100644 > --- a/Makefile > +++ b/Makefile > @@ -1,6 +1,5 @@ > =C2=A0# Makefile for QEMU. > > -# This needs to be defined before rules.mak > =C2=A0GENERATED_HEADERS =3D config-host.h > > =C2=A0ifneq ($(wildcard config-host.mak),) > @@ -66,7 +65,10 @@ SUBDIR_RULES=3D$(patsubst %,subdir-%, $(TARGET_DIRS)) > =C2=A0subdir-%: $(GENERATED_HEADERS) > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAG= S) -C $* V=3D"$(V)" TARGET_DIR=3D"$*/" all,) > > -$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a > +include $(SRC_PATH)/Makefile.objs > + > +$(common-obj-y): $(GENERATED_HEADERS) > +$(filter %-softmmu,$(SUBDIR_RULES)): $(common-obj-y) > > =C2=A0$(filter %-user,$(SUBDIR_RULES)): libuser.a > > @@ -81,124 +83,8 @@ ALL_SUBDIRS=3D$(TARGET_DIRS) $(patsubst %,pc-bios/%, = $(ROMS)) > > =C2=A0recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) > > -####################################################################### > -# QObject > -qobject-obj-y =3D qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o > -qobject-obj-y +=3D qjson.o json-lexer.o json-streamer.o json-parser.o > -qobject-obj-y +=3D qerror.o > - > -####################################################################### > -# block-obj-y is code used by both qemu system emulation and qemu-img > - > -block-obj-y =3D cutils.o cache-utils.o qemu-malloc.o qemu-option.o modul= e.o > -block-obj-y +=3D nbd.o block.o aio.o aes.o osdep.o > -block-obj-$(CONFIG_POSIX) +=3D posix-aio-compat.o > -block-obj-$(CONFIG_LINUX_AIO) +=3D linux-aio.o > - > -block-nested-y +=3D cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.= o vvfat.o > -block-nested-y +=3D qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snaps= hot.o > -block-nested-y +=3D parallels.o nbd.o > -block-nested-$(CONFIG_WIN32) +=3D raw-win32.o > -block-nested-$(CONFIG_POSIX) +=3D raw-posix.o > -block-nested-$(CONFIG_CURL) +=3D curl.o > - > -block-obj-y +=3D =C2=A0$(addprefix block/, $(block-nested-y)) > - > -net-obj-y =3D net.o > -net-nested-y =3D queue.o checksum.o util.o > -net-nested-y +=3D socket.o > -net-nested-y +=3D dump.o > -net-nested-$(CONFIG_POSIX) +=3D tap.o > -net-nested-$(CONFIG_LINUX) +=3D tap-linux.o > -net-nested-$(CONFIG_WIN32) +=3D tap-win32.o > -net-nested-$(CONFIG_BSD) +=3D tap-bsd.o > -net-nested-$(CONFIG_SOLARIS) +=3D tap-solaris.o > -net-nested-$(CONFIG_AIX) +=3D tap-aix.o > -net-nested-$(CONFIG_SLIRP) +=3D slirp.o > -net-nested-$(CONFIG_VDE) +=3D vde.o > -net-obj-y +=3D $(addprefix net/, $(net-nested-y)) > - > -###################################################################### > -# libqemu_common.a: Target independent part of system emulation. The > -# long term path is to suppress *all* target specific code in case of > -# system emulation, i.e. a single QEMU executable should support all > -# CPUs and machines. > - > -obj-y =3D $(block-obj-y) > -obj-y +=3D $(net-obj-y) > -obj-y +=3D $(qobject-obj-y) > -obj-y +=3D readline.o console.o > - > -obj-y +=3D tcg-runtime.o host-utils.o > -obj-y +=3D irq.o ioport.o > -obj-$(CONFIG_PTIMER) +=3D ptimer.o > -obj-$(CONFIG_MAX7310) +=3D max7310.o > -obj-$(CONFIG_WM8750) +=3D wm8750.o > -obj-$(CONFIG_TWL92230) +=3D twl92230.o > -obj-$(CONFIG_TSC2005) +=3D tsc2005.o > -obj-$(CONFIG_LM832X) +=3D lm832x.o > -obj-$(CONFIG_TMP105) +=3D tmp105.o > -obj-$(CONFIG_STELLARIS_INPUT) +=3D stellaris_input.o > -obj-$(CONFIG_SSD0303) +=3D ssd0303.o > -obj-$(CONFIG_SSD0323) +=3D ssd0323.o > -obj-$(CONFIG_ADS7846) +=3D ads7846.o > -obj-$(CONFIG_MAX111X) +=3D max111x.o > -obj-$(CONFIG_DS1338) +=3D ds1338.o > -obj-y +=3D i2c.o smbus.o smbus_eeprom.o > -obj-y +=3D eeprom93xx.o > -obj-y +=3D scsi-disk.o cdrom.o > -obj-y +=3D scsi-generic.o scsi-bus.o > -obj-y +=3D usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wac= om.o > -obj-y +=3D usb-serial.o usb-net.o usb-bus.o > -obj-$(CONFIG_SSI) +=3D ssi.o > -obj-$(CONFIG_SSI_SD) +=3D ssi-sd.o > -obj-$(CONFIG_SD) +=3D sd.o > -obj-y +=3D bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.= o usb-bt.o > -obj-y +=3D bt-hci-csr.o > -obj-y +=3D buffered_file.o migration.o migration-tcp.o qemu-sockets.o > -obj-y +=3D qemu-char.o aio.o savevm.o > -obj-y +=3D msmouse.o ps2.o > -obj-y +=3D qdev.o qdev-properties.o > -obj-y +=3D qemu-config.o block-migration.o > - > -obj-$(CONFIG_BRLAPI) +=3D baum.o > -obj-$(CONFIG_POSIX) +=3D migration-exec.o migration-unix.o migration-fd.= o > - > =C2=A0audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS +=3D $(FMOD_CFLAGS) > > -audio-obj-y =3D audio.o noaudio.o wavaudio.o mixeng.o > -audio-obj-$(CONFIG_SDL) +=3D sdlaudio.o > -audio-obj-$(CONFIG_OSS) +=3D ossaudio.o > -audio-obj-$(CONFIG_COREAUDIO) +=3D coreaudio.o > -audio-obj-$(CONFIG_ALSA) +=3D alsaaudio.o > -audio-obj-$(CONFIG_DSOUND) +=3D dsoundaudio.o > -audio-obj-$(CONFIG_FMOD) +=3D fmodaudio.o > -audio-obj-$(CONFIG_ESD) +=3D esdaudio.o > -audio-obj-$(CONFIG_PA) +=3D paaudio.o > -audio-obj-$(CONFIG_WINWAVE) +=3D winwaveaudio.o > -audio-obj-$(CONFIG_AUDIO_PT_INT) +=3D audio_pt_int.o > -audio-obj-$(CONFIG_AUDIO_WIN_INT) +=3D audio_win_int.o > -audio-obj-y +=3D wavcapture.o > -obj-y +=3D $(addprefix audio/, $(audio-obj-y)) > - > -obj-y +=3D keymaps.o > -obj-$(CONFIG_SDL) +=3D sdl.o sdl_zoom.o x_keymap.o > -obj-$(CONFIG_CURSES) +=3D curses.o > -obj-y +=3D vnc.o acl.o d3des.o > -obj-$(CONFIG_VNC_TLS) +=3D vnc-tls.o vnc-auth-vencrypt.o > -obj-$(CONFIG_VNC_SASL) +=3D vnc-auth-sasl.o > -obj-$(CONFIG_COCOA) +=3D cocoa.o > -obj-$(CONFIG_IOTHREAD) +=3D qemu-thread.o > - > -slirp-obj-y =3D cksum.o if.o ip_icmp.o ip_input.o ip_output.o > -slirp-obj-y +=3D slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_o= utput.o > -slirp-obj-y +=3D tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o > -obj-$(CONFIG_SLIRP) +=3D $(addprefix slirp/, $(slirp-obj-y)) > - > -# xen backend driver support > -obj-$(CONFIG_XEN) +=3D xen_backend.o xen_devconfig.o > -obj-$(CONFIG_XEN) +=3D xen_console.o xenfb.o xen_disk.o xen_nic.o > - > =C2=A0QEMU_CFLAGS+=3D$(CURL_CFLAGS) > > =C2=A0cocoa.o: cocoa.m > @@ -229,17 +115,23 @@ curses.o: curses.c keymaps.h curses_keys.h > > =C2=A0bt-host.o: QEMU_CFLAGS +=3D $(BLUEZ_CFLAGS) > > -libqemu_common.a: $(obj-y) > - > =C2=A0###################################################################= ### > > =C2=A0qemu-img.o: qemu-img-cmds.h > > -qemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y) $(qobject-obj-y= ) > +obj-y =3D qemu-img.o qemu-tool.o $(block-obj-y) $(qobject-obj-y) > + > +qemu-img$(EXESUF): $(obj-y) > + > +obj-y =3D qemu-nbd.o qemu-tool.o $(block-obj-y) $(qobject-obj-y) > +$(obj-y): $(GENERATED_HEADERS) > + > +qemu-nbd$(EXESUF): $(obj-y) > > -qemu-nbd$(EXESUF): =C2=A0qemu-nbd.o qemu-tool.o $(block-obj-y) $(qobject= -obj-y) > +obj-y =3D qemu-io.o qemu-tool.o cmd.o $(block-obj-y) $(qobject-obj-y) > +$(obj-y): $(GENERATED_HEADERS) > > -qemu-io$(EXESUF): =C2=A0qemu-io.o qemu-tool.o cmd.o $(block-obj-y) $(qob= ject-obj-y) > +qemu-io$(EXESUF): $(obj-y) > > =C2=A0qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet-command,sh $(SRC_PATH)/hxtool -h = < $< > $@," =C2=A0GEN =C2=A0 $@") > diff --git a/Makefile.hw b/Makefile.hw > index bd252f5..ff87ae4 100644 > --- a/Makefile.hw > +++ b/Makefile.hw > @@ -11,41 +11,12 @@ VPATH=3D$(SRC_PATH):$(SRC_PATH)/hw > > =C2=A0QEMU_CFLAGS+=3D-I.. -I$(SRC_PATH)/fpu > > -obj-y =3D > -obj-y +=3D loader.o > -obj-y +=3D virtio.o > -obj-y +=3D fw_cfg.o > -obj-y +=3D watchdog.o > -obj-$(CONFIG_ECC) +=3D ecc.o > -obj-$(CONFIG_NAND) +=3D nand.o > +include $(SRC_PATH)/Makefile.objs > > -obj-$(CONFIG_M48T59) +=3D m48t59.o > -obj-$(CONFIG_ESCC) +=3D escc.o > - > -# PCI watchdog devices > -obj-y +=3D wdt_i6300esb.o > - > -obj-y +=3D msix.o > - > -# PCI network cards > -obj-y +=3D ne2000.o > - > -obj-$(CONFIG_SMC91C111) +=3D smc91c111.o > -obj-$(CONFIG_LAN9118) +=3D lan9118.o > - > -# SCSI layer > -obj-y +=3D lsi53c895a.o > -obj-$(CONFIG_ESP) +=3D esp.o > - > -obj-y +=3D dma-helpers.o sysbus.o isa-bus.o > -obj-$(CONFIG_QDEV_ADDR) +=3D qdev-addr.o > - > -all: $(HWLIB) > +all: $(hw-obj-y) > =C2=A0# Dummy command so that make thinks it has done something > =C2=A0 =C2=A0 =C2=A0 =C2=A0@true > > -$(HWLIB): $(obj-y) > - > =C2=A0clean: > =C2=A0 =C2=A0 =C2=A0 =C2=A0rm -f *.o *.d *.a *~ > > diff --git a/Makefile.objs b/Makefile.objs > new file mode 100644 > index 0000000..e8a44d7 > --- /dev/null > +++ b/Makefile.objs > @@ -0,0 +1,155 @@ > +####################################################################### > +# QObject > +qobject-obj-y =3D qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o > +qobject-obj-y +=3D qjson.o json-lexer.o json-streamer.o json-parser.o > +qobject-obj-y +=3D qerror.o > + > +####################################################################### > +# block-obj-y is code used by both qemu system emulation and qemu-img > + > +block-obj-y =3D cutils.o cache-utils.o qemu-malloc.o qemu-option.o modul= e.o > +block-obj-y +=3D nbd.o block.o aio.o aes.o osdep.o > +block-obj-$(CONFIG_POSIX) +=3D posix-aio-compat.o > +block-obj-$(CONFIG_LINUX_AIO) +=3D linux-aio.o > + > +block-nested-y +=3D cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.= o vvfat.o > +block-nested-y +=3D qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snaps= hot.o > +block-nested-y +=3D parallels.o nbd.o > +block-nested-$(CONFIG_WIN32) +=3D raw-win32.o > +block-nested-$(CONFIG_POSIX) +=3D raw-posix.o > +block-nested-$(CONFIG_CURL) +=3D curl.o > + > +block-obj-y +=3D =C2=A0$(addprefix block/, $(block-nested-y)) > + > +net-obj-y =3D net.o > +net-nested-y =3D queue.o checksum.o util.o > +net-nested-y +=3D socket.o > +net-nested-y +=3D dump.o > +net-nested-$(CONFIG_POSIX) +=3D tap.o > +net-nested-$(CONFIG_LINUX) +=3D tap-linux.o > +net-nested-$(CONFIG_WIN32) +=3D tap-win32.o > +net-nested-$(CONFIG_BSD) +=3D tap-bsd.o > +net-nested-$(CONFIG_SOLARIS) +=3D tap-solaris.o > +net-nested-$(CONFIG_AIX) +=3D tap-aix.o > +net-nested-$(CONFIG_SLIRP) +=3D slirp.o > +net-nested-$(CONFIG_VDE) +=3D vde.o > +net-obj-y +=3D $(addprefix net/, $(net-nested-y)) > + > +###################################################################### > +# libqemu_common.a: Target independent part of system emulation. The > +# long term path is to suppress *all* target specific code in case of > +# system emulation, i.e. a single QEMU executable should support all > +# CPUs and machines. > + > +common-obj-y =3D $(block-obj-y) > +common-obj-y +=3D $(net-obj-y) > +common-obj-y +=3D $(qobject-obj-y) > +common-obj-y +=3D readline.o console.o > + > +common-obj-y +=3D tcg-runtime.o host-utils.o > +common-obj-y +=3D irq.o ioport.o > +common-obj-$(CONFIG_PTIMER) +=3D ptimer.o > +common-obj-$(CONFIG_MAX7310) +=3D max7310.o > +common-obj-$(CONFIG_WM8750) +=3D wm8750.o > +common-obj-$(CONFIG_TWL92230) +=3D twl92230.o > +common-obj-$(CONFIG_TSC2005) +=3D tsc2005.o > +common-obj-$(CONFIG_LM832X) +=3D lm832x.o > +common-obj-$(CONFIG_TMP105) +=3D tmp105.o > +common-obj-$(CONFIG_STELLARIS_INPUT) +=3D stellaris_input.o > +common-obj-$(CONFIG_SSD0303) +=3D ssd0303.o > +common-obj-$(CONFIG_SSD0323) +=3D ssd0323.o > +common-obj-$(CONFIG_ADS7846) +=3D ads7846.o > +common-obj-$(CONFIG_MAX111X) +=3D max111x.o > +common-obj-$(CONFIG_DS1338) +=3D ds1338.o > +common-obj-y +=3D i2c.o smbus.o smbus_eeprom.o > +common-obj-y +=3D eeprom93xx.o > +common-obj-y +=3D scsi-disk.o cdrom.o > +common-obj-y +=3D scsi-generic.o scsi-bus.o > +common-obj-y +=3D usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o = usb-wacom.o > +common-obj-y +=3D usb-serial.o usb-net.o usb-bus.o > +common-obj-$(CONFIG_SSI) +=3D ssi.o > +common-obj-$(CONFIG_SSI_SD) +=3D ssi-sd.o > +common-obj-$(CONFIG_SD) +=3D sd.o > +common-obj-y +=3D bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o = bt-hid.o usb-bt.o > +common-obj-y +=3D bt-hci-csr.o > +common-obj-y +=3D buffered_file.o migration.o migration-tcp.o qemu-socke= ts.o > +common-obj-y +=3D qemu-char.o savevm.o #aio.o > +common-obj-y +=3D msmouse.o ps2.o > +common-obj-y +=3D qdev.o qdev-properties.o > +common-obj-y +=3D qemu-config.o block-migration.o > + > +common-obj-$(CONFIG_BRLAPI) +=3D baum.o > +common-obj-$(CONFIG_POSIX) +=3D migration-exec.o migration-unix.o migrat= ion-fd.o > + > +audio-obj-y =3D audio.o noaudio.o wavaudio.o mixeng.o > +audio-obj-$(CONFIG_SDL) +=3D sdlaudio.o > +audio-obj-$(CONFIG_OSS) +=3D ossaudio.o > +audio-obj-$(CONFIG_COREAUDIO) +=3D coreaudio.o > +audio-obj-$(CONFIG_ALSA) +=3D alsaaudio.o > +audio-obj-$(CONFIG_DSOUND) +=3D dsoundaudio.o > +audio-obj-$(CONFIG_FMOD) +=3D fmodaudio.o > +audio-obj-$(CONFIG_ESD) +=3D esdaudio.o > +audio-obj-$(CONFIG_PA) +=3D paaudio.o > +audio-obj-$(CONFIG_WINWAVE) +=3D winwaveaudio.o > +audio-obj-$(CONFIG_AUDIO_PT_INT) +=3D audio_pt_int.o > +audio-obj-$(CONFIG_AUDIO_WIN_INT) +=3D audio_win_int.o > +audio-obj-y +=3D wavcapture.o > +common-obj-y +=3D $(addprefix audio/, $(audio-obj-y)) > + > +common-obj-y +=3D keymaps.o > +common-obj-$(CONFIG_SDL) +=3D sdl.o sdl_zoom.o x_keymap.o > +common-obj-$(CONFIG_CURSES) +=3D curses.o > +common-obj-y +=3D vnc.o acl.o d3des.o > +common-obj-$(CONFIG_VNC_TLS) +=3D vnc-tls.o vnc-auth-vencrypt.o > +common-obj-$(CONFIG_VNC_SASL) +=3D vnc-auth-sasl.o > +common-obj-$(CONFIG_COCOA) +=3D cocoa.o > +common-obj-$(CONFIG_IOTHREAD) +=3D qemu-thread.o > + > +slirp-obj-y =3D cksum.o if.o ip_icmp.o ip_input.o ip_output.o > +slirp-obj-y +=3D slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_o= utput.o > +slirp-obj-y +=3D tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o > +common-obj-$(CONFIG_SLIRP) +=3D $(addprefix slirp/, $(slirp-obj-y)) > + > +# xen backend driver support > +common-obj-$(CONFIG_XEN) +=3D xen_backend.o xen_devconfig.o > +common-obj-$(CONFIG_XEN) +=3D xen_console.o xenfb.o xen_disk.o xen_nic.o > + > +###################################################################### > +# libuser > + > +user-obj-y =3D > +user-obj-y +=3D envlist.o path.o > +user-obj-y +=3D tcg-runtime.o host-utils.o > +user-obj-y +=3D cutils.o cache-utils.o > + > +###################################################################### > +# libhw > + > +hw-obj-y =3D > +hw-obj-y +=3D loader.o > +hw-obj-y +=3D virtio.o > +hw-obj-y +=3D fw_cfg.o > +hw-obj-y +=3D watchdog.o > +hw-obj-$(CONFIG_ECC) +=3D ecc.o > +hw-obj-$(CONFIG_NAND) +=3D nand.o > + > +hw-obj-$(CONFIG_M48T59) +=3D m48t59.o > +hw-obj-$(CONFIG_ESCC) +=3D escc.o > + > +# PCI watchdog devices > +hw-obj-y +=3D wdt_i6300esb.o > + > +hw-obj-y +=3D msix.o > + > +# PCI network cards > +hw-obj-y +=3D ne2000.o > + > +hw-obj-$(CONFIG_SMC91C111) +=3D smc91c111.o > +hw-obj-$(CONFIG_LAN9118) +=3D lan9118.o > + > +# SCSI layer > +hw-obj-y +=3D lsi53c895a.o > +hw-obj-$(CONFIG_ESP) +=3D esp.o > + > +hw-obj-y +=3D dma-helpers.o sysbus.o isa-bus.o > +hw-obj-$(CONFIG_QDEV_ADDR) +=3D qdev-addr.o > diff --git a/Makefile.target b/Makefile.target > index 7c1f30c..543e8cd 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -1,17 +1,21 @@ > =C2=A0# -*- Mode: makefile -*- > > -# This needs to be defined before rules.mak > =C2=A0GENERATED_HEADERS =3D config-target.h > > =C2=A0include ../config-host.mak > =C2=A0include config-devices.mak > =C2=A0include config-target.mak > =C2=A0include $(SRC_PATH)/rules.mak > +ifneq ($(HWDIR),) > +include $(HWDIR)/config.mak > +endif > > =C2=A0TARGET_PATH=3D$(SRC_PATH)/target-$(TARGET_BASE_ARCH) > =C2=A0VPATH=3D$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw > =C2=A0QEMU_CFLAGS+=3D -I.. -I$(TARGET_PATH) -DNEED_CPU_H > > +include $(SRC_PATH)/Makefile.objs > + > =C2=A0ifdef CONFIG_USER_ONLY > =C2=A0# user emulator name > =C2=A0QEMU_PROG=3Dqemu-$(TARGET_ARCH2) > @@ -64,9 +68,9 @@ libobj-$(CONFIG_S390_DIS) +=3D s390-dis.o > =C2=A0libobj-$(CONFIG_SH4_DIS) +=3D sh4-dis.o > =C2=A0libobj-$(CONFIG_SPARC_DIS) +=3D sparc-dis.o > > -# libqemu > +$(libobj-y): $(GENERATED_HEADERS) > > -libqemu.a: $(libobj-y) > +# libqemu > > =C2=A0translate.o: translate.c cpu.h > > @@ -106,7 +110,10 @@ obj-arm-y +=3D arm-semi.o > > =C2=A0obj-m68k-y +=3D m68k-sim.o m68k-semi.o > > -ARLIBS=3D../libuser/libuser.a libqemu.a > +$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) > + > +obj-y +=3D $(addprefix ../libuser/, $(user-obj-y)) > +obj-y +=3D $(libobj-y) > > =C2=A0endif #CONFIG_LINUX_USER > > @@ -128,7 +135,10 @@ obj-y =3D main.o commpage.o machload.o mmap.o signal= .o syscall.o thunk.o \ > > =C2=A0obj-i386-y +=3D ioport-user.o > > -ARLIBS=3D../libuser/libuser.a libqemu.a > +$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) > + > +obj-y +=3D $(addprefix ../libuser/, $(user-obj-y)) > +obj-y +=3D $(libobj-y) > > =C2=A0endif #CONFIG_DARWIN_USER > > @@ -145,7 +155,10 @@ obj-y =3D main.o bsdload.o elfload.o mmap.o signal.o= strace.o syscall.o \ > > =C2=A0obj-i386-y +=3D ioport-user.o > > -ARLIBS=3D../libuser/libuser.a libqemu.a > +$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) > + > +obj-y +=3D $(addprefix ../libuser/, $(user-obj-y)) > +obj-y +=3D $(libobj-y) > > =C2=A0endif #CONFIG_BSD_USER > > @@ -303,13 +316,17 @@ vl.o: qemu-options.h > > =C2=A0monitor.o: qemu-monitor.h > > -ARLIBS=3D../libqemu_common.a libqemu.a $(HWLIB) > +$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) > + > +obj-y +=3D $(addprefix ../, $(common-obj-y)) > +obj-y +=3D $(libobj-y) > +obj-y +=3D $(addprefix $(HWDIR)/, $(hw-obj-y)) > > =C2=A0endif # CONFIG_SOFTMMU > > =C2=A0obj-$(CONFIG_GDBSTUB_XML) +=3D gdbstub-xml.o > > -$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS) > +$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)= -y)) > > > diff --git a/Makefile.user b/Makefile.user > index 7daedef..c6ac509 100644 > --- a/Makefile.user > +++ b/Makefile.user > @@ -14,17 +14,12 @@ vpath %.c %.h $(SRC_PATH) > > =C2=A0QEMU_CFLAGS+=3D-I.. > > -obj-y =3D > -obj-y +=3D envlist.o path.o > -obj-y +=3D tcg-runtime.o host-utils.o > -obj-y +=3D cutils.o cache-utils.o > +include $(SRC_PATH)/Makefile.objs > > -all: libuser.a > +all: $(user-obj-y) > =C2=A0# Dummy command so that make thinks it has done something > =C2=A0 =C2=A0 =C2=A0 =C2=A0@true > > -libuser.a: $(obj-y) > - > =C2=A0clean: > =C2=A0 =C2=A0 =C2=A0 =C2=A0rm -f *.o *.d *.a *~ > > diff --git a/configure b/configure > index 18aed43..1e9dd04 100755 > --- a/configure > +++ b/configure > @@ -1707,37 +1707,6 @@ elif compile_prog "" "-lrt" ; then > =C2=A0 LIBS=3D"-lrt $LIBS" > =C2=A0fi > > -# Determine what linker flags to use to force archive inclusion > -check_linker_flags() > -{ > - =C2=A0 =C2=A0w2=3D > - =C2=A0 =C2=A0if test "$2" ; then > - =C2=A0 =C2=A0 =C2=A0 w2=3D-Wl,$2 > - =C2=A0 =C2=A0fi > - =C2=A0 =C2=A0compile_prog "" "-Wl,$1 ${w2}" > -} > - > -cat > $TMPC << EOF > -int main(void) { } > -EOF > -if check_linker_flags --whole-archive --no-whole-archive ; then > - =C2=A0 =C2=A0# GNU ld > - =C2=A0 =C2=A0arlibs_begin=3D"-Wl,--whole-archive" > - =C2=A0 =C2=A0arlibs_end=3D"-Wl,--no-whole-archive" > -elif check_linker_flags -z,allextract -z,defaultextract ; then > - =C2=A0 =C2=A0# Solaris ld > - =C2=A0 =C2=A0arlibs_begin=3D"-Wl,-z,allextract" > - =C2=A0 =C2=A0arlibs_end=3D"-Wl,-z,defaultextract" > -elif check_linker_flags -all_load ; then > - =C2=A0 =C2=A0# Mac OS X > - =C2=A0 =C2=A0arlibs_begin=3D"-all_load" > - =C2=A0 =C2=A0arlibs_end=3D"" > -else > - =C2=A0 =C2=A0echo "Error: your linker does not support --whole-archive = or -z." > - =C2=A0 =C2=A0echo "Please report to qemu-devel@nongnu.org" > - =C2=A0 =C2=A0exit 1 > -fi > - > =C2=A0if test "$darwin" !=3D "yes" -a "$mingw32" !=3D "yes" -a "$solaris"= !=3D yes -a \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 "$aix" !=3D "yes" ; then > =C2=A0 =C2=A0 libs_softmmu=3D"-lutil $libs_softmmu" > @@ -2427,7 +2396,7 @@ fi > =C2=A0if test "$target_softmmu" =3D "yes" ; then > =C2=A0 echo "CONFIG_SOFTMMU=3Dy" >> $config_target_mak > =C2=A0 echo "LIBS+=3D$libs_softmmu" >> $config_target_mak > - =C2=A0echo "HWLIB=3D../libhw$target_phys_bits/libqemuhw$target_phys_bit= s.a" >> $config_target_mak > + =C2=A0echo "HWDIR=3D../libhw$target_phys_bits" >> $config_target_mak > =C2=A0 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_ho= st_mak > =C2=A0fi > =C2=A0if test "$target_user_only" =3D "yes" ; then > @@ -2644,7 +2613,6 @@ for hwlib in 32 64; do > =C2=A0 mkdir -p $d > =C2=A0 rm -f $d/Makefile > =C2=A0 ln -s $source_path/Makefile.hw $d/Makefile > - =C2=A0echo "HWLIB=3Dlibqemuhw$hwlib.a" > $d/config.mak > =C2=A0 echo "QEMU_CFLAGS+=3D-DTARGET_PHYS_ADDR_BITS=3D$hwlib" >> $d/confi= g.mak > =C2=A0done > > diff --git a/rules.mak b/rules.mak > index 5d9f684..9bcf9af 100644 > --- a/rules.mak > +++ b/rules.mak > @@ -14,7 +14,7 @@ MAKEFLAGS +=3D -rR > =C2=A0# Flags for dependency generation > =C2=A0QEMU_DGFLAGS +=3D -MMD -MP -MT $@ > > -%.o: %.c $(GENERATED_HEADERS) > +%.o: %.c > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QE= MU_DGFLAGS) $(CFLAGS) -c -o $@ $<," =C2=A0CC =C2=A0 =C2=A0$(TARGET_DIR)$@") > > =C2=A0%.o: %.S > @@ -23,7 +23,7 @@ QEMU_DGFLAGS +=3D -MMD -MP -MT $@ > =C2=A0%.o: %.m > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QE= MU_DGFLAGS) $(CFLAGS) -c -o $@ $<," =C2=A0OBJC =C2=A0$(TARGET_DIR)$@") > > -LINK =3D $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) = -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," =C2=A0LINK =C2= =A0$(TARGET_DIR)$@") > +LINK =3D $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) = -o $@ $(1) $(LIBS)," =C2=A0LINK =C2=A0$(TARGET_DIR)$@") > > =C2=A0%$(EXESUF): %.o > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call LINK,$^) > -- > 1.6.5.3 > >