All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 16/27] build: move util-obj-y to libqemuutil.a
Date: Sat, 12 Jan 2013 18:35:27 +0100	[thread overview]
Message-ID: <1358012138-21613-17-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1358012138-21613-1-git-send-email-pbonzini@redhat.com>

Use a static library to eliminate repetition in the linking rules.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile        | 17 +++++++++--------
 Makefile.objs   |  1 -
 Makefile.target |  8 ++++----
 tests/Makefile  | 17 ++++++++---------
 4 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index 965ffeb..0b470ec 100644
--- a/Makefile
+++ b/Makefile
@@ -133,7 +133,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
-$(SUBDIR_RULES): libqemustub.a
+$(SUBDIR_RULES): libqemuutil.a libqemustub.a
 
 $(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y)
 
@@ -155,25 +155,26 @@ version.o: $(SRC_PATH)/version.rc config-host.h
 version-obj-$(CONFIG_WIN32) += version.o
 
 ######################################################################
-# Build library with stubs
+# Build libraries
 
 libqemustub.a: $(stub-obj-y)
+libqemuutil.a: $(util-obj-y)
 
 ######################################################################
 
 qemu-img.o: qemu-img-cmds.h
 
-tools-obj-y = $(util-obj-y) $(trace-obj-y) qemu-timer.o \
+tools-obj-y = $(trace-obj-y) qemu-timer.o \
 	main-loop.o iohandler.o error.o
 tools-obj-$(CONFIG_POSIX) += compatfd.o
 
-qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemustub.a
-qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemustub.a
-qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a
+qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a
+qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a
+qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a
 
 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
 
-fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
+fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o $(trace-obj-y) libqemuutil.a libqemustub.a
 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
 
 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
@@ -209,7 +210,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
 $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 
-qemu-ga$(EXESUF): $(qga-obj-y) $(util-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a
+qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a
 	$(call LINK, $^)
 
 clean:
diff --git a/Makefile.objs b/Makefile.objs
index 56d95e5..a5bfc7d 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -78,7 +78,6 @@ common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
 common-obj-y += net/
 common-obj-y += qom/
 common-obj-y += readline.o
-common-obj-y += $(util-obj-y)
 common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
 
diff --git a/Makefile.target b/Makefile.target
index 2534e77..0a12873 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -83,7 +83,7 @@ ifdef CONFIG_LINUX_USER
 QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
 
 obj-y += linux-user/
-obj-y += gdbstub.o thunk.o user-exec.o $(util-obj-y)
+obj-y += gdbstub.o thunk.o user-exec.o
 
 endif #CONFIG_LINUX_USER
 
@@ -95,7 +95,7 @@ ifdef CONFIG_BSD_USER
 QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
 
 obj-y += bsd-user/
-obj-y += gdbstub.o user-exec.o $(util-obj-y)
+obj-y += gdbstub.o user-exec.o
 
 endif #CONFIG_BSD_USER
 
@@ -155,12 +155,12 @@ endif #CONFIG_LINUX_USER
 
 ifdef QEMU_PROGW
 # The linker builds a windows executable. Make also a console executable.
-$(QEMU_PROGW): $(all-obj-y) ../libqemustub.a
+$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
 	$(call LINK,$^)
 $(QEMU_PROG): $(QEMU_PROGW)
 	$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"  GEN   $(TARGET_DIR)$(QEMU_PROG)")
 else
-$(QEMU_PROG): $(all-obj-y) ../libqemustub.a
+$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
 	$(call LINK,$^)
 endif
 
diff --git a/tests/Makefile b/tests/Makefile
index 693d137..329c912 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,7 +72,6 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
 
 test-qapi-obj-y =  $(qobject-obj-y) $(qapi-obj-y)
 test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
-test-qapi-obj-y += module.o
 
 $(test-obj-y): QEMU_INCLUDES += -Itests
 
@@ -98,13 +97,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, "  GEN   $@")
 
 
-tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a
-tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a
-tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a
-tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a
-tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a
-tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a
-tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a
+tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
+tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a
 
 tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
 tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
@@ -117,7 +116,7 @@ TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
 QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
 check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
 
-qtest-obj-y = tests/libqtest.o $(util-obj-y) libqemustub.a
+qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
 $(check-qtest-y): $(qtest-obj-y)
 
 .PHONY: check-help
-- 
1.8.1

  parent reply	other threads:[~2013-01-12 17:36 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-12 17:35 [Qemu-devel] [PULL 00/27] More source reorganization and build system TLC Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 01/27] qemu-option: move standard option definitions out of qemu-config.c Paolo Bonzini
2013-01-14  9:26   ` Stefan Hajnoczi
2013-01-14  9:49     ` Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 02/27] stubs: fully replace qemu-tool.c and qemu-user.c Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 03/27] build: make libtool verbose when making with V=1 Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 04/27] build: support linking with libtool objects/libraries Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 05/27] build: move dtrace rules to rules.mak Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 06/27] build: remove CONFIG_SMARTCARD Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 07/27] libcacard: fix missing symbol in libcacard.so Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 08/27] libcacard: require libtool to build it Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 09/27] libcacard: prepare to use -y trick in the Makefile Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 10/27] libcacard: use per-target variable definitions Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 11/27] libcacard: add list of exported symbols Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 12/27] libcacard: rewrite Makefile in non-recursive style Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 13/27] libcacard: link vscclient to dynamic library Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 14/27] libcacard: list oslib-obj-y file explicitly Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 15/27] build: rename oslib-obj-y to util-obj-y Paolo Bonzini
2013-01-12 17:35 ` Paolo Bonzini [this message]
2013-01-12 17:35 ` [Qemu-devel] [PATCH 17/27] build: move files away from tools-obj-y, common-obj-y, user-obj-y Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 18/27] build: move libqemuutil.a components to util/ Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 19/27] build: move qobject files to qobject/ and libqemuutil.a Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 20/27] build: consolidate multiple variables into universal-obj-y Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 21/27] build: move QAPI definitions for QEMU out of qapi-obj-y Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 22/27] build: move base QAPI files to libqemuutil.a Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 23/27] build: move version-obj-y to the generic LINK rule Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 24/27] build: remove coroutine-obj-y Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 25/27] build: some simplifications for "trace/Makefile.objs" Paolo Bonzini
2013-01-14 15:19   ` Lluís Vilanova
2013-01-14 15:30     ` Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 26/27] build: fold trace-obj-y into libqemuutil.a Paolo Bonzini
2013-01-12 17:35 ` [Qemu-devel] [PATCH 27/27] build: improve quiet output for .stp rules Paolo Bonzini
2013-01-14  9:33 ` [Qemu-devel] [PULL 00/27] More source reorganization and build system TLC Stefan Hajnoczi
2013-01-18 18:03 ` Andreas Färber
2013-01-19 10:17   ` Paolo Bonzini
2013-01-19 10:21     ` Blue Swirl
2013-01-19 10:43       ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2012-12-21 16:05 [Qemu-devel] [PATCH " Paolo Bonzini
2012-12-21 16:05 ` [Qemu-devel] [PATCH 16/27] build: move util-obj-y to libqemuutil.a Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358012138-21613-17-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.