I have switched over the reference Gnu tool-chains to
generate dependencies as a side-effect of compilation (in Head, for CDT 3.1).
There are now 4 default dependency calculators to choose from:
1. DefaultGCCDependencyCalculator: This is the old method
used by the reference Gnu tool-chains. If you have used it with your own
tool-chains, you can still use it if you want to. For the record, this
dependency calculator works in the following manner:
1. Gcc is invoked to perform the compilation that
generates the object
file.
2. An "echo" command creates the .d file,
adding the name of the .d
file to the beginning of the newly created .d file.
Note that this
causes problems with some implementations of
"echo" that don't
work exactly the way that we want (e.g., it doesn't
support the -n
switch).
3. Gcc is invoked again with the appropriate additional
command line
options to append its dependency file information to
the .d file
that was created by "echo".
4. Steps 1 - 3 are invoked in the make file. Step 4
occurs after the
make invocation has finished. In step 4, MBS code
post-processes
the .d files to add a dummy dependency for each
header file.
2. DefaultGCCDependencyCalculator3: This works exactly as
DefaultGCCDependencyCalculator does, but it uses the new dependency calculator
interfaces.
3. DefaultGCCDependencyCalculator2: This is the new dependency
calculator used by the reference Gnu tool-chains. It generates dependencies as
a side-effect of compilation by adding -MMD -MF -MP -MT options to the command
line.
4. DefaultGCCDependencyCalculatorPreBuild: This new
dependency calculator ensures that dependency files are regenerated, if
necessary, before the build begins. This is required for languages such as
Fortran where the order of the compilations can change with changes to
dependencies. It could be used with C/C++ but is probably not necessary. It
generates dependency files in a separate, pre-compilation, step.
These are the "reference" dependency calculators.
Other scenarios are probably possible using the new interfaces in the org.eclipse.cdt.managedbuilder.makegen.gnu
package. See bugzilla 109289 for more details.
Regards,
Leo