Anyway to tell if a compile was succesful in the past?
Hi folks,
I wonder if its possible to tell if a compile already has been done? Assumming you have a shell script where you get various sources and build them. While getting the script to behave nice you always start it over and over again and it compiles over and over again. Is gcc able to shorten this process? Or would I have to query for any specific file to tell that the program is already compiled? |
Do you mean 'man ccache' or something else?
|
Quote:
I can't tell from your description above if you are trying to debug a problem compiling your source code, or debug a problem in your makefile dependencies. If you've got a buggy makefile, you could have all kinds of failures - things could re-compile needlessly, things that still need to be compiled might be missed, etc. You have to set up your dependencies correctly in the makefile. |
ccache could help to some point, thanks unspawn.
@haertig its not problem with the make file or the build not finishing. Let me explain a bit better what I'm hunting after. Code:
#/bin/bash |
Hmm, my choice would be to not have all that stuff in one script. Downloading source is one thing, compiling it is another, and executing the results is a third - I don't put all those seperate operations into one script myself. But you obviously know what you're doing and have a reason for it.
make will not normally re-compile stuff that doesn't need re-compiling (given that you have a well written makefile). However, you are re-downloading and re-un'tarring your source each time, so make sees that as newly updated source and thus recompiles it. Even if you can control source file timestamps so that make doesn't re-compile, you will still be wasting a lot of time re-downloading and re-un'tarring. What I would do is remove the downloading, un'tarring and make'ing from your script. Use the script only to execute the result. And then put all the other operations into a seperate script that is invoked via cron at some "who cares?" time in the middle of the night. You could improve that cron-initiated script to only re-download when a new version of the source is available, or you could just leave it inefficiently doing things over and over again in the middle of the night (when nobody really cares anyway). |
Quote:
Quote:
Quote:
|
Quote:
|
Thanks for clarfying. So I found the bad guy. AS I hope this to be the last test run of the script with my changes I can start taking it apart and put some markers on individual steps so they can be skipped if allready done.
Thanks for your help haertig. |
All times are GMT -5. The time now is 10:49 AM. |