Skip to content

Commit bc7e721

Browse files
committed
Merge #17087: build: Add variable printing target to Makefiles
181989f build: Add variable printing target to Makefiles (Carl Dong) Pull request description: ``` 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 ``` ACKs for top commit: MarcoFalke: ACK 181989f fanquake: ACK 181989f - concise amount of useful code. Tested on macOS. Did not visit the link. Tree-SHA512: 2139621e68a499c7347663ca9dc04e166ea6280e05986c27858df0156016ef2f9461262464d70c601419384f43a4ae3bcc67dfc0a05dbeef64f08386ab429cd8
2 parents 42d0eca + 181989f commit bc7e721

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
# Pattern rule to print variables, e.g. make print-top_srcdir
6+
print-%:
7+
@echo $* = $($*)
8+
59
ACLOCAL_AMFLAGS = -I build-aux/m4
610
SUBDIRS = src
711
if ENABLE_MAN

depends/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.NOTPARALLEL :
22

3+
# Pattern rule to print variables, e.g. make print-top_srcdir
4+
print-%:
5+
@echo $* = $($*)
6+
37
SOURCES_PATH ?= $(BASEDIR)/sources
48
WORK_PATH = $(BASEDIR)/work
59
BASE_CACHE ?= $(BASEDIR)/built

0 commit comments

Comments
 (0)