From ee10eb77db775c5080826eb8e7dd2621675088c1 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 9 Oct 2019 11:12:55 -0400 Subject: [PATCH] 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 --- Makefile.am | 4 ++++ depends/Makefile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Makefile.am b/Makefile.am index be3baaf41..0cbef9ee5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/depends/Makefile b/depends/Makefile index 1a69d3e66..4abc1151b 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -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