Make install but no default directories?

I want to run make make, so I have everything I need, but I would like it to install things in their own folder, unlike the system / usr / bin, etc., is this possible? even if it refers to tools in / usr / bin, etc.?

+72
gcc linux makefile autotools
Jul 13 '10 at 16:40
source share
5 answers

It depends on the package. If the Makefile is created by GNU autotools ( ./configure ), you can usually set the target location as follows:

 ./configure --prefix=/somewhere/else/than/usr/local 

If the Makefile is not generated by autotools, but distributed with the software, just open it in the editor and change it. The installation destination directory is probably defined somewhere in the variable.

+112
Jul 13 '10 at 16:43
source share

Since I don’t know in which version of automake you can use the DESTDIR environment variable .
See the Makefile to be sure.

For example:

  export DESTDIR="$HOME/Software/LocalInstall" && make -j4 install 
+20
Jul 16 '13 at 14:42
source share

This may depend on what is supported by the module you are trying to compile. If your makefile is generated using autotools, use:

--prefix=<myinstalldir>

at startup. / configure

some packages also allow you to override at startup:

 make prefix=<myinstalldir> 

however, if you are not using. / configure, the only way to find out for sure is to open the makefile and check. It should be one of the first few variables at the top.

+12
Jul 13 '10 at 16:48
source share
 make DESTDIR=./new/customized/path install 

This quick command worked for me to install opecv version 3.2.0 on Ubuntu 16. The DESTDIR path can be either relative or absolute.

Such a redirect can also be useful if the user does not have administrator rights, if the DESTDIR location has the correct access for the user. eg / home //

+3
May 14 '17 at 10:22
source share

try using INSTALL_ROOT.

 make install INSTALL_ROOT=$INSTALL_DIRECTORY 
-3
Nov 30 '15 at 10:16
source share



All Articles