I am writing a multiple-filed program right now, and apparently running only 'make' (as one would intuitively think needs to be done in most situations) for some reason causes my program to fail. I guess I can provide more detail of the problem, but the important thing is that it does run when using 'make clean'. So I was wondering if anyone knew the general rule of thumb for running 'make clean' instead of just 'make'
|
You run make clean in two situations - when you want to package up the source code (and therefore don't need/want the built objects) OR when you have some reason to believe that the built objects are bad. In your case, you're using 'make clean' to fix a problem that is likely the result of a buggy Makefile. Something in there is not re-compiling when it should, and that's causing the output binary to be bad. There are many reasons that could happen, depending on the complexity of your project, and how you've used make, but the gist of it is: you need to spend some time debugging your Makefile. |
|||||||||||||||
|
|
I agree with Michael Kohne's answer in general. I would add you need to read the installation docs to know what "make clean" actually does. There can be different levels of clean that you might need to use, such as "make realclean" and "make distclean." There are informal conventions for these, but nothing carved in stone. |
|||||
|
|
I understand that this is your project, so it's your |
|||||
|
|
I would run "make clean" before a nightly build. In that case the additional time it takes to do a full build probably won't matter much, but the additional safety you will get from making sure everything is in the right version is probably worth it. |
|||
|
|
