Find the answer to your Linux question:
Results 1 to 7 of 7
Hello guys, I am new to linux. I am trying to reinstall a linux program, I used "make clean". But when I tried this command "make clean all", it was ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Location
    Canada
    Posts
    10

    [SOLVED] make clean vs. make clean al. Any difference?


    Hello guys,

    I am new to linux. I am trying to reinstall a linux program, I used "make clean". But when I tried this command "make clean all", it was also excuting but with different output though. Could anyone please explain the difference between these two commands? So I can sure of a way out when I reinstall my files.

    Maybe obvious to everyone else, please excuse my dumbness.

    Thank you

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    In the top level directory of your source code there is
    a file called makefile. It will define what is done
    when you issue those commands. There is no standard
    definition. It is what the programmer decided to do.
    Normally "make clean" deletes any files generated
    by previous attempts, leaving you with clean source code.
    I haven't heard of "make clean all".

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Location
    Canada
    Posts
    10
    Quote Originally Posted by rcgreen View Post
    In the top level directory of your source code there is
    a file called makefile. It will define what is done
    when you issue those commands. There is no standard
    definition. It is what the programmer decided to do.
    Normally "make clean" deletes any files generated
    by previous attempts, leaving you with clean source code.
    I haven't heard of "make clean all".
    Thanks, that helps~ Too many questions were confusing me. Now it feels a little better to me.

    But still a question here.

    I checked the makefile and some other makefiles in other programs as well. Some of them defined "make cleanall" and I didnt see any "make clean all" defined there. However, "make clean all" can be excuted. I checked the output in the terminal. It looked like the output for "make". So I am guessing maybe when I typed "make clean all", the "clean all" was ignored by the make command.
    Any idea about this is much appreciated.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,558
    make [target]*

    Basically, the targets you specify to make are built in order found on the command line. The 'clean' target usually is to clean up any artifacts that have been generated as a result of other make targets. Ie, it will generally delete objects, temporary libraries and other files that the build generates. The 'all' target generally is to build everything except 'install'. So, the command "make clean" will usually clean up the build tree, "make all" will build everything that hasn't already been built, and "make clean all" will remove all temporary artifacts so that the 'all' target will rebuild everything. So, executing "make clean" and then "make all" is effectively the same as executing "make clean all". Clearer? Finally, you will usually execute "make install" to install the application in the system, though generally you would do it as "sudo make install" so it will be installed as the root user (system administrator), otherwise you are likely to get permissions errors. This assumes of course that you have sudoer permissions.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Feb 2011
    Location
    Canada
    Posts
    10
    Quote Originally Posted by Rubberman View Post
    make [target]*

    Basically, the targets you specify to make are built in order found on the command line. The 'clean' target usually is to clean up any artifacts that have been generated as a result of other make targets. Ie, it will generally delete objects, temporary libraries and other files that the build generates. The 'all' target generally is to build everything except 'install'. So, the command "make clean" will usually clean up the build tree, "make all" will build everything that hasn't already been built, and "make clean all" will remove all temporary artifacts so that the 'all' target will rebuild everything. So, executing "make clean" and then "make all" is effectively the same as executing "make clean all". Clearer? Finally, you will usually execute "make install" to install the application in the system, though generally you would do it as "sudo make install" so it will be installed as the root user (system administrator), otherwise you are likely to get permissions errors. This assumes of course that you have sudoer permissions.
    Thanks a lot Rubberman~ Super useful information and it's totally clear to me now~ Feels good to solve these silly questions so that they won't mess up my mind. haha,

    Thanks again

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,558
    You wouldn't be here if you didn't want to mess with your mind...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Feb 2011
    Location
    Canada
    Posts
    10

    Talking

    Quote Originally Posted by Rubberman View Post
    You wouldn't be here if you didn't want to mess with your mind...
    I think you are right~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •