aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-14 21:51:54 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-14 21:52:00 +0800
commit47a357992bbfdef280eadb6efd71bea60b72289e (patch)
treebd8137c30e22e860bd237ad445da6d5610c29a50
parentfd85a3ecaa2fc0b684d6dbd00c803c9b1ca75349 (diff)
downloadfg21sim-47a357992bbfdef280eadb6efd71bea60b72289e.tar.bz2
Makefile: Add one liner to get the value of any variable
Handy liner to help debugging Makefile. Credit: http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c2c0690..deee1fd 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,8 @@ default:
@echo " (build and) install the package to the virtualenv"
@echo " + test"
@echo " run the tests"
+ @echo " + print-<VARIABLE>"
+ @echo " print the value of variable <VARIABLE>"
# Create virtualenv and install/update the dependencies
venv: ${VENV}/bin/activate
@@ -36,3 +38,8 @@ devbuild: venv
# Run the tests
test: devbuild
./${VENV}/bin/python3 setup.py test
+
+
+# One liner to get the value of any makefile variable
+# Credit: http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html
+print-%: ; @echo $*=$($*)