qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 4/4] Makefile: fix qga dependencies
@ 2011-11-16 21:58 Michael S. Tsirkin
  2011-11-17  9:31 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 21:58 UTC (permalink / raw)
  Cc: Anthony Liguori, Stefan Hajnoczi, Michael S. Tsirkin, qemu-devel,
	Michael Roth, Luiz Capitulino

.c files include .h files, so .o depends on .h,
and the linked result depends on .o.
We got it wrong for qga rules, fix it up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 Makefile |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index c7f2cbd..7c93739 100644
--- a/Makefile
+++ b/Makefile
@@ -208,11 +208,12 @@ test-visitor: test-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qap
 test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
 test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
 
-QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c qga-qmp-commands.h)
-$(QGALIB_GEN): $(GENERATED_HEADERS)
-$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
+QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
+QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
+$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
+$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
 
-qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(addprefix $(qapi-dir)/, qga-qapi-visit.o qga-qapi-types.o qga-qmp-marshal.o)
+qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
 
 QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
 
-- 
1.7.5.53.gc233e

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 4/4] Makefile: fix qga dependencies
  2011-11-16 21:58 [Qemu-devel] [PATCH 4/4] Makefile: fix qga dependencies Michael S. Tsirkin
@ 2011-11-17  9:31 ` Paolo Bonzini
  2011-11-17 12:22   ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2011-11-17  9:31 UTC (permalink / raw)
  To: qemu-devel

On 11/16/2011 10:58 PM, Michael S. Tsirkin wrote:
> .c files include .h files, so .o depends on .h,
> and the linked result depends on .o.
> We got it wrong for qga rules, fix it up.

Another possible option is to make the "all" target depend on 
GENERATED_HEADERS and GENERATED_SOURCES, like

all: $(GENERATED_HEADERS) $(GENERATED_SOURCES)
	@$(MAKE) build-all

and drop the dependency everywhere else.  This will check the dependency 
at the beginning of the build (should be fine since the generated files 
change rarely) and rely on automatic dependency generation for the 
.o->.h dependencies.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 4/4] Makefile: fix qga dependencies
  2011-11-17  9:31 ` Paolo Bonzini
@ 2011-11-17 12:22   ` Andreas Färber
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2011-11-17 12:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Am 17.11.2011 10:31, schrieb Paolo Bonzini:
> On 11/16/2011 10:58 PM, Michael S. Tsirkin wrote:
>> .c files include .h files, so .o depends on .h,
>> and the linked result depends on .o.
>> We got it wrong for qga rules, fix it up.
> 
> Another possible option is to make the "all" target depend on
> GENERATED_HEADERS and GENERATED_SOURCES, like
> 
> all: $(GENERATED_HEADERS) $(GENERATED_SOURCES)
>     @$(MAKE) build-all
> 
> and drop the dependency everywhere else.

Please don't. `make qemu-img`, for example, should work, too. That
bypasses the "all" target IIUC.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-17 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 21:58 [Qemu-devel] [PATCH 4/4] Makefile: fix qga dependencies Michael S. Tsirkin
2011-11-17  9:31 ` Paolo Bonzini
2011-11-17 12:22   ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).