I'm trying to understand somethings about make command, and even if I've read the manual I still have some doubts about its usage. In particular, if I install a program (consisting in many packages) using the "classic" sequence of command on terminal, that is:
./configure -prefix /usr/bin/my_program (here I refer to a configuration file usually provided with some softwares)
make
sudo make install
what it the inverse operation to unistall that program? It's enough to erase the whole directory choose before? (for example with sudo rm -r /usr/bin/my_program).
Thanks to anyone so kind to explain it to me
Read the makefile for answers.
make
is great, but it's not magical. Themake
application can only do what it's instructed to do (like any application). Those instructions are in the makefile.If there are 'install' instructions in the makefile, then
sudo make install
will work, otherwise it will fail.Similarly,
make
needs 'uninstall' instructions forsudo make uninstall
to work.For ANY Makefile, do a
cat Makefile
and look at the very end of the listing. There you'll find what optionsmake
will understand (for that particular Makefile).Look at the following code snippet... and look for "option:"... and in this example, we can see "all:" and "modules:" and etc... all the way down to "uninstall:"... and even a few more after that.
This typically means (in this case example), following your initial
make
command, andsudo make install
to build and install the code, you can usesudo make uninstall
to remove the installed code.