Hi all. I know thatis run from inside the directory which contains the makefile. Is it possible to run make install on this directory from outside of it?Code:make install
Hi all. I know thatis run from inside the directory which contains the makefile. Is it possible to run make install on this directory from outside of it?Code:make install
Last edited by Alex_Baggott; April 8th, 2015 at 06:06 PM.
Why?
You could use the -C flag, I think
i.e.Code:-C dir, --directory=dir Change to directory dir before reading the makefiles or doing any‐ thing else. If multiple -C options are specified, each is inter‐ preted relative to the previous one: -C / -C etc is equivalent to -C /etc. This is typically used with recursive invocations of make.
e.g.Code:make -C path/to/dir/containing/makefile install
Code:$ make -C forums/src/ hello make: Entering directory `/home/steeldriver/Documents/forums/src' g++ -Wall -g -o hello hello.cpp
Thanks. That worked beautifully.
For any others wondering about this, it also works with "make install", i.e.:
Code:make install -C <directory_name>
Bookmarks