I have a Makefile with the following:
AVAR=""
all :
if [ -d ../old ]; then \
(echo "$@ Ping!"; AVAR="../old"; echo $(AVAR)) \
fi
@echo $(AVAR)
The idea is that depending on the presence of directory “../old” i will or not
have information in AVAR (available for use later), however, the if is evaluating to true, and the Ping! is echoed, but nothing is assigned to AVAR, either inside or outside the if statement.
Output is as follows:
$ make all
if [ -d ../old ]; then \
(echo "all Ping!"; AVAR="../old"; echo "") \
fi
all Ping!
Any Insight appreciated.
Problem solved, Did the very bad recursive make option to redefine stuff and reinterpret.