[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/6] Makefile: Make Makefile depend on generated qga files, t
Re: [PATCH 7/6] Makefile: Make Makefile depend on generated qga files, too
Tue, 3 Dec 2019 16:33:15 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
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
Signed-off-by: Markus Armbruster <address@hidden>
Makefile | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
@@ -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
- Re: [PATCH 7/6] Makefile: Make Makefile depend on generated qga files, too,
Eric Blake <=