[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/51] build-sys: add a rule to print a variable
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 11/51] build-sys: add a rule to print a variable |
Date: |
Tue, 16 Jan 2018 15:16:53 +0100 |
From: Marc-André Lureau <address@hidden>
$ make print-CFLAGS
CFLAGS=-fsanitize=address -Og -g
Trick from various sources:
https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
https://www.cmcrossroads.com/article/printing-value-makefile-variable
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
Makefile | 5 ++++-
docs/devel/build-system.txt | 13 +++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1671db3..f26ef1b 100644
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,12 @@ SRC_PATH=.
UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
html info pdf txt \
- help check-help \
+ help check-help print-% \
docker docker-% 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/docs/devel/build-system.txt b/docs/devel/build-system.txt
index 386ef36..52501f2 100644
--- a/docs/devel/build-system.txt
+++ b/docs/devel/build-system.txt
@@ -510,3 +510,16 @@ default-configs/$TARGET-NAME file as input.
This is the entrypoint used when make recurses to build a single system
or userspace emulator target. It is merely a symlink back to the
Makefile.target in the top level.
+
+
+Useful make targets
+===================
+
+- help
+
+ Print a help message for the most common build targets.
+
+- print-VAR
+
+ Print the value of the variable VAR. Useful for debugging the build
+ system.
--
1.8.3.1
- [Qemu-devel] [PULL v4 00/51] Misc patches for 2018-01-12, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 03/51] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 01/51] scsi-generic: Add share-rw option, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 02/51] scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 04/51] hpet: recover timer offset correctly, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 10/51] build-sys: silence make by default or V=0, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 06/51] chardev: use backend chr context when watch for fe, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 11/51] build-sys: add a rule to print a variable,
Paolo Bonzini <=
- [Qemu-devel] [PULL 05/51] i386/cpu/kvm: look at PMU's CPUID before setting MSRs, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 07/51] chardev: let g_idle_add() be with chardev gcontext, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 08/51] chardev: introduce qemu_chr_timeout_add_ms(), Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 12/51] build-sys: compile with -Og or -O1 when --enable-debug, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 14/51] tests/docker: add test-debug, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 09/51] build-sys: fix qemu-ga -pthread linking, Paolo Bonzini, 2018/01/16