Hello folks, Is this a bug or a feature?
mkdir foo ln -s foo bar cd bar echo -e 'all:\n\tpwd' >Makefile make I would have expected the output to be …/bar but it actually is …/foo. It appears that GNU make follows the symbolic link in case the current directory is a symbolic link. I could not find this behavior in the documentation, and find it a bit unexpected. I thought that using $(lastword $(subst /, ,$(abspath .))) I would get bar and $(lastword $(subst /, ,$(realpath .))) I would get foo. But because make has already followed the symlink for the current directory, both return foo. Is this behavior documented? And does this behavior make sense? Tested versions of GNU make: 4.3 (Ubuntu) and 4.4.1. Best regards, Christian Hujer