I'm aware that one can
export make variables to other makefiles; however, how does one export them to the environment of
$(shell)? Take the example below:
Code:
export TEST
VARIABLE=$(shell echo $$TEST)
.PHONY: all
all:
#$(VARIABLE)
In this example, I might call
make TEST=test. The goal is for
$TEST to be available to the environment of the shell escape. This is because I need its value in a script which is called. For example:
Code:
VARIABLE=$(shell i-need-TEST.sh)
My current solution is the following:
Code:
VARIABLE=$(shell export TEST="$(TEST)"; i-need-TEST.sh)
but this only works if I know all if the variables needed at that point (as opposed to being able to export variables in
included makefiles.) Is there an easy solution? Thanks.
Kevin Barry