[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] Definition of a toolchain
|
Hello everybody,
I would like to define the following toolchain:
.c -> GCC Preprocessing -> .pp.i -> Another Preprocessing Step -> .i -> GCC Compiler -> .o -> GCC Linker
But with this configuration, i have some trouble because the generated CDT external makefile doesn't care about the second preprocessing step and produces the following toolchain
.c -> GCC Preprocessing -> .pp.i -> GCC Compiler -> .pp.o -> GCC Linker
It seems that the .pp.i and .i extensions create confusion in the generator.
If i define the following toolchain, my problems disappears:
.c -> GCC Preprocessing -> .t -> Another Preprocessing Step -> .i> GCC Compiler -> .o -> GCC Linker
With this configuration my toolchain generate the good makefile but doesn't work because my second preprocessing step needs ".i" extension file and not ".t"
Thanks for your help.
I give you the code of my plug-in if it can help you to answer me...
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
id="org.eclipse.cdt.example.toolchain"
name="Example Tool Chain"
point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
<managedBuildRevision
fileVersion="4.0.0">
</managedBuildRevision>
<projectType
id="example.toolchain.executable"
buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe"
isAbstract="false"
isTest="false"
name="Example Executable">
<configuration
cleanCommand="rm –f"
errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.VCErrorParser"
id="example.toolchain.configuration.release"
buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug"
name="Test Release">
<toolChain
archList="all"
id="example.toolchain.toolchain"
isAbstract="false"
name="Example Tool-chain"
osList="win32"
targetTool="projectcdt.managedbuild.tool.gnu.c.linker">
<builder
isAbstract="false"
id="example.toolchain.builder"
command="make"
arguments=""
variableFormat="${=}"
isVariableCaseSensitive="true"
reservedMacroNames="ROOT,DEPS,OBJS,.*_SRCS,EXECUTABLES,SUBDIRS,LIBS,USER_OBJS,.*_INPUTS,.*_OUTPUTS"
buildfileGenerator="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator"
macroInputFileNameValue="$(notdir $<)"
macroInputFileExtValue="$(suffix $(notdir $<))"
macroInputFileBaseNameValue="$(basename $(notdir $<))"
macroInputFileRelPathValue="$<"
macroInputDirRelPathValue="$(dir $<)"
macroOutputFileNameValue="$(notdir $@)"
macroOutputFileExtValue="$(suffix $(notdir $@))"
macroOutputFileBaseNameValue="$(basename $(notdir $@))"
macroOutputFileRelPathValue="$@"
macroOutputDirRelPathValue="$(dir $@)"
autoBuildTarget="all"
incrementalBuildTarget="all"
cleanBuildTarget="clean"
ignoreErrCmd="-k"
parallelBuildCmd="-j*"
errorParsers="org.eclipse.cdt.core.MakeErrorParser"
name="Example Builder">
</builder>
<targetPlatform
binaryParser="
org.eclipse.cdt.core.PE"
id="example.toolchain.targetplatform"
isAbstract="false"
name="Example Target Platform"
archList="all"
osList="win32">
</targetPlatform>
<tool
command="gcc -E "
commandLinePattern="${command} ${FLAGS} ${inputs} > ${output}"
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
id="projectcdt.managedbuild.tool.gnu.c.preprocess"
isAbstract="false"
name="PreProcesserGCC"
natureFilter="both">
<envVarBuildPath
buildPathResolver="org.eclipse.cdt.managedbuilder.gnu.cygwin.CygwinPathResolver"
pathType="buildpathInclude"
variableList="CPATH,C_INCLUDE_PATH">
</envVarBuildPath>
<inputType
id="projectcdt.managedbuild.tool.gnu.c.preprocess.input"
languageId="org.eclipse.cdt.core.gcc"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"
sourceContentType="org.eclipse.cdt.core.cSource"
sources="c">
</inputType>
<outputType
buildVariable="PREPROCESS_OBJS"
id="projectcdt.managedbuild.tool.gnu.c.preprocess.output"
outputContentType="org.eclipse.cdt.contenttype.ppiSource">
</outputType>
<optionCategory
id="example.compiler.optionCategory.general"
name="General"
owner="projectcdt.managedbuild.tool.gnu.c.preprocess">
</optionCategory>
<option
category="example.compiler.optionCategory.general"
command="-I"
id="example.toolchain.compiler.general.incpath"
isAbstract="false"
name="Include paths"
resourceFilter="all"
valueType="includePath">
</option>
</tool>
<tool
command="MyPreProcess2.exe "
commandLinePattern="${command} ${inputs} > ${output}"
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
id="projectcdt.managedbuild.tool.gnu.c.preprocess2"
isAbstract="false"
name="PreProcesser2"
natureFilter="both">
<envVarBuildPath
buildPathResolver="org.eclipse.cdt.managedbuilder.gnu.cygwin.CygwinPathResolver"
pathType="buildpathInclude"
variableList="CPATH,C_INCLUDE_PATH">
</envVarBuildPath>
<inputType
buildVariable="PREPROCESS_OBJS"
id="projectcdt.managedbuild.tool.gnu.c.preprocess.input2"
languageId="org.eclipse.cdt.core.gcc"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"
sourceContentType="org.eclipse.cdt.contenttype.ppiSource">
</inputType>
<outputType
buildVariable="PREPROCESS2_OBJS"
id="projectcdt.managedbuild.tool.gnu.c.preprocess.output2"
outputContentType="org.eclipse.cdt.contenttype.iSource">
</outputType>
</tool>
<tool
command="gcc -c "
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
id="projectcdt.managedbuild.tool.gnu.c.compiler"
isAbstract="false"
name="MyCompilerGnuC"
natureFilter="both"
outputFlag="-o">
<envVarBuildPath
buildPathResolver="org.eclipse.cdt.managedbuilder.gnu.cygwin.CygwinPathResolver"
pathType="buildpathInclude"
variableList="CPATH,C_INCLUDE_PATH">
</envVarBuildPath>
<inputType
buildVariable="PREPROCESS2_OBJS"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator2"
dependencyContentType="org.eclipse.cdt.core.cHeader"
dependencyExtensions="h"
id="projectcdt.managedbuild.tool.gnu.c.compiler.input"
languageId="org.eclipse.cdt.core.gcc"
scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"
sourceContentType="org.eclipse.cdt.contenttype.iSource">
</inputType>
<outputType
buildVariable="COMPILER_OBJS"
id="projectcdt.managedbuild.tool.gnu.c.compiler.output"
outputs="o">
</outputType>
</tool>
<tool
natureFilter="cnature"
name="MyLinkerGnuC"
outputFlag="-o"
command="gcc"
id="projectcdt.managedbuild.tool.gnu.c.linker"
errorParsers="org.eclipse.cdt.core.GLDErrorParser">
<envVarBuildPath
pathType="buildpathLibrary"
variableList="LIBRARY_PATH">
</envVarBuildPath>
<inputType
sources="o"
multipleOfType="true"
dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.internal.DefaultNoDependencyCalculator"
buildVariable="COMPILER_OBJS"
id="projectcdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput
paths="$(USER_OBJS)"
kind="additionalinputdependency">
</additionalInput>
<additionalInput
paths="$(LIBS)"
kind="additionalinput">
</additionalInput>
</inputType>
<outputType
outputs=""
buildVariable="EXECUTABLES"
nameProvider="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuLinkOutputNameProvider"
id="projectcdt.managedbuild.tool.gnu.c.linker.output">
<enablement
type="ALL">
<checkOption
optionId="projectcdt.gnu.c.link.option.shared"
value="false"/>
</enablement>
</outputType>
<outputType
outputs="so"
outputPrefix="lib"
nameProvider="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuLinkOutputNameProvider"
buildVariable="LIBRARIES"
id="
projectcdt.managedbuild.tool.gnu.c.linker.output.so">
<enablement
type="ALL">
<checkOption
optionId="projectcdt.gnu.c.link.option.shared"
value="true"/>
</enablement>
</outputType>
</tool>
</toolChain>
</configuration>
</projectType>
</extension>
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.text"
file-extensions="i"
id="org.eclipse.cdt.contenttype.iSource"
name="iSource">
</content-type>
<content-type
base-type="org.eclipse.core.runtime.text"
file-extensions="pp.i"
id="org.eclipse.cdt.contenttype.ppiSource"
name="ppiSource">
</content-type>
</extension>
</plugin>