I have a makefile like this:
setup:
setenv var1 "$(var1)"; \
setenv var2 "$(var2)";
task1: setup
source task1.csh
task2: setup
source task2.csh
I call the makefile using this command:
make var1=value1 var2=value2 task1
I would like environment variables var1
and var2
to be visible in task1.csh
and task2.csh
, but I haven't been able to do so unless I change the makefile to:
task1:
setenv var1 "$(var1)"; \
setenv var2 "$(var2)"; \
source task1.csh
task2:
setenv var1 "$(var1)"; \
setenv var2 "$(var2)"; \
source task2.csh
Why the first method doesn't work and how can I fix it?