*
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator #generateDependencies()
*/
@Override
public void generateDependencies() throws CoreException {
final PathSettingsContainer postProcs = PathSettingsContainer.createRootContainer();
// Note: PopulateDummyTargets is a hack for the pre-3.x GCC compilers
// Collect the methods that will need to be called
toolInfos.accept(new IPathSettingsContainerVisitor() {
@SuppressWarnings("synthetic-access")
@Override
public boolean visit(PathSettingsContainer container) {
ToolInfoHolder h = (ToolInfoHolder) container.getValue();
Vector<String> depExts = new Vector<String>(); // Vector of
// dependency
// file
// extensions
IManagedDependencyGenerator2[] postProcessors = new IManagedDependencyGenerator2[h.buildTools.length];
boolean callPopulateDummyTargets = collectDependencyGeneratorInformation(h, depExts, postProcessors);
// Is there anyone to call if we do find dependency files?
if (!callPopulateDummyTargets) {
int i;
for (i = 0; i < postProcessors.length; i++) {
if (postProcessors[i] != null)
break;
}
if (i == postProcessors.length)
return true;
}
PathSettingsContainer child = postProcs.getChildContainer(container.getPath(), true, true);
DepInfo di = new DepInfo();
di.depExts = depExts;
di.postProcessors = postProcessors;
di.callPopulateDummyTargets = callPopulateDummyTargets;
child.setValue(di);
return true;
}
});
IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
for (IResource res : getSubdirList()) {
// The builder creates a subdir with same name as source in the
// build location
IContainer subDir = (IContainer) res;
IPath projectRelativePath = subDir.getProjectRelativePath();
IResourceInfo rcInfo = config.getResourceInfo(projectRelativePath, false);
PathSettingsContainer cr = postProcs.getChildContainer(rcInfo.getPath(), false, true);
if (cr == null || cr.getValue() == null)
continue;
DepInfo di = (DepInfo) cr.getValue();
ToolInfoHolder h = getToolInfo(projectRelativePath);
IPath buildRelativePath = topBuildDir.append(projectRelativePath);
IFolder buildFolder = root.getFolder(buildRelativePath);
if (buildFolder == null)