-
Notifications
You must be signed in to change notification settings - Fork 23
Description
If you are using GNU make you should use CURDIR instead of PWD in Makefile. This should eliminate the need for your PWD ?= pwd_unknown caution.
PWD is not a built-in make variable. It comes from the environment and is usually but not always passed to make as if it was a make variable. From the autoconf special shell variable docs:
Posix 1003.1-2001 requires that cd and pwd must update the PWD environment variable to point to the logical name of the current directory, but traditional shells do not support this. This can cause confusion if one shell instance maintains PWD but a subsidiary and different shell does not know about PWD and executes cd; in this case PWD points to the wrong directory. Use ``pwd
' rather than$PWD'.
CURDIR, OOTH, is:
Set to the absolute pathname of the current working directory (after all -C options are processed, if any).
Reference: