Quote:
Originally Posted by divyashree
Try to store the full path of bin in the variable BIN like:
|
Er, no. The path must be relative to the project directory (what happens if the Makefile is moved to another directory?)
The problem is that make assumes each line is a separate command. If you want a command to span multiple lines, you need to backslash escape them (except for the last one, of course), like so:
Code:
$(BIN):
if [ ! -d "./$(BIN)" ];then \
mkdir $(BIN); \
fi
Note the semi-colon after the mkdir, this is needed as all the backslashed lines are joined together into one line.