From: Eric Blake <eblake@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: Fam Zheng <famz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,
qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2] Makefile: Do not generate files if "configure" has not been run yet
Date: Thu, 8 Jun 2017 07:21:59 -0500 [thread overview]
Message-ID: <1e50d054-a342-39c1-db69-3b7adf162b79@redhat.com> (raw)
In-Reply-To: <1496907604-2393-1-git-send-email-thuth@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2412 bytes --]
On 06/08/2017 02:40 AM, Thomas Huth wrote:
> 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 targets that use python can not be executed without the
> $(PYTHON) from config-host.mak, so these should depend on the config-
> host.mak file, too (these targets generate some ugly error messages
> otherwise during "make -j10").
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2:
> - Add the dependency to the targets that use $(PYTHON) instead of
> adding it to $(qapi-py)
>
> @@ -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","$@")
This works (namely, splitting the dependencies between a no-op rule and
the real rule:
a:b
a:c
recipe
), but looks unusual compared to having a single rule with all the
dependencies:
a: b c
recipe
> @@ -394,17 +395,17 @@ gen-out-type = $(subst .,-,$(suffix $@))
> qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
>
> 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)
> +$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) config-host.mak
> $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
Long line. Let's use \ line-splitting to keep things under 80 columns
(if Fam's suggestion of adding the dependency just once doesn't pan out).
> $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
> "GEN","$@")
> qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
> -$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> +$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) config-host.mak
More long lines ahead.
--
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 --]
prev parent reply other threads:[~2017-06-08 12:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 7:40 [Qemu-devel] [PATCH v2] Makefile: Do not generate files if "configure" has not been run yet Thomas Huth
2017-06-08 11:16 ` Fam Zheng
2017-06-08 12:43 ` Thomas Huth
2017-06-08 12:21 ` Eric Blake [this message]
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=1e50d054-a342-39c1-db69-3b7adf162b79@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
/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).