Skip to content
Snippets Groups Projects
Commit de1da442 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Paolo Bonzini
Browse files

build-sys: add a rule to print a variable

$ 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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20180104160523.22995-4-marcandre.lureau@redhat.com>
Tested-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 42a77f1c
No related branches found
No related tags found
No related merge requests found
...@@ -8,9 +8,12 @@ SRC_PATH=. ...@@ -8,9 +8,12 @@ SRC_PATH=.
UNCHECKED_GOALS := %clean TAGS cscope ctags dist \ UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
html info pdf txt \ html info pdf txt \
help check-help \ help check-help print-% \
docker docker-% vm-test vm-build-% docker docker-% vm-test vm-build-%
print-%:
@echo '$*=$($*)'
# All following code might depend on configuration variables # All following code might depend on configuration variables
ifneq ($(wildcard config-host.mak),) ifneq ($(wildcard config-host.mak),)
# Put the all: rule here so that config-host.mak can contain dependencies. # Put the all: rule here so that config-host.mak can contain dependencies.
......
...@@ -510,3 +510,16 @@ default-configs/$TARGET-NAME file as input. ...@@ -510,3 +510,16 @@ default-configs/$TARGET-NAME file as input.
This is the entrypoint used when make recurses to build a single system 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 or userspace emulator target. It is merely a symlink back to the
Makefile.target in the top level. 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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment