[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] build-sys: Move the print-variable rule to rules.mak
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] build-sys: Move the print-variable rule to rules.mak |
Date: |
Mon, 9 Mar 2020 12:25:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
Le 06/03/2020 à 18:04, Philippe Mathieu-Daudé a écrit :
> Currently the print-variable rule can only be used in the
> root directory:
>
> $ make print-vhost-user-json-y
> vhost-user-json-y= contrib/vhost-user-gpu/50-qemu-gpu.json
> tools/virtiofsd/50-qemu-virtiofsd.json
>
> $ make -C i386-softmmu print-obj-y
> make: Entering directory 'build/i386-softmmu'
> make: *** No rule to make target 'print-obj-y'. Stop.
> make: Leaving directory 'build/i386-softmmu'
>
> Move it to rules.mak so we can use it from other directories:
>
> $ make -C i386-softmmu print-obj-y
> make: Entering directory 'build/i386-softmmu'
> obj-y=qapi-introspect.o qapi-types-machine-target.o
> qapi-types-misc-target.o qapi-types.o qapi-visit-machine-target.o
> qapi-visit-misc-target.o qapi-visit.o qapi-events-machine-target.o
> qapi-events-misc-target.o qapi-events.o qapi-commands-machine-target.o
> qapi-commands-misc-target.o qapi-commands.o qapi-init-commands.o
> make: Leaving directory 'build/i386-softmmu'
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> Makefile | 3 ---
> rules.mak | 3 +++
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 9d4b224126..fdc5d29bb9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -15,9 +15,6 @@ UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
> help check-help print-% \
> docker docker-% vm-help vm-test vm-build-%
>
> -print-%:
> - @echo '$*=$($*)'
> -
> # All following code might depend on configuration variables
> ifneq ($(wildcard config-host.mak),)
> # Put the all: rule here so that config-host.mak can contain dependencies.
> diff --git a/rules.mak b/rules.mak
> index e39b073d46..694865b63e 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -435,3 +435,6 @@ sentinel = .$(subst $(SPACE),_,$(subst /,_,$1)).sentinel.
> atomic = $(eval $1: $(call sentinel,$1) ; @:) \
> $(call sentinel,$1) : $2 ; @touch $$@ \
> $(foreach t,$1,$(if $(wildcard $t),,$(shell rm -f $(call
> sentinel,$1))))
> +
> +print-%:
> + @echo '$*=$($*)'
>
Applied to my trivial-patches branch.
Thanks,
Laurent