I am learning how to write Makefile. I found the .VARIABLES variable which holds all the variables valid in Makefile.
I can check the variables' name with command like this:
test:
@echo "${.VARIABLES}" | tr ' ' '\n'
But I don't know how to should the values of them. Can anyone teach me to to do that?
If you are using GNU Make, then you can use a crafty combination of foreach and .VARIABLES like this:
test:
$(foreach var,$(.VARIABLES),$(info $(var) = $($(var))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With