I am baffled why I need to echo $(VAR1)
or ${VAR1}
to get the output "abcd" in this Makefile:
VAR1=abcd
myTarget:
@echo $VAR1
all: myTarget
.PHONY: all
Instead, make will echo $V
(which is the empty string), and then "AR1", which is my output.
I know in bash
, echo $VAR1
works to get "abcd", and my understanding is that the indented part of the code is run in bash
. I'm using GNU Make 3.81.