Make install, but not to default directories?

后端 未结 7 1916
迷失自我
迷失自我 2020-11-30 16:41

I want to run \'make install\' so I have everything I need, but I\'d like it to install the things in their own folder as opposed to the system\'s /usr/bin etc. is that poss

相关标签:
7条回答
  • 2020-11-30 17:18

    I tried the above solutions. None worked.

    In the end I opened Makefile file and manually changed prefix path to desired installation path like below.

    PREFIX ?= "installation path"
    

    When I tried --prefix, "make" complained that there is not such command input. However, perhaps some packages accepts --prefix which is of course a cleaner solution.

    0 讨论(0)
  • 2020-11-30 17:21

    If the package provides a Makefile.PL - one can use:

    perl Makefile.PL PREFIX=/home/my/local/lib LIB=/home/my/local/lib
    make
    make test
    make install
    

    * further explanation: https://www.perlmonks.org/?node_id=564720

    0 讨论(0)
  • 2020-11-30 17:29

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

    For example:

     export DESTDIR="$HOME/Software/LocalInstall" && make -j4 install
    
    0 讨论(0)
  • 2020-11-30 17:33

    try using INSTALL_ROOT.

    make install INSTALL_ROOT=$INSTALL_DIRECTORY
    
    0 讨论(0)
  • 2020-11-30 17:37

    It depends on the package. If the Makefile is generated by GNU autotools (./configure) you can usually set the target location like so:

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

    If the Makefile is not generated by autotools, but distributed along with the software, simply open it up in an editor and change it. The install target directory is probably defined in a variable somewhere.

    0 讨论(0)
  • 2020-11-30 17:39
    make DESTDIR=./new/customized/path install
    

    This quick command worked for me for opencv release 3.2.0 installation on Ubuntu 16. DESTDIR path can be relative as well as absolute.

    Such redirection can also be useful in case user does not have admin privileges as long as DESTDIR location has right access for the user. e.g /home//

    0 讨论(0)
提交回复
热议问题