Import Mbed OS hard-float snapshot
This commit is contained in:
92
tools/export/atmelstudio/__init__.py
Normal file
92
tools/export/atmelstudio/__init__.py
Normal file
@@ -0,0 +1,92 @@
|
||||
"""
|
||||
mbed SDK
|
||||
Copyright (c) 2011-2016 ARM Limited
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
"""
|
||||
import uuid
|
||||
from os.path import splitext, basename, dirname
|
||||
from os import remove
|
||||
|
||||
from tools.export.exporters import Exporter, deprecated_exporter
|
||||
|
||||
|
||||
@deprecated_exporter
|
||||
class AtmelStudio(Exporter):
|
||||
NAME = 'AtmelStudio'
|
||||
TOOLCHAIN = 'GCC_ARM'
|
||||
|
||||
TARGETS = [
|
||||
'SAMD21J18A',
|
||||
'SAMR21G18A',
|
||||
'SAMD21G18A',
|
||||
'SAML21J18A',
|
||||
'SAMG55J19',
|
||||
]
|
||||
|
||||
DOT_IN_RELATIVE_PATH = True
|
||||
|
||||
MBED_CONFIG_HEADER_SUPPORTED = True
|
||||
|
||||
@classmethod
|
||||
def is_target_supported(cls, maybe_supported):
|
||||
return maybe_supported in cls.TARGETS
|
||||
|
||||
def generate(self):
|
||||
|
||||
source_files = []
|
||||
dirs = []
|
||||
for r_type in ['s_sources', 'c_sources', 'cpp_sources']:
|
||||
r = getattr(self.resources, r_type)
|
||||
if r:
|
||||
for source in r:
|
||||
source_files.append(source[2:])
|
||||
dirs.append(dirname(source[2:]))
|
||||
|
||||
source_folders = []
|
||||
for e in dirs:
|
||||
if e and e not in source_folders:
|
||||
source_folders.append(e)
|
||||
|
||||
libraries = []
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
solution_uuid = '{' + str(uuid.uuid4()) + '}'
|
||||
project_uuid = '{' + str(uuid.uuid4()) + '}'
|
||||
|
||||
ctx = {
|
||||
'target': self.target,
|
||||
'name': self.project_name,
|
||||
'source_files': source_files,
|
||||
'source_folders': source_folders,
|
||||
'object_files': self.resources.objects,
|
||||
'include_paths': self.resources.inc_dirs,
|
||||
'library_paths': self.resources.lib_dirs,
|
||||
'linker_script': self.resources.linker_script,
|
||||
'libraries': libraries,
|
||||
'symbols': self.toolchain.get_symbols(),
|
||||
'solution_uuid': solution_uuid.upper(),
|
||||
'project_uuid': project_uuid.upper()
|
||||
}
|
||||
ctx.update(self.flags)
|
||||
target = self.target.lower()
|
||||
self.gen_file('atmelstudio/atsln.tmpl', ctx, '%s.atsln' % self.project_name)
|
||||
self.gen_file('atmelstudio/cppproj.tmpl', ctx, '%s.cppproj' % self.project_name)
|
||||
|
||||
@staticmethod
|
||||
def clean(project_name):
|
||||
remove('%s.atsln' % project_name)
|
||||
remove('%s.cppproj' % project_name)
|
||||
20
tools/export/atmelstudio/atsln.tmpl
Normal file
20
tools/export/atmelstudio/atsln.tmpl
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Atmel Studio Solution File, Format Version 11.00
|
||||
Project("{{solution_uuid}}") = "{{name}}", "{{name}}.cppproj", "{{project_uuid}}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Release|ARM = Release|ARM
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{{project_uuid}}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{{project_uuid}}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{{project_uuid}}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{{project_uuid}}.Release|ARM.Build.0 = Release|ARM
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
176
tools/export/atmelstudio/cppproj.tmpl
Normal file
176
tools/export/atmelstudio/cppproj.tmpl
Normal file
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>6.2</ProjectVersion>
|
||||
<ToolchainName>com.Atmel.ARMGCC.CPP</ToolchainName>
|
||||
<ProjectGuid>{{project_uuid}}</ProjectGuid>
|
||||
<avrdevice>AT{{target}}</avrdevice>
|
||||
<avrdeviceseries>none</avrdeviceseries>
|
||||
<OutputType>Executable</OutputType>
|
||||
<Language>CPP</Language>
|
||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||
<OutputFileExtension>.elf</OutputFileExtension>
|
||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||
<AssemblyName>AtmelStudio6_2</AssemblyName>
|
||||
<Name>AtmelStudio6_2</Name>
|
||||
<RootNamespace>AtmelStudio6_2</RootNamespace>
|
||||
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<CacheFlash>true</CacheFlash>
|
||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||
<RamSnippetAddress />
|
||||
<UncachedRange />
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<OverrideVtorValue />
|
||||
<BootSegment>2</BootSegment>
|
||||
<eraseonlaunchrule>1</eraseonlaunchrule>
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data xmlns="">
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
{% for s in symbols %}<Value>{{s}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>{{c_flags|join(" ")}} {{common_flags|join(" ")}} -MMD -MP</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
{% for s in symbols %}<Value>{{s}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize for size (-Os)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>{{cxx_flags|join(" ")}} {{common_flags|join(" ")}} -MMD -MP</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>{% for p in library_paths %}-L../{{p}} {% endfor %} {% for f in object_files %}../{{f}} {% endfor %} {% for lib in libraries %}-l{{lib}} {% endfor %} -T../{{linker_script}} {{ld_flags|join(" ")}} {{common_flags|join(" ")}}</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
{% for s in symbols %}<Value>{{s}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>{{c_flags|join(" ")}} {{common_flags|join(" ")}} -MMD -MP</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
{% for s in symbols %}<Value>{{s}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize (-O1)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.DebugLevel>Maximum (-g3)</armgcccpp.compiler.optimization.DebugLevel>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>{{cxx_flags|join(" ")}} {{common_flags|join(" ")}} -MMD -MP</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>{% for p in library_paths %}-L../{{p}} {% endfor %} {% for f in object_files %}../{{f}} {% endfor %} {% for lib in libraries %}-l{{lib}} {% endfor %} -T../{{linker_script}} {{ld_flags|join(" ")}} {{common_flags|join(" ")}}</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.assembler.debugging.DebugLevel>Default (-g)</armgcccpp.assembler.debugging.DebugLevel>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
{% for i in include_paths %}<Value>../{{i}}</Value>
|
||||
{% endfor %}
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<armgcccpp.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcccpp.preprocessingassembler.debugging.DebugLevel>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
{% for f in source_folders %}<Folder Include="{{f}}" />
|
||||
{% endfor %}
|
||||
{% for s in source_files %}<Compile Include="{{s}}">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
{% endfor %}
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user