In my makefile, I would like to call a shell script through .PHONY statement. In my shell script i am exporting a variable and expecting it to be exported in the current shell instances. Make target runs fine but the variable does not reflect in the current shell.
Makefile
$ cat Makefile
.PHONY: configure-mytest-path
configure-mytest-path:
. ./scripts/test.sh
Shell script which i am using through the make target
$ cat scripts/test.sh
#!/bin/bash
set -x
export MYTESTPATH=/Users/myname/go/mytestpath
Checking the variable value
$ echo $MYTESTPATH
Running the target
$ make configure-mytest-path
. ./scripts/test.sh
++ export MYTESTPATH=/Users/myname/go/mytestpath
++ MYTESTPATH=/Users/myname/go/mytestpath
Checking the variable value.
$ echo $MYTESTPATH
I am expecting echo $MYTESTPATH
should print /Users/myname/go/mytestpath
but it prints blank. Did i miss anything ? or this is not the way of exporting variable to the current shell instance ?
Thanks for understanding