User forums > Using Code::Blocks

Timing (?) problem in CodeBlocks with gfortran modules

<< < (2/2)

gd_on:
And what about .mod files not deleted when Cleaning or Rebuild a project ?
Is there a workaround ?

gd_on

MortenMacFly:

--- Quote from: gd_on on June 04, 2010, 03:37:03 pm ---Is there a workaround ?

--- End quote ---
What about a simply post-build step (using macros)?!

gd_on:
Do you mean : deleting .mod files at the end of the gfortran build process ?
Normally, they are only useful at compile time if I understand well. So, if you don't modify your gfortran source project, they are not used any more and if you modify it, they need to be rebuilt. Why not... But I have to add this manually. The best place to do that should be in global compiler settings, but this possibility is only present on each project build options. So for complex multi project it needs a lot of modifications. It could be nice if CodeBlocks could do that automatically, and may be in the cleaning phase.

gd_on

PS : Finally, not a solution. If you delete .mod files at the end of a gfortran build, you can need them for  a future compilation. For example, in my test case, .mod files are build from mod_bb.f and mod_cc.f. If I modify the main code aa.f, I need bb.mod and cc.mod. So the only solution is that the cleaning process should delete them. I don't know if it's possible to add a pre/post build step there.

MortenMacFly:

--- Quote from: gd_on on June 04, 2010, 06:38:41 pm ---I don't know if it's possible to add a pre/post build step there.

--- End quote ---
Notice that you can also setup a "commands only" target for such purposes. It does what it's name applies: Compile nothing, just run commands - like delete files in your case.

In addition you can add it to a virtual target or just run this very target if needed. This should solve your problem - it's very flexible to use...

gd_on:
I'll have a look to this last solution, but only in a few days (other urgent things to do before  :()

gd_on

Navigation

[0] Message Index

[*] Previous page

Go to full version