qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [PATCH 7/6] Makefile: Make Makefile depend on generated qga files, too
Date: Tue, 3 Dec 2019 16:33:15 -0600	[thread overview]
Message-ID: <45cff400-7e88-cefe-560e-7642d2ea1d00@redhat.com> (raw)
In-Reply-To: <20191129095927.17382-1-armbru@redhat.com>

On 11/29/19 3:59 AM, Markus Armbruster wrote:
> Generated .h need to be generated before compiling any .c using them.
> To know which .h a .c uses, we need to compile it.
> 
> Since commit 4115852bb0 "build: do not sprinkle around
> GENERATED_HEADERS dependencies", we break this circular dependency the
> simple & stupid way: the generated headers are a prerequisite of
> Makefile, which causes Make to generate them first, then start over.

which is a pain when using 'make --dry-run' to see what would get built 
(a dependency of Makefile _is_ rebuilt if Makefile itself has to be 
updated), but not the fault of this patch.

> 
> Except for qga we still use the older method of making all its .o
> summarily depend on all its generated .h (commit 016c77ad62 "Makefile:
> add missing deps on $(GENERATED_HEADERS)").
> 
> Add qga's generated files to generated-files-y to get rid of this
> exception.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   Makefile | 21 +++++++++++----------
>   1 file changed, 11 insertions(+), 10 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>


> +++ b/Makefile
> @@ -130,6 +130,15 @@ GENERATED_QAPI_FILES += qapi/qapi-doc.texi
>   
>   generated-files-y += $(GENERATED_QAPI_FILES)
>   
> +GENERATED_QGA_FILES := qga-qapi-types.c qga-qapi-types.h
> +GENERATED_QGA_FILES += qga-qapi-visit.c qga-qapi-visit.h
> +GENERATED_QGA_FILES += qga-qapi-commands.h qga-qapi-commands.c
> +GENERATED_QGA_FILES += qga-qapi-init-commands.h qga-qapi-init-commands.c
> +GENERATED_QGA_FILES += qga-qapi-doc.texi
> +GENERATED_QGA_FILES := $(addprefix qga/qapi-generated/, $(GENERATED_QGA_FILES))

Would it be worth using two separate variable names (maybe 
GENERATED_QGA_BASEFILES for the first list) rather than exploiting the 
arcane knowledge that consecutive use of := causes GNU make to rewrite 
an existing variable with new contents?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2019-12-03 22:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 18:25 [PATCH 0/6] qapi: Module fixes and cleanups Markus Armbruster
2019-11-20 18:25 ` [PATCH 1/6] qapi: Tweak "command returns a nice type" check for clarity Markus Armbruster
2019-11-20 19:08   ` Eric Blake
2019-11-20 18:25 ` [PATCH 2/6] tests/Makefile.include: Fix missing test-qapi-emit-events.[ch] Markus Armbruster
2019-11-20 19:16   ` Eric Blake
2019-11-20 18:25 ` [PATCH 3/6] qapi: Generate command registration stuff into separate files Markus Armbruster
2019-11-20 19:26   ` Eric Blake
2019-11-27 16:12     ` Markus Armbruster
2019-11-20 18:25 ` [PATCH 4/6] qapi: Proper intermediate representation for modules Markus Armbruster
2019-11-20 20:31   ` Eric Blake
2019-11-20 18:25 ` [PATCH 5/6] qapi: Fix code generation for empty modules Markus Armbruster
2019-11-20 20:35   ` Eric Blake
2019-11-20 18:25 ` [PATCH 6/6] qapi: Simplify QAPISchemaModularCVisitor Markus Armbruster
2019-11-20 20:54   ` Eric Blake
2019-11-20 19:40 ` [PATCH 0/6] qapi: Module fixes and cleanups Markus Armbruster
2019-11-20 23:58 ` no-reply
2019-11-21  6:27 ` Markus Armbruster
2019-11-29  9:59 ` [PATCH 7/6] Makefile: Make Makefile depend on generated qga files, too Markus Armbruster
2019-12-03 22:33   ` Eric Blake [this message]
2019-12-04  6:56     ` Markus Armbruster
2019-12-04 12:58       ` Eric Blake
2019-12-04 13:19         ` Markus Armbruster
2019-12-03  9:01 ` [PATCH 0/6] qapi: Module fixes and cleanups Markus Armbruster

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=45cff400-7e88-cefe-560e-7642d2ea1d00@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=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 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).