To install to a custom directory, use this:
./configure --prefix=/desired/path
make
sudo make install
By default, programs installed without the added prefix will be located in /usr/local/bin
. To verify this, you can type which program_name
after installation.
If you install your program in a custom directory, it will be installed in /desired/path/bin
. You will then need to make sure that the directory is included in your PATH
environment variable. If it is not, which program_name
will not work, nor will you be able to start the program without including the path or being in the same directory.
To do that, you can add the following line to your ~/.profile
:
export PATH=$PATH:/desired/path/bin
Once the change is made, you can type source ~/.profile
to update the variable, or log into a new shell for the change to take effect.