qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makefile: Do not generate files if "configure" has not been run yet
@ 2017-06-07 19:11 Thomas Huth
  2017-06-07 20:59 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2017-06-07 19:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Paolo Bonzini, qemu-trivial, Peter Maydell

When doing a "make -j10" in the vanilla QEMU source tree (without
running "configure first), the Makefile currently generates two
files already, qemu-version.h and qemu-options.def. This should not
happen, so let's make these targets depend on config-host.mak.
Also the python files can not be executed without $(PYTHON), so
these scripts should depend on config-host.mak, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c830d7a..6786dc2 100644
--- a/Makefile
+++ b/Makefile
@@ -286,7 +286,7 @@ endif
 
 all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
 
-qemu-version.h: FORCE
+qemu-version.h: config-host.mak FORCE
 	$(call quiet-command, \
 		(cd $(SRC_PATH); \
 		printf '#define QEMU_PKGVERSION '; \
@@ -312,6 +312,7 @@ qemu-version.h: FORCE
 
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
+qemu-options.def: config-host.mak
 qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
 
@@ -393,6 +394,8 @@ gen-out-type = $(subst .,-,$(suffix $@))
 
 qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
 
+$(qapi-py): config-host.mak
+
 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] Makefile: Do not generate files if "configure" has not been run yet
  2017-06-07 19:11 [Qemu-devel] [PATCH] Makefile: Do not generate files if "configure" has not been run yet Thomas Huth
@ 2017-06-07 20:59 ` Eric Blake
  2017-06-08  4:31   ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2017-06-07 20:59 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Fam Zheng, Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

On 06/07/2017 02:11 PM, Thomas Huth wrote:
> When doing a "make -j10" in the vanilla QEMU source tree (without
> running "configure first), the Makefile currently generates two

s/"configure/"configure"/

> files already, qemu-version.h and qemu-options.def. This should not
> happen, so let's make these targets depend on config-host.mak.
> Also the python files can not be executed without $(PYTHON), so
> these scripts should depend on config-host.mak, too.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index c830d7a..6786dc2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -286,7 +286,7 @@ endif
>  
>  all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
>  
> -qemu-version.h: FORCE
> +qemu-version.h: config-host.mak FORCE

This one makes sense.

> @@ -393,6 +394,8 @@ gen-out-type = $(subst .,-,$(suffix $@))
>  
>  qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>  
> +$(qapi-py): config-host.mak

But this one is weird. How can a pre-existing file have a dependency?
Remember, $(qapi-py) is not the list of built files, but the list of
files used to build other files.  It seems like you either want
config-host.mak includes in $(qapi-py), or...

> +
>  qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
>  $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)

...that THIS should be the rule that depends on config-host.mak in
addition do depending on $(qapi-py).

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] [PATCH] Makefile: Do not generate files if "configure" has not been run yet
  2017-06-07 20:59 ` Eric Blake
@ 2017-06-08  4:31   ` Thomas Huth
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2017-06-08  4:31 UTC (permalink / raw)
  To: Eric Blake, qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Fam Zheng, Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 2125 bytes --]

On 07.06.2017 22:59, Eric Blake wrote:
> On 06/07/2017 02:11 PM, Thomas Huth wrote:
>> When doing a "make -j10" in the vanilla QEMU source tree (without
>> running "configure first), the Makefile currently generates two
> 
> s/"configure/"configure"/
> 
>> files already, qemu-version.h and qemu-options.def. This should not
>> happen, so let's make these targets depend on config-host.mak.
>> Also the python files can not be executed without $(PYTHON), so
>> these scripts should depend on config-host.mak, too.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  Makefile | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index c830d7a..6786dc2 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -286,7 +286,7 @@ endif
>>  
>>  all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
>>  
>> -qemu-version.h: FORCE
>> +qemu-version.h: config-host.mak FORCE
> 
> This one makes sense.
> 
>> @@ -393,6 +394,8 @@ gen-out-type = $(subst .,-,$(suffix $@))
>>  
>>  qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>>  
>> +$(qapi-py): config-host.mak
> 
> But this one is weird. How can a pre-existing file have a dependency?
> Remember, $(qapi-py) is not the list of built files, but the list of
> files used to build other files.  It seems like you either want
> config-host.mak includes in $(qapi-py), or...
> 
>> +
>>  qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
>>  $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> 
> ...that THIS should be the rule that depends on config-host.mak in
> addition do depending on $(qapi-py).

Yes, it's all those targets that use $(PYTHON) which should depend on
config-host.mak instead. But there are lots of them, and all of them
depend on $(qapi-py) already, so it seemed simpler to make $(qapy-py)
depend on config-host.mak instead of adding that dependency to all those
targets ... but maybe that's too confusing in the long run, so I'll add
it to those targets instead.

 Thomas


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2017-06-08  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 19:11 [Qemu-devel] [PATCH] Makefile: Do not generate files if "configure" has not been run yet Thomas Huth
2017-06-07 20:59 ` Eric Blake
2017-06-08  4:31   ` Thomas Huth

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).