I have to run this cryptic block of code.

git clone https://github.com/OpenICC/xcalib.git
cd xcalib
cmake CMakeLists.txt
sudo make install

The procedure I'm following mentions the uninstall process.

sudo make uninstall 

Why do the make install and uninstall commands lack any file or program name? In my mind they should be done like this.

sudo make install program_name
sudo make uninstall program_name

the same as

sudo apt-get install program_name

sudo make install begs the question "install what?"

  • 3
    For the commands that are executed, see the Makefile in that directory, also see man make. – RalfFriedl Nov 20 '18 at 19:22
  • 2
    You can use make -n ...... to see what will be execured – Romeo Ninov Nov 20 '18 at 19:49
  • @RalfFriedl That's the answer to the question; you might as well write it up and post it as an answer. – G-Man Says 'Reinstate Monica' Nov 20 '18 at 19:50

The commands that are executed by make install (or any invocation of make) are defined in the Makefile (and files included by the Makefile). For simple programs, you can just look for a line install: and see the commands in the lines below. But makefiles can also be quite complicated and scattered across various subdirectories. For details, see the manual for make, or an introduction to make.

As @Romeo Ninov wrote, you can also use the command make -n install so see what commands would be executed. Beware that for larger makefiles this output may not be accurate, and if you haven't built the program yet it will likely show you all the commands to build before showing the commands to install.

  • What happens if there are multiple make files in the directory when you issue this command sudo make install. Not requiring a filename argument seems strange. Maybe I'll issue a pull request if I only knew what that meant. – stackinator Nov 20 '18 at 21:06
  • 1
    The default is called Makefile, with capital M. There are not multiple files in one directory named Makefile. You can pass an alternate make file with -f, again for options see the man page. – RalfFriedl Nov 20 '18 at 22:58

If no file arg ist passed to make , make looks for a file named Makefile in current dir. With the switch -f an alternative file can be passed to make. See man make for more information. By the way: make is one of these such good old Unix tools so try to get familiar with it ...

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.