[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH v2] Makefile: Do not generate files if "config

From: Eric Blake
Subject: Re: [Qemu-trivial] [PATCH v2] Makefile: Do not generate files if "configure" has not been run yet
Date: Thu, 8 Jun 2017 07:21:59 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

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 <address@hidden>
> ---
>  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:


), but looks unusual compared to having a single rule with all the

a: b c

> @@ -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: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]