qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build-sys: Move the print-variable rule to rules.mak
@ 2020-03-06 17:04 Philippe Mathieu-Daudé
  2020-03-06 18:44 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-06 17:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé,
	Marc-André Lureau

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é <philmd@redhat.com>
---
 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 '$*=$($*)'
-- 
2.21.1



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

end of thread, other threads:[~2020-03-09 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06 17:04 [PATCH] build-sys: Move the print-variable rule to rules.mak Philippe Mathieu-Daudé
2020-03-06 18:44 ` no-reply
2020-03-06 22:03 ` Marc-André Lureau
2020-03-09 11:25 ` Laurent Vivier

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