You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somebody pointed out (sorry, I've forgotten who), that there is a problem in the
instructions for getting the relative directory. What I've suggested is doing this:
./configure --prefix="$(pwd)/../../local"
This works fine in the shell, but what I didn't consider is what happens inside
the makefile.
Inside the makefile, $ means "macro expansion", and $(X) means look
for makefile variable called X. I managed to introduce this bug as a regression in this commit: d43cbb6. The aim was to make things simpler, but I didn't test properly.
Potential solutions are:
Use back-tick syntax
In the shell, the syntax:
`pwd`
is equivalent to
$(pwd)
so you can use:
./configure --prefix="`pwd`/../../local"
in the makefile or on the command line.
Use shell from within the makefile
There is a function called shell in makefiles which will
call a function in the shell. So this:
$(shell pwd)
will work within the makefile. However, it will not work on
the shell. So in the makefile you can use something like:
./configure --prefix="$(shell pwd)/../../local"
Use the abspath function in the makefile
There is also a function called abspath within make, which uses
an internal function (not the shell) to get an absolute path. You
can used this as something like:
$(abspath ../../local)
to get the path of a file. So the makefile command becomes:
./configure --prefix="$(abspath ../../local)"
The text was updated successfully, but these errors were encountered:
Yes, you're right CURDIR works too. In fact it's probably a
better solution than my suggestions when working in the
makefile. I'll note it in the main readme.
Somebody pointed out (sorry, I've forgotten who), that there is a problem in the
instructions for getting the relative directory. What I've suggested is doing this:
This works fine in the shell, but what I didn't consider is what happens inside
the makefile.
Inside the makefile,
$
means "macro expansion", and$(X)
means lookfor makefile variable called X. I managed to introduce this bug as a
regression in this commit: d43cbb6. The aim was to make things simpler, but I didn't test properly.
Potential solutions are:
Use back-tick syntax
In the shell, the syntax:
is equivalent to
so you can use:
in the makefile or on the command line.
Use shell from within the makefile
There is a function called
shell
in makefiles which willcall a function in the shell. So this:
will work within the makefile. However, it will not work on
the shell. So in the makefile you can use something like:
Use the abspath function in the makefile
There is also a function called abspath within make, which uses
an internal function (not the shell) to get an absolute path. You
can used this as something like:
to get the path of a file. So the makefile command becomes:
The text was updated successfully, but these errors were encountered: