org.eclipse.cdt.managedbuilder.makegen.gnu
Class DefaultGCCDependencyCalculatorPreBuildCommands

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculatorPreBuildCommands
All Implemented Interfaces:
IManagedDependencyInfo, IManagedDependencyPreBuild

public class DefaultGCCDependencyCalculatorPreBuildCommands
extends java.lang.Object
implements IManagedDependencyPreBuild

This dependency calculator uses the GCC -MM -MF -MP -MT options in order to generate .d files as separate step prior to the source compilations. This dependency calculator uses the class DefaultGCCDependencyCalculatorPreBuildCommands which implements the per-source command information This class is used with DefaultGCCDependencyCalculatorPreBuild.

Since:
3.1

Constructor Summary
DefaultGCCDependencyCalculatorPreBuildCommands(org.eclipse.core.runtime.IPath source, IBuildObject buildContext, ITool tool, org.eclipse.core.runtime.IPath topBuildDirectory)
          Constructor.
DefaultGCCDependencyCalculatorPreBuildCommands(org.eclipse.core.runtime.IPath source, org.eclipse.core.resources.IResource resource, IBuildObject buildContext, ITool tool, org.eclipse.core.runtime.IPath topBuildDirectory)
          Constructor
 
Method Summary
 boolean areCommandsGeneric()
          Returns true if the command lines returned by this interface are not specific to the particular source file, but are only specific to, at most, the configuration and tool.
 IBuildObject getBuildContext()
           
 java.lang.String getBuildStepName()
          Returns the name to be used in the build file to identify the separate build step.
 java.lang.String[] getDependencyCommands()
          Returns the command line(s) to be invoked in the separate dependencies pre-build step.
 org.eclipse.core.runtime.IPath[] getDependencyFiles()
          Returns the list of generated dependency files.
 org.eclipse.core.runtime.IPath getSource()
           
 ITool getTool()
           
 org.eclipse.core.runtime.IPath getTopBuildDirectory()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGCCDependencyCalculatorPreBuildCommands

public DefaultGCCDependencyCalculatorPreBuildCommands(org.eclipse.core.runtime.IPath source,
                                                      org.eclipse.core.resources.IResource resource,
                                                      IBuildObject buildContext,
                                                      ITool tool,
                                                      org.eclipse.core.runtime.IPath topBuildDirectory)
Constructor

Parameters:
source - The source file for which dependencies should be calculated The IPath can be either relative to the project directory, or absolute in the file system.
buildContext - The IConfiguration or IResourceConfiguration that contains the context in which the source file will be built
tool - The tool associated with the source file
topBuildDirectory - The top build directory of the configuration. This is the working directory for the tool. This IPath is relative to the project directory.

DefaultGCCDependencyCalculatorPreBuildCommands

public DefaultGCCDependencyCalculatorPreBuildCommands(org.eclipse.core.runtime.IPath source,
                                                      IBuildObject buildContext,
                                                      ITool tool,
                                                      org.eclipse.core.runtime.IPath topBuildDirectory)
Constructor. This constructor calls DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) with a null resource. The net result of this is that dependency rules will always be explicit and will never use pattern rules, as it is impossible for the calculator to know whether the resource is linked or not.

Parameters:
source - The source file for which dependencies should be calculated The IPath can be either relative to the project directory, or absolute in the file system.
buildContext - The IConfiguration or IResourceConfiguration that contains the context in which the source file will be built
tool - The tool associated with the source file
topBuildDirectory - The top build directory of the configuration. This is the working directory for the tool. This IPath is relative to the project directory.
See Also:
DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
Method Detail

areCommandsGeneric

public boolean areCommandsGeneric()
Description copied from interface: IManagedDependencyPreBuild
Returns true if the command lines returned by this interface are not specific to the particular source file, but are only specific to, at most, the configuration and tool. If the build context is a resource configuration, this method should return false if any of the command lines are different than if the build context were the parent configuration. This can be used by the build file generator in helping to determine if a "pattern" (generic) rule can be used.

Specified by:
areCommandsGeneric in interface IManagedDependencyPreBuild
Returns:
boolean

getBuildStepName

public java.lang.String getBuildStepName()
Description copied from interface: IManagedDependencyPreBuild
Returns the name to be used in the build file to identify the separate build step. Note that this name should be unique to the tool since multiple tools in a tool-chain may be using this method of dependency calculation.

Specified by:
getBuildStepName in interface IManagedDependencyPreBuild
Returns:
String

getDependencyCommands

public java.lang.String[] getDependencyCommands()
Description copied from interface: IManagedDependencyPreBuild
Returns the command line(s) to be invoked in the separate dependencies pre-build step.

Specified by:
getDependencyCommands in interface IManagedDependencyPreBuild
Returns:
String[]

getDependencyFiles

public org.eclipse.core.runtime.IPath[] getDependencyFiles()
Description copied from interface: IManagedDependencyPreBuild
Returns the list of generated dependency files. The paths can be either relative to the top build directory, or absolute in the file system.

Specified by:
getDependencyFiles in interface IManagedDependencyPreBuild
Returns:
IPath[]

getBuildContext

public IBuildObject getBuildContext()
Specified by:
getBuildContext in interface IManagedDependencyInfo

getSource

public org.eclipse.core.runtime.IPath getSource()
Specified by:
getSource in interface IManagedDependencyInfo

getTool

public ITool getTool()
Specified by:
getTool in interface IManagedDependencyInfo

getTopBuildDirectory

public org.eclipse.core.runtime.IPath getTopBuildDirectory()
Specified by:
getTopBuildDirectory in interface IManagedDependencyInfo