[熱情]

[참고] Ride7에서 bin 만들기 본문

카테고리 없음

[참고] Ride7에서 bin 만들기

rootkaien 2014. 5. 20. 14:19

링크 블러그 : http://blog.naver.com/actionprog/80125210260


C:\Program Files (x86)\Raisonance\Ride\Config\ARM\LD.config

<Config>
   <Tool Header="LD" Desc="LD Linker" Separator=";" ExitFail="0" SourceFilter="*.rapp" TargetFilter="ARM" TimeOut="360000" ConfigPath="ARM\LD.config" MsgFilter="{SPECFILE}:{SPECLINE}: {SPECERROR}:{SPECMESSAGE}">
      <!-- Test that no other GCC compiler which can result to confict with GNU ARM is installed  -->
      <Script>
         <![CDATA[
         var colEnvironmentVariables = objShell.Environment("System")
         var test                    = colEnvironmentVariables.Item("GCC_EXEC_PREFIX");
         var colEnvironmentVariables = objShell.Environment("Volatile");

         if( test )
         {
            var message = "This project attempts to use GNU ARM compiler from Code Sourcery\nThe environment variable "+"GCC_EXEC_PREFIX"+" means that another GNU compiler (which is not compatible with GNU ARM) is installed\nPlease uninstall the other compiler or rename this environment variable to be able to use GNU ARM compiler"

            objShell.popup( message );
         }
         ]]>
      </Script>
      <!-- make .ld files -->
      <Script>
         <![CDATA[
         var  ld = Tools.GetPropertyValue("", "Build", "OutputFile") + ".ld";

         ld = ld.replace(/\\/g, "\\\\");     // Replace "\" with "\\"

         var inputfiles = Tools.GetPropertyValue("LD", "General", "InputFiles");

         GNUFilesLinkerManager(ld);
         ]]>
      </Script>
      <!-- make map file option -->
      <!-- make sure output file and map file directories exist before linking -->
      <Script>
         <![CDATA[
         var outdir  = objFSO.GetParentFolderName(Tools.GetPropertyValue("", "Build",  "OutputFile"));
         var listdir = objFSO.GetParentFolderName(Tools.GetPropertyValue("", "Build", "ListingFile"));

         if(!objFSO.FolderExists(outdir))
            objFSO.CreateFolder(outdir);

         if(!objFSO.FolderExists(listdir))
            objFSO.CreateFolder(listdir);
         ]]>
      </Script>
      <!-- do link -->
      <![CDATA["$(Target.Tools.Execute)" $(Target.ProcessorARM.Target) $(LD.Specific.Thumb) -Wl,-T -Xlinker "$(Build.OutputFile).ld" -u _start $(LD.Linker.GC_SECTIONS) $(LD.Linker.MAPFILELINE) $(LD.Startup.GCCSTARTUP) $(LD.Linker.WARNONCE) $(LD.More.More)]]>
      <!-- do .hex file -->
      <Script>
         <![CDATA[
         hexfile = Tools.GetPropertyValue("", "Build", "OutputFile");
         hexfile = hexfile.replace(".elf",".hex");

         Tools.SetPropertyValue("LD","General","HexFile", hexfile);
         ]]>
      </Script>
      <![CDATA["$(RKitInst)arm-gcc\bin\arm-none-eabi-objcopy.exe" "$(Build.OutputFile)" --target=ihex "$(LD.General.HexFile)"]]>
      <!-- arm-elf-size.exe to have code size info-->
      <![CDATA["$(RKitBin)\rexrdr.exe" "$(Build.OutputFile).sizetmp" 0 "$(RKitInst)arm-gcc\bin\arm-none-eabi-size.exe" "$(Build.OutputFile)"]]>
       <!-- do .bin file -->
     <Script>
       <![CDATA[
         binfile = Tools.GetPropertyValue("", "Build", "OutputFile");
         binfile = binfile.replace(".elf",".bin");

         Tools.SetPropertyValue("LD","General","BinFile", binfile);
         ]]>
     </Script>
     <![CDATA["$(RKitInst)arm-gcc\bin\arm-none-eabi-objcopy.exe" -O binary "$(Build.OutputFile)" "$(LD.General.BinFile)"]]>

      <!-- make xml file -->
      <Script>
         <![CDATA[
         var filename = Tools.GetPropertyValue("", "Build", "OutputFile");

         filename = filename.replace(/\\/g, "\\\\");     // Replace "\" with "\\"
         filename = filename.replace(".elf", "");

         GNULDOutputManager( filename + ".elf.sizetmp", filename + ".depxml");

         var dbi    = Project.GetSelectedDBI();

         Tools.SetPropertyValue("LD", "General", "DBIFile", dbi);
         Project.WriteIniValue("Application","ApplicationPath",Tools.GetPropertyValue("", "Build", "OutputFile"), dbi);
         Project.WriteIniValue("Application","Target",Tools.GetPropertyValue("", "Target", "TargetFamily"), dbi);
         ]]>
      </Script>
      <ExtTool>
         <![CDATA[$(LD.More.PostLink)]]>
      </ExtTool>
   </Tool>
   <Defs>
      <Set Header="LD" Desc="LD Linker" Comment="Specifies the LD linker settings">
         <Section Header="General" Hidden="1">
            <Property Header="OutExt" Type="PT_STRING" Value=".elf" />
            <Property Header="ListExt" Type="PT_STRING" Value=".map" />
            <Property Header="InputFiles" Type="PT_STRING" Value="" />
            <Property Header="DefaultLibDir" Type="PT_STRING" Value="" />
            <Property Header="HexFile" Type="PT_STRING" Value="" />
              <Property Header="BinFile" Type="PT_STRING" Value="" />     
            <Property Header="DBIFile" Type="PT_STRING" Value="" />
         </Section>
         <Section Header="Specific" Desc="ARM Specific Options" Comment="Defines ARM specific options.">
            <Property Header="Thumb" Major="1" Desc="Mode ARM/Thumb" Type="PT_CHOICE" Default="" Comment="Defines whether the Thumb mode should be used and if interwork should be applied.">
               <Enum Header="ARM" Value="" />
               <Enum Header="Thumb" Value="-mthumb" />
               <Enum Header="Interwork" Value="-mthumb-interwork" />
            </Property>
         </Section>
         <Section Header="Linker" Desc="General" Comment="General linker options.">
            <Property Header="MAPFILE" Major="1" Desc="Generate MAP file" Type="PT_CHOICE" Default="Yes" Comment="Generate a linker MAP file (-Map)">
               <Enum Header="Yes" Value="Yes" />
               <Enum Header="No" Value="No" />
               <Script>
                  <![CDATA[
                  var mapoption = Project.GetPropertyValue("LD", "Linker", "MAPFILE");

                  if(mapoption=="No")
                  {
                     Project.SetPropertyValue("LD", "Linker", "MAPFILELINE", "")
                  }
                  else
                  {
                     Project.SetPropertyValue("LD", "Linker", "MAPFILELINE", "-Wl,-Map -Xlinker \"$(Build.ListingFile)\"");
                  }
                  ]]>
               </Script>
            </Property>
            <Property Header="MAPFILELINE" Major="1" Desc="MAP file command line" Type="PT_STRING" Default="" Value = "" Comment="" Hidden="1">
            </Property>
            <Property Header="WARNONCE" Major="1" Desc="Warn undefined symbols" Type="PT_CHOICE" Default="No" Comment="Warn for each undefined symbol (--warn-once)">
               <Enum Header="Yes" Value="-Wl,--warn-once" />
               <Enum Header="No" Value="" />
            </Property>
            <Property Header="GC_SECTIONS" Major="1" Desc="Remove unused sections" Type="PT_CHOICE" Default="-Wl,-static -Wl,--gc-sections" Comment="Remove the unused sections from the application, unless they are forced to be kept (see '-u' gcc command-line option and 'KEEP()' directive in the linker script)">
               <Enum Header="Yes" Value="-Wl,-static -Wl,--gc-sections" />
               <Enum Header="No" Value="" />
            </Property>
         </Section>
         <Section Header="Startup" Desc="Startup" Comment="Defines startup options.">
            <Property Header="DEFAULTSTARTUP" Major="1" Desc="Use Default Startup" Type="PT_CHOICE" Default="Yes" Comment="Use the default startup code.">
               <Enum Header="Yes" Value="Yes" />
               <Enum Header="No" Value="No" />
               <Script>
                  <![CDATA[
                  var sc = Project.GetPropertyValue("LD","Startup", "DEFAULTSTARTUP");

                  if( sc == "Yes" )
                  {
                     Project.EnableProperty("LD","Startup", "File", 0);
                     Project.SetPropertyValue("LD", "Startup", "File", Project.GetPropertyValue("LD", "Startup", "DefaultFile"));
                  }
                  else
                  {
                     Project.EnableProperty("LD","Startup", "File", 1);
                  }
                  ]]>
               </Script>
            </Property>
            <Property Header="File" Major="1" Desc="Startup File" Type="PT_PATH" Default="ctr0.o" Pattern="*.o" Comment="Selects a specific startup file."/>
            <Property Header="DefaultFile" Desc="Default Startup File" Type="PT_STRING" Default="ctr0.o" Hidden="1" />
            <Property Header="GCCSTARTUP" Major="1" Desc="Use GCC Startups" Type="PT_CHOICE" Default="-nostartfiles" Comment="Use the GCC startup code. NOT recommended for C. Required for C++.">
               <Enum Header="Yes" Value="" />
               <Enum Header="No" Value="-nostartfiles" />
            </Property>
         </Section>
         <Section Header="Scripts" Desc="Scripts" Comment="Specifies linker script file options.">
            <Property Header="SCRIPTFILES" Major="1" Desc="Use Default Script File" Type="PT_CHOICE" Default="Yes" Comment="Defines whether the default linker script file should be used.">
               <Enum Header="Yes" Value="Yes" />
               <Enum Header="No" Value="No" />
               <Script>
                  <![CDATA[
                  var st= Project.GetPropertyValue("LD","Scripts", "SCRIPTFILES");

                  if( st == "Yes" )
                     Project.EnableProperty("LD","Scripts", "File", 0);
                  else
                     Project.EnableProperty("LD","Scripts", "File", 1);

                  if( st == "Yes" )
                     Project.HideProperty("LD","Scripts", "StarterKitLimit", 0);
                  else
                     Project.HideProperty("LD","Scripts", "StarterKitLimit", 1);
                  ]]>
               </Script>
            </Property>
            <Property Header="File" Major="1" Desc="Script File" Type="PT_PATH" Default="ctr0.ld" Pattern="*.ld" Comment="Selects a specific linker script file."/>
            <Property Header="16KLimit" Major="1" Desc="Starter Kit limitation old option name " Type="PT_CHOICE" Hidden="1" Comment="Informs you whether the linker is size-limited (64K)">
               <Enum Header="Yes" Value="Yes" />
               <Enum Header="No" Value="No" />
               <Enum Header="Unused" Value="Unused" />
               <Script>
                  <![CDATA[
                  var limitation= Project.GetPropertyValue("LD","Scripts", "16KLimit")

                  if( ( limitation == "Yes" ) || ( limitation == "No" ) )
                  {
                     Project.SetPropertyValue("LD","Scripts", "StarterKitLimit",limitation );
                     Project.SetPropertyValue("LD","Scripts", "16KLimit","Unused" );
                     Project.SavePropertyValue("LD","Scripts", "16KLimit","Unused" );
                  }
                  ]]>
               </Script>
            </Property>
            <Property Header="StarterKitLimit" Major="1" Desc="Starter Kit limited" Type="PT_CHOICE" Default="Yes" Comment="When selected, this options prevents from building a project that is larger than 64K.\nThis can avoid linker or debug-related problems.">
               <Enum Header="Yes" Value="Yes" />
               <Enum Header="No" Value="No" />
            </Property>
         </Section>
         <Section Header="LIB" Desc="Libraries">
            <Property Header="STM32LIB" Major="1" Desc="Use OLD Precompiled Library" Type="PT_CHOICE" Default="0" Hidden="1" Comment="Use precompiled ST library version 2.3.0 \nIf no you just add the source of the library you want to use in your project  ">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
            </Property>
            <Property Header="STRXLIB" Major="1" Desc="Use ST Precompiled library" Type="PT_CHOICE" Default="1" Hidden="1" Comment="Specifies whether the ST precompiled library should be used in your project.">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
            </Property>
           <Property Header="STLIB" Major="1" Desc="ST library" Type="PT_CHOICE" Default="Unknown" Hidden="1" Comment="Specifies whether the ST library should be used in your project.">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
               <Enum Header="NotUsed" Value="Dummy" />
               <Enum Header="Unknown" Value="Unknown" />
               <Script>
                  <![CDATA[
                  var LDstlib= Project.GetPropertyValue("LD","LIB", "STLIB");

                  if( LDstlib == "Unknown" )
                  {
                     Project.SetPropertyValue("LD","LIB","STRXLIB","1");
                     Project.SetPropertyValue("LD","LIB","STM32LIB","0");
                     Project.SetPropertyValue("LD","LIB","STLIB","Dummy");

                     LDstlib = "Dummy";
                  }

                  // Old settings.
                  if( LDstlib != "Dummy" )
                  {
                     Project.SetPropertyValue("LD","LIB","STRXLIB",LDstlib);
                     Project.SetPropertyValue("LD","LIB","STM32LIB",LDstlib);
                     Project.SetPropertyValue("LD","LIB","STLIB","Dummy");
                  }
                  ]]>
               </Script>
            </Property>
            <Property Header="UART0PUTC" Major="1" Desc="UART0 Putchar" Type="PT_CHOICE" Default="1" Comment="Specifies whether the project should include a putchar that emits characters on the UART0 peripheral." >
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
            </Property>
            <Property Header="LIBCPP" Major="1" Desc="C++ Libraries" Type="PT_CHOICE" Default="0" Comment="Required for C++ applications. Must not be selected for C applications." Hidden="0">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
            </Property>
            <Property Header="SMALLP" Major="1" Desc="Small printf" Type="PT_CHOICE" Default="Unused" Comment="Obsolete" Hidden="1">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
               <Enum Header="Unused" Value="Unused" />
            </Property>
            <Property Header="NOFLOATP" Major="1" Desc="Small no-float printf" Type="PT_CHOICE" Default="Unused" Comment="Obsolete" Hidden="1">
               <Enum Header="Yes" Value="1" />
               <Enum Header="No" Value="0" />
               <Enum Header="Unused" Value="Unused" />
            </Property>
            <Property Header="PRINTFTYPE" Major="1" Desc="printf capabilities" Type="PT_CHOICE" Default="0" Comment="Specifies whether the printf used in the project should be the full GNU printf, a lighter version or a very light version without float support.">
               <Enum Header="Full GNU printf" Value="2" />
               <Enum Header="Small printf" Value="1" />
               <Enum Header="Small no-float printf" Value="0" />
            </Property>
         </Section>
         <Section Header="More" Major="1" Desc="More" Comment="Additional linker options.">
            <Property Header="More" Major="1" Desc="More options" Type="PT_EDITLIST" Pattern=" %s" Comment="Specifies additional options to be added on the linker command line."/>
            <Property Header="PostLink" Desc="Post Link Tool" Type="PT_TOOLS" Comment="Specifies additional Tool to be launched"/>
         </Section>
      </Set>
   </Defs>
</Config>


Comments