Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store GNU make generated files elsewhere

Tags:

linux

makefile

How can I store GNU make & configure files elsewhere? I have a project I am working on that I get compiled using:

./configure --prefix=/usr && make && su -c 'make install'

The thing is I don't want to pollute the current folder, which is a svn/git/hg/whatever sandbox with files generated by that command. I want to put those files in a separate location. I don't know if it's similar, but when I compile the linux kernel from source, I can specify where to put the ouput by passing the 'O' option to 'make', something like this:

make O=/home/user/linux-output
like image 306
hyperboreean Avatar asked Dec 30 '22 16:12

hyperboreean


1 Answers

The Makefile must support this feature.

I think the autoconf generated makefiles all support the following use:

mkdir ../build
cd ../build
../configure --prefix=/usr
make
make install

(It's certainly recommended for gcc builds).

like image 82
Kristof Provost Avatar answered Jan 07 '23 15:01

Kristof Provost