somevar := apple
export somevar
update := $(shell echo \"v=$$somevar\")
all:
@echo $(update)
I was hoping to apple as output of command, however i
Running the makefile
foo:=apple
export foo
all:
@echo ">"$(shell echo "$$foo")
@echo ">""$$foo"
gives for me (with foo undefined in the environment)
$ make
>
>apple
$ make foo=bar
>
>apple
$ export foo=bar; make
>bar
>apple
$ export foo=bar; make foo=bar
>bar
>bar
Try using the quoted form (update := "v=$$somevar"
) and let the shell handle expansion when a command is run (you'll still need the export)