"make install" - change output assignment for all builds

I have been developing Linux on multiple machines, mainly Slackware 13.37 and Ubuntu 12.04. I test and verify the results of several simple makefiles and want to confirm the output make install. However, before I check this, I want to know if there is a portable tool for changing the default output destination make installfor any makefile.

I would prefer that I can somehow execute my output, so that all the output goes, for example:

/test/bin
/test/lib
/test/usr/bin

instead:

/bin
/lib
/usr/bin

I know that in QNX development environments, for example, I can set environment variables, such as QCONF_OVERRIDEand INSTALL_ROOT_nto, and guarantee that the make file cannot, for example, install anywhere other than a subdirectory /test. Is there a similar mechanism for GCC on Ubuntu that just requires setting some environment variables in my file ~/.bashrc? I work all the time on the command line and VIM, so I don’t worry about the case when the IDE does not understand these environment variables because they are not in .kderc, .gnomercor the equivalent.

Thanks.

+4
source share
3 answers

Short answer: no

Long answer:

Makefile; Makefile - , . make - , . , , Makefile. , , .

: , , QNX ( -), , make ( , GNU make, ) : , , (Linux, MS Windows, Mac OS X, FreeBSD ..), (x86, arm, mips, power, sparc, sh ..). , . , .

, , GNU, ./configure --prefix=/test. , Autotools. GNU Autotools , :

  • ? , , (,/usr/local), make install DESTDIR=/test.
  • , ? ./configure --help, , ( --with-foo=/prefix/of/foo)

, , , , .

, , Autotools. (, ), , , Makefile. , ??

P.S. , , make, .. SPAM="alot" make target make target SPAM="alot" β€” makefile. . GNU make docs .

+5

make

prefix=/test

 make install

make prefix=/test install

http://www.gnu.org/prep/standards/html_node/Directory-Variables.html

+2

, GNU ( autotools)

./configure --prefix=/test

( --prefix configure )

make prefix=/test install

, , .

make install DESTDIR=/tmp/dest, /tmp/dest /test,

, /usr/local/bin/emacs /usr/local/share/emacs/24.3.50/lisp ( strings /usr/local/bin/emacs), /usr/local/ configure -d.

, chroot - , .

+2
source

Source: https://habr.com/ru/post/1526664/


All Articles