Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: AlexPaes on March 23, 2006, 09:22:28 pm

Title: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: AlexPaes on March 23, 2006, 09:22:28 pm
Hi everyone,

Here's the issue, i just created a small script that generates a VERSION.H file to be included in my project in order to get up-to-date versioning inside the project. Now i managed to get this script running ok by adding it in the pre-build steps section. Now my problem is that some files that include this VERSION.H don't get recompiled when the .H file changes since the .o file is already on the system. Is there any way i can force a dependency so that when building a given.o file that includes VERSION.H it will actually check the creation dates and rebuild given.o if VERSION.H is more recent?

Btw, i'm running codeblocks 1.0rc2 on linux with gcc 4.0.2.

Thanks to all for your time and help in advance.
Title: Re: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: mandrav on March 23, 2006, 09:33:32 pm
Quote
Is there any way i can force a dependency so that when building a given.o file that includes VERSION.H it will actually check the creation dates and rebuild given.o if VERSION.H is more recent?

Yes, there is.

Quote
i'm running codeblocks 1.0rc2 on linux with gcc 4.0.2

Try a recent version directly from SVN (or a nightly build).
Title: Re: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: AlexPaes on March 23, 2006, 09:35:35 pm
hi mandrav, thanks for your post.

To tell you the truth i'm still using 1.0rc2 because i believe i've read somewhere that the export Makefile option was removed(?!?). Can you please inform me if that's the case? The export Makefile makes all the sense to me... spares me a ton of time.

Cheers
Title: Re: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: Zlika on March 23, 2006, 10:00:32 pm
This menu is grayed in the recent versions. Why?
Title: Re: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: thomas on March 23, 2006, 10:09:36 pm
Export makefile is not working and it will probably not be working until the compiler redesign is finished.
Since it does not work, the UI control for it is greyed out (saves a lot of complaints).
Title: Re: Forcing re-compiling of a .cpp file upon changes to a .h file
Post by: AlexPaes on March 23, 2006, 10:15:51 pm
 :(

Well so it seems my main question is still pending. In the 1.0RC2 version isn't there somekind of way to force dependency on a header file? Apparently there is a way in more recent svn versions but i can't afford to loose export Makefile as i'm using that to deploy my stuff  :(

Any help is much appreciated  :)