I have an Eclipse project that I need to auto-generate some files before compiling it. I do not want to put this auto-generated files in my repository, so each time I compile the projetct I perform a pre-build to auto-generate this files.
The problem is that this auto-generated files are *.c and *.h files, and in the first time I compile the project, the following happens (in this order):
If I compile again, this files will be compiled. Maybe this is happening because of the discovery process of what files eclipse will compile. Before initing compilation, we do not have this auto-generated *.c and *.h files.
In the second time we compile, we already have this auto-generated files, so this files are compiled.
If you want full control over when exactly the custom build step takes place, which files need to be refreshed after it, the environment, the working directory etc.. do not specify it as a simple pre-build step. Go to the project properties -> Builders -> New... and choose "Program".
In the resulting dialog, you have much more control over the execution of your tool. For instance, you can make your tool run whenever the XML file is saved, and you can tell eclipse to refresh all the auto-generated files whenever it is run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With