Is it possible to change prefix after make?

We all know that

$./configure --prefix=$SOME_DIR
$ make
$ sudo make install

can install bin, lib to $SOME_DIR. However, I wonder whether I can change the prefix of installation directory after running configure and make, without the need to run make again?

1 Answer

When you run configure script, the Makefile is generated, which can help you to compile your source code, which is usually done by invoking make, and provide you with a command to install it, which is usually done by invoking make install.

You can always manually change the makefiles by hand, and change the prefix. Sometimes it is easy, when you have a simple project. You can simply change the prefix variable in the single generated makefile and that should work. But this is not always the case. So, unless you know what's happening under the hood, I suggest you to reconfigure and recompile and avoid unnecessary headaches.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like