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 committed 2019-10-09 11:12:55 -04:00
1 parent 1c11e53bb6
commit 181989f6c9
2 files changed
+8

No files matched your search

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