Open joerowell opened 2 years ago
You may want to use $(CURDIR)
instead to avoid shelling out to call pwd
. CURDIR
is GNU make's builtin variable storing the current working directory.
Note: $(shell pwd)
, $(CURDIR)
, $$PWD
may be different from $(PWD)
e.g., if make -C dir
form is used (the former points to dir
while the latter points to its parent).
I recently tried to build KUTrace on a system and ran into a problem where
$PWD
was not defined inside the Makefile. This stopskutrace_mod
from being built properly.It turns out that when using
sudo
only certain parts of the environment are actually passed to the command, and$PWD
is a variable that gets cut out. This is described in some detail here.Since Github can't do diffs over tar files, I've summarised the differences below: I've replaced
with