mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
crecoskie Oct 14, 2005
- Adding macro support to buildDefinitions markup. See Bugzilla 111203
This commit is contained in:
parent
8c41743dc7
commit
de026bcfe6
9 changed files with 384 additions and 5 deletions
|
@ -4143,6 +4143,77 @@
|
|||
</toolChain>
|
||||
</configuration>
|
||||
</projectType>
|
||||
<projectType
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportProjectType"
|
||||
isAbstract="false"
|
||||
isTest="true"
|
||||
name="Build Definitions Macro Support Project Type">
|
||||
<configuration
|
||||
artifactExtension="tar"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportConfiguration"
|
||||
name="Default">
|
||||
<toolChain
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportToolchain"
|
||||
isAbstract="false"
|
||||
name="Build Definition Macro Support Toolchain"
|
||||
targetTool="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBarTool">
|
||||
<builder
|
||||
arguments="-k"
|
||||
buildfileGenerator="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator"
|
||||
command="make"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBuilder"
|
||||
isAbstract="false"
|
||||
name="GNU Make"
|
||||
superClass="cdt.managedbuild.target.gnu.builder"/>
|
||||
<tool
|
||||
command="cp"
|
||||
commandLinePattern="${command} ${inputs} ${output}"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportFooTool"
|
||||
isAbstract="false"
|
||||
name="Foo Tool"
|
||||
natureFilter="both">
|
||||
<inputType
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportFooInputType"
|
||||
multipleOfType="false"
|
||||
name="Foo Files"
|
||||
primaryInput="true"
|
||||
sources="foo"/>
|
||||
<outputType
|
||||
buildVariable="BAR_FILES"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBarOutputType"
|
||||
multipleOfType="false"
|
||||
name="Bar Files"
|
||||
outputPrefix="this_is_a_test_prefix_with_a_macro_for_the_project_name_between_here_${ProjName}_and_here"
|
||||
outputs="bar"
|
||||
primaryInputType="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportFooInputType"
|
||||
primaryOutput="true"/>
|
||||
</tool>
|
||||
<tool
|
||||
command="tar"
|
||||
commandLinePattern="${command} cvf ${OutputFileRelPath} ${inputs}"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBarTool"
|
||||
isAbstract="false"
|
||||
name="Bar Tool"
|
||||
natureFilter="both">
|
||||
<inputType
|
||||
buildVariable="BAR_FILES"
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBarInputType"
|
||||
multipleOfType="true"
|
||||
name="Bar Files"
|
||||
primaryInput="true"
|
||||
sources="bar"/>
|
||||
<outputType
|
||||
id="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportTarOutputType"
|
||||
multipleOfType="false"
|
||||
name="Tar File"
|
||||
outputPrefix=" "
|
||||
outputs="tar"
|
||||
primaryInputType="org.eclipse.cdt.managedbuilder.core.tests.BDMacroSupportBarInputType"
|
||||
primaryOutput="true"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</configuration>
|
||||
</projectType>
|
||||
|
||||
</extension>
|
||||
|
||||
|
|
Binary file not shown.
|
@ -79,6 +79,7 @@ public class ManagedProject30MakefileTests extends TestCase {
|
|||
suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest1"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest2"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("TestATO"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("testMacroSupportInBuildDefinitions"));
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
@ -584,4 +585,16 @@ public class ManagedProject30MakefileTests extends TestCase {
|
|||
IProject[] projects = createProjects("TestATO", null, null, true);
|
||||
buildProjects(projects, makefiles);
|
||||
}
|
||||
|
||||
public void testMacroSupportInBuildDefinitions() {
|
||||
IPath[] makefiles = {
|
||||
Path.fromOSString("makefile"),
|
||||
Path.fromOSString("objects.mk"),
|
||||
Path.fromOSString("sources.mk"),
|
||||
Path.fromOSString("subdir.mk")};
|
||||
IProject[] projects = createProjects("testMacroSupportInBuildDefinitions", null, null, true);
|
||||
buildProjects(projects, makefiles);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<attribute name="configurationNameProvider" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Contains the name of a class that implements an interface with a method for returning a default name for a configuration. The configuration names in a user's project must be unique. A projectType can contain configuration children with the same name. In this case, a configurationNameProvider must be specified to make the names unique before they are displayed to the user in the New Project and New Configuration dialog boxes.
|
||||
Contains the name of a class that implements an interface with a method for returning a default name for a configuration. The configuration names in a user's project must be unique. A projectType can contain configuration children with the same name. In this case, a configurationNameProvider must be specified to make the names unique before they are displayed to the user in the New Project and New Configuration dialog boxes.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.IConfigurationNameProvider"/>
|
||||
|
@ -570,14 +570,14 @@
|
|||
<attribute name="command" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The command that invokes the tool. For example, gcc for the Gnu C compiler, or g++ for the Gnu C++ compiler.
|
||||
The command that invokes the tool. For example, gcc for the Gnu C compiler, or g++ for the Gnu C++ compiler. This attribute supports MBS file context macros.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="commandLinePattern" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the command "pattern" that indicates how the parts of the command line are used to create the entire command line. The pattern consists of the replaceable variables COMMAND, FLAGS, OUTPUT_FLAG, OUTPUT_PREFIX, OUTPUT and INPUTS. The default command line pattern is ${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}, except when customBuildStep is true, where the default is $(COMMAND). White space and other characters are significant and are copied to the generated command.
|
||||
Specifies the command "pattern" that indicates how the parts of the command line are used to create the entire command line. The pattern consists of the replaceable variables COMMAND, FLAGS, OUTPUT_FLAG, OUTPUT_PREFIX, OUTPUT and INPUTS. The default command line pattern is ${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}, except when customBuildStep is true, where the default is $(COMMAND). White space and other characters are significant and are copied to the generated command. This attribute supports MBS file context macros.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -899,7 +899,7 @@
|
|||
<attribute name="outputPrefix" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so 'lib' would be the prefix. The default is to use the Tool “outputPrefix” attribute if primaryOutput is True, otherwise the default is an empty string.
|
||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so 'lib' would be the prefix. The default is to use the Tool “outputPrefix” attribute if primaryOutput is True, otherwise the default is an empty string. This attribute supports the use of MBS configuration macros.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -1141,7 +1141,7 @@ Additional special types exist to flag options of special relevance to the build
|
|||
<attribute name="valueHandler" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of a class that implements the IManagedOptionValueHandler interface. This interface is used to dynamically manage the value of an option.
|
||||
The id of a class that implements the IManagedOptionValueHandler interface. This interface is used to dynamically manage the value of an option.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler"/>
|
||||
|
|
|
@ -383,6 +383,57 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
|||
if(targetTool != null){
|
||||
IOutputType pot = targetTool.getPrimaryOutputType();
|
||||
String prefix = pot.getOutputPrefix();
|
||||
|
||||
|
||||
// Resolve any macros in the outputPrefix
|
||||
// Note that we cannot use file macros because if we do a clean
|
||||
// we need to know the actual
|
||||
// name of the file to clean, and cannot use any builder
|
||||
// variables such as $@. Hence
|
||||
// we use the next best thing, i.e. configuration context.
|
||||
|
||||
// figure out the configuration we're using
|
||||
IBuildObject toolParent = targetTool.getParent();
|
||||
IConfiguration config = null;
|
||||
// if the parent is a config then we're done
|
||||
if (toolParent instanceof IConfiguration)
|
||||
config = (IConfiguration) toolParent;
|
||||
else if (toolParent instanceof IToolChain) {
|
||||
// must be a toolchain
|
||||
config = (IConfiguration) ((IToolChain) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else if (toolParent instanceof IResourceConfiguration) {
|
||||
config = (IConfiguration) ((IResourceConfiguration) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else {
|
||||
// bad
|
||||
throw new AssertionError(
|
||||
"tool parent must be one of configuration, toolchain, or resource configuration");
|
||||
}
|
||||
|
||||
if (config != null) {
|
||||
|
||||
try {
|
||||
prefix = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
prefix,
|
||||
"", //$NON-NLS-1$
|
||||
" ", //$NON-NLS-1$
|
||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||
config);
|
||||
}
|
||||
|
||||
catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(prefix != null && !EMPTY_STRING.equals(prefix))
|
||||
name = prefix + name;
|
||||
}
|
||||
|
@ -393,6 +444,55 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
|||
if(targetTool != null){
|
||||
IOutputType pot = targetTool.getPrimaryOutputType();
|
||||
String prefix = pot.getOutputPrefix();
|
||||
|
||||
// Resolve any macros in the outputPrefix
|
||||
// Note that we cannot use file macros because if we do a clean
|
||||
// we need to know the actual
|
||||
// name of the file to clean, and cannot use any builder
|
||||
// variables such as $@. Hence
|
||||
// we use the next best thing, i.e. configuration context.
|
||||
|
||||
// figure out the configuration we're using
|
||||
IBuildObject toolParent = targetTool.getParent();
|
||||
IConfiguration config = null;
|
||||
// if the parent is a config then we're done
|
||||
if (toolParent instanceof IConfiguration)
|
||||
config = (IConfiguration) toolParent;
|
||||
else if (toolParent instanceof IToolChain) {
|
||||
// must be a toolchain
|
||||
config = (IConfiguration) ((IToolChain) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else if (toolParent instanceof IResourceConfiguration) {
|
||||
config = (IConfiguration) ((IResourceConfiguration) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else {
|
||||
// bad
|
||||
throw new AssertionError(
|
||||
"tool parent must be one of configuration, toolchain, or resource configuration");
|
||||
}
|
||||
|
||||
if (config != null) {
|
||||
|
||||
try {
|
||||
prefix = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
prefix,
|
||||
"", //$NON-NLS-1$
|
||||
" ", //$NON-NLS-1$
|
||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||
config);
|
||||
}
|
||||
|
||||
catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(prefix == null)
|
||||
prefix = EMPTY_STRING;
|
||||
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,prefix);
|
||||
|
|
|
@ -26,13 +26,17 @@ import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*/
|
||||
public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerator {
|
||||
|
||||
private static final String EMPTY_STRING = new String();
|
||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
public final String WHITESPACE = " "; //$NON-NLS-1$
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource)
|
||||
|
@ -149,6 +153,21 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
|||
cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
|
||||
outputFile, inputs, tool.getCommandLinePattern() );
|
||||
buildCmd = cmdLInfo.getCommandLine();
|
||||
|
||||
// resolve any remaining macros in the command after it has been generated
|
||||
try{
|
||||
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildCmd,
|
||||
EMPTY_STRING,
|
||||
WHITESPACE,
|
||||
IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(resource.getLocation(), null, null, info.getDefaultConfiguration().getToolChain()));
|
||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||
buildCmd = resolvedCommand;
|
||||
|
||||
} catch (BuildMacroException e){
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
String cmd = info.getToolForSource(inputExtension);
|
||||
//try to resolve the build macros in the tool command
|
||||
|
|
|
@ -11,9 +11,16 @@
|
|||
|
||||
package org.eclipse.cdt.managedbuilder.makegen.gnu;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedOutputNameProvider;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
|
||||
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
@ -79,6 +86,55 @@ public class GnuLinkOutputNameProvider implements IManagedOutputNameProvider {
|
|||
} else {
|
||||
// Add the outputPrefix
|
||||
String outputPrefix = tool.getPrimaryOutputType().getOutputPrefix();
|
||||
|
||||
// Resolve any macros in the outputPrefix
|
||||
// Note that we cannot use file macros because if we do a clean
|
||||
// we need to know the actual
|
||||
// name of the file to clean, and cannot use any builder
|
||||
// variables such as $@. Hence
|
||||
// we use the next best thing, i.e. configuration context.
|
||||
|
||||
// figure out the configuration we're using
|
||||
IBuildObject toolParent = tool.getParent();
|
||||
IConfiguration config = null;
|
||||
// if the parent is a config then we're done
|
||||
if (toolParent instanceof IConfiguration)
|
||||
config = (IConfiguration) toolParent;
|
||||
else if (toolParent instanceof IToolChain) {
|
||||
// must be a toolchain
|
||||
config = (IConfiguration) ((IToolChain) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else if (toolParent instanceof IResourceConfiguration) {
|
||||
config = (IConfiguration) ((IResourceConfiguration) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else {
|
||||
// bad
|
||||
throw new AssertionError(
|
||||
"tool parent must be one of configuration, toolchain, or resource configuration");
|
||||
}
|
||||
|
||||
if (config != null) {
|
||||
|
||||
try {
|
||||
outputPrefix = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
outputPrefix,
|
||||
"", //$NON-NLS-1$
|
||||
" ", //$NON-NLS-1$
|
||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||
config);
|
||||
}
|
||||
|
||||
catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (outputPrefix != null && outputPrefix.length() > 0) {
|
||||
fileName = outputPrefix + fileName;
|
||||
}
|
||||
|
|
|
@ -1542,6 +1542,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
|
||||
IManagedCommandLineInfo cmdLInfo = gen.generateCommandLineInfo( tool, command,
|
||||
flags, outflag, outputPrefix, primaryOutputs, cmdInputs, tool.getCommandLinePattern() );
|
||||
|
||||
// The command to build
|
||||
String buildCmd = null;
|
||||
if( cmdLInfo == null ) {
|
||||
|
@ -1555,6 +1556,26 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
buildCmd = command + WHITESPACE + toolFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + primaryOutputs + WHITESPACE + IN_MACRO;
|
||||
}
|
||||
else buildCmd = cmdLInfo.getCommandLine();
|
||||
|
||||
// resolve any remaining macros in the command after it has been
|
||||
// generated
|
||||
try {
|
||||
String resolvedCommand = ManagedBuildManager
|
||||
.getBuildMacroProvider().resolveValueToMakefileFormat(
|
||||
buildCmd,
|
||||
EMPTY_STRING,
|
||||
WHITESPACE,
|
||||
IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(null, null, null, info
|
||||
.getDefaultConfiguration()
|
||||
.getToolChain()));
|
||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||
buildCmd = resolvedCommand;
|
||||
|
||||
} catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
|
||||
buffer.append(TAB + AT + ECHO + WHITESPACE + buildCmd + NEWLINE);
|
||||
buffer.append(TAB + AT + buildCmd);
|
||||
|
||||
|
@ -2265,6 +2286,28 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
OUT_MACRO + otherPrimaryOutputs, (String[])inputs.toArray(new String[inputs.size()]), tool.getCommandLinePattern() );
|
||||
|
||||
String buildCmd = cmdLInfo.getCommandLine();
|
||||
|
||||
// resolve any remaining macros in the command after it has been
|
||||
// generated
|
||||
try {
|
||||
String resolvedCommand = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
buildCmd,
|
||||
EMPTY_STRING,
|
||||
WHITESPACE,
|
||||
IBuildMacroProvider.CONTEXT_FILE,
|
||||
new FileContextData(sourceLocation,
|
||||
outputLocation, null, info
|
||||
.getDefaultConfiguration()
|
||||
.getToolChain()));
|
||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||
buildCmd = resolvedCommand;
|
||||
|
||||
} catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
|
||||
buffer.append(TAB + AT + ECHO + WHITESPACE + buildCmd + NEWLINE);
|
||||
buffer.append(TAB + AT + buildCmd);
|
||||
} else {
|
||||
|
@ -2542,6 +2585,56 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
|||
boolean primaryOutput = (type == tool.getPrimaryOutputType());
|
||||
//if (primaryOutput && ignorePrimary) continue;
|
||||
String outputPrefix = type.getOutputPrefix();
|
||||
|
||||
// Resolve any macros in the outputPrefix
|
||||
// Note that we cannot use file macros because if we do a clean
|
||||
// we need to know the actual name of the file to clean, and
|
||||
// cannot use any builder variables such as $@. Hence we use the
|
||||
// next best thing, i.e. configuration context.
|
||||
|
||||
// figure out the configuration we're using
|
||||
IBuildObject toolParent = tool.getParent();
|
||||
IConfiguration config = null;
|
||||
// if the parent is a config then we're done
|
||||
if (toolParent instanceof IConfiguration)
|
||||
config = (IConfiguration) toolParent;
|
||||
else if (toolParent instanceof IToolChain) {
|
||||
// must be a toolchain
|
||||
config = (IConfiguration) ((IToolChain) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else if (toolParent instanceof IResourceConfiguration) {
|
||||
config = (IConfiguration) ((IResourceConfiguration) toolParent)
|
||||
.getParent();
|
||||
}
|
||||
|
||||
else {
|
||||
// bad
|
||||
throw new AssertionError(
|
||||
"tool parent must be one of configuration, toolchain, or resource configuration");
|
||||
}
|
||||
|
||||
if (config != null) {
|
||||
|
||||
try {
|
||||
outputPrefix = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
outputPrefix,
|
||||
"", //$NON-NLS-1$
|
||||
" ", //$NON-NLS-1$
|
||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||
config);
|
||||
}
|
||||
|
||||
catch (BuildMacroException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
boolean multOfType = type.getMultipleOfType();
|
||||
IOption option = tool.getOptionBySuperClassId(type.getOptionId());
|
||||
IManagedOutputNameProvider nameProvider = type.getNameProvider();
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
|
@ -27,6 +28,7 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
|
|||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedOutputNameProvider;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
|
||||
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
|
||||
|
@ -434,6 +436,31 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
|||
Vector typeEnumeratedOutputs = new Vector();
|
||||
IOutputType type = outTypes[i];
|
||||
String outputPrefix = type.getOutputPrefix();
|
||||
|
||||
// Resolve any macros in the outputPrefix
|
||||
// Note that we cannot use file macros because if we do a clean
|
||||
// we need to know the actual name of the file to clean, and
|
||||
// cannot use any builder variables such as $@. Hence we use the
|
||||
// next best thing, i.e. configuration context.
|
||||
|
||||
if (config != null) {
|
||||
|
||||
try {
|
||||
outputPrefix = ManagedBuildManager
|
||||
.getBuildMacroProvider()
|
||||
.resolveValueToMakefileFormat(
|
||||
outputPrefix,
|
||||
"", //$NON-NLS-1$
|
||||
" ", //$NON-NLS-1$
|
||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||
config);
|
||||
}
|
||||
|
||||
catch (BuildMacroException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String variable = type.getBuildVariable();
|
||||
boolean multOfType = type.getMultipleOfType();
|
||||
boolean primaryOutput = (type == tool.getPrimaryOutputType());
|
||||
|
|
Loading…
Add table
Reference in a new issue