I declared a variable in the make file like this-
var_COVERAGE_FLAGS?=
I assigned a value to the variable in a target called coverage
coverage:var_COVERAGE_FLAGS = -MDevel::Cover=-silent,on,+select,/home/scratch.ataur_gpu/run_steps/client/dev1/dev/inf/run/mainline/lib,+ignore,^\\w+
coverage:var_COVERAGE_POST=2>&1 | grep -v "Can't";
coverage:var_COVERAGE_PRE = @echo "Running coverage for $@";
coverage:clean_coverage
$(call run_with_perl,$*) $(var_COVERAGE_FLAGS) $(var_COVERAGE_TEST_NAMES) $(var_COVERAGE_POST)
@echo "$*"
@echo "$(var_COVERAGE_FLAGS)"
@echo "====================="
$(exec_COVER)
I defined
define run_with_perl
$(PERL_RUNNER) $1 $(TEST_ARGS)
endef
and the Variable PERL_RUNNER is defined as below
PERL_RUNNER := $(exec_PERL) $(PERL_ARGS) $(env_PERLINCLUDE) $(var_COVERAGE_FLAGS)
and the rest of the variable are defined properly
The issue is whenever I am calling run_with_perl
the value of $(var_COVERAGE_FLAGS)
is reset to null or you can say that is Target Specific Variable.
So how do I Make it a Global Variable??