Author Topic: Forcing re-compiling of a .cpp file upon changes to a .h file  (Read 6297 times)

AlexPaes

  • Guest
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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Forcing re-compiling of a .cpp file upon changes to a .h file
« Reply #1 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).
Be patient!
This bug will be fixed soon...

AlexPaes

  • Guest
Re: Forcing re-compiling of a .cpp file upon changes to a .h file
« Reply #2 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

Zlika

  • Guest
Re: Forcing re-compiling of a .cpp file upon changes to a .h file
« Reply #3 on: March 23, 2006, 10:00:32 pm »
This menu is grayed in the recent versions. Why?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Forcing re-compiling of a .cpp file upon changes to a .h file
« Reply #4 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).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

AlexPaes

  • Guest
Re: Forcing re-compiling of a .cpp file upon changes to a .h file
« Reply #5 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  :)