build: Add variable printing target to Makefiles

I kept finding myself needing these to debug our build system, since
they are innocuous and are very helpful they probably belong in the
codebase.

Source: John Graham-Cumming
https://www.cmcrossroads.com/article/printing-value-makefile-variable
This commit is contained in:
Carl Dong 2019-10-09 11:12:55 -04:00 committed by Jack Grigg
parent 06d234d774
commit ee10eb77db
2 changed files with 8 additions and 0 deletions

View File

@ -4,6 +4,10 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
# Pattern rule to print variables, e.g. make print-top_srcdir
print-%:
@echo $* = $($*)
ACLOCAL_AMFLAGS = -I build-aux/m4
SUBDIRS = src
if ENABLE_MAN

View File

@ -1,5 +1,9 @@
.NOTPARALLEL :
# Pattern rule to print variables, e.g. make print-top_srcdir
print-%:
@echo $* = $($*)
SOURCES_PATH ?= $(BASEDIR)/sources
BASE_CACHE ?= $(BASEDIR)/built
SDK_PATH ?= $(BASEDIR)/SDKs