wtr
Full Member level 5
Hello all,
I am aware that makefiles commands run in separate shells. However is it possible to get an exported variables into my next make target?
Where set_env_var.sh does
Where write_variables.sh does
Basically want I'm trying to do is populate the current shell with a set of environment variables, that waterfall from one make target to the next. Such that variables_out2.log has YYYYYYVARIABLE AND XXXXXVARIABLE
Eventually the finally call will be a tcl script which will utilise the ::env(WHATEVER_VARIABLE) for the build of the FPGA.
I am aware that makefiles commands run in separate shells. However is it possible to get an exported variables into my next make target?
Code:
#Makefile
#somefile.mk will set $LOG_DIR & $SCRIPT_DIR
include somefile.mk
test:
export LOG_DIR=$(LOG_DIR); \
. $(SCRIPT_DIR)/set_env_var.sh
test2: test
export LOG_DIR=$(LOG_DIR); \
. $(SCRIPT_DIR)/write_variables.sh
Code:
XXXXXVARIABLE=somevalue
export XXXXXVARIABLE
set > $LOG_DIR/variables_out1.log
Code:
YYYYYYVARIABLE=somevalue
export YYYYYYVARIABLE
set > $LOG_DIR/variables_out2.log
Basically want I'm trying to do is populate the current shell with a set of environment variables, that waterfall from one make target to the next. Such that variables_out2.log has YYYYYYVARIABLE AND XXXXXVARIABLE
Eventually the finally call will be a tcl script which will utilise the ::env(WHATEVER_VARIABLE) for the build of the FPGA.