This PR is a continuation of bitcoin/bitcoin#17087.
Our depends builds system uses a bunch of variables which values consist of some lines, i.e., multi-line variables.
During debugging it is annoying that print-% is unable to handle such variables:
$ cd depends
$ make print-sqlite_set_vars
/bin/sh: 1: Syntax error: Unterminated quoted string
make: *** [Makefile:5: print-sqlite_set_vars] Error 2
This PR adds show-% target which prints multi-line variable value and its origin and flavor as well:
$ cd depends
$ make show-sqlite_set_vars
- name: sqlite_set_vars
- origin: file
- flavor: simple
- value, printed from the new line:
sqlite_config_opts=--disable-shared --disable-readline --disable-dynamic-extensions --enable-option-checking
sqlite_config_opts_linux=--with-pic
sqlite_config_opts_freebsd=--with-pic
sqlite_config_opts_netbsd=--with-pic
sqlite_config_opts_openbsd=--with-pic
For connoisseurs suggesting make show-qt_set_vars :)
Other useful examples of usage:
$ make show-CC
- name: CC
- origin: default
- flavor: recursive
- value, printed from the new line:
cc
$ make show-CC CC=clang
- name: CC
- origin: command line
- flavor: recursive
- value, printed from the new line:
clang
$ CC=clang make show-CC
- name: CC
- origin: environment
- flavor: recursive
- value, printed from the new line:
clang
$ make show-host
- name: host
- origin: file
- flavor: simple
- value, printed from the new line:
x86_64-pc-linux-gnu
Please note that it is unwanted to just modify the print-% rule as it is used in scripts.