diff --git a/tools/export/e2studio/.cproject.tmpl b/tools/export/e2studio/.cproject.tmpl
new file mode 100644
index 0000000000..d8732301d3
--- /dev/null
+++ b/tools/export/e2studio/.cproject.tmpl
@@ -0,0 +1,414 @@
+
+
+
+
+
+ {% for cfg_key in options %}
+ {% set opts = options[cfg_key] %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% if opts['common']['arm.target.thumbinterwork'] %}
+
+ {% endif %}
+ {% if opts['common']['arm.target.endianness'] %}
+
+ {% endif %}
+ {% if opts['common']['arm.target.fpu.abi'] %}
+
+ {% endif %}
+ {% if opts['common']['arm.target.fpu.unit'] %}
+
+ {% endif %}
+ {% if opts['common']['arm.target.unalignedaccess'] %}
+
+ {% endif %}
+
+ {% if opts['common']['optimization.level'] != '' %}
+
+ {% endif %}
+ {% if opts['common']['optimization.messagelength'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.signedchar'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.functionsections'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.datasections'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.nocommon'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.noinlinefunctions'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.freestanding'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.nobuiltin'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.spconstant'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.PIC'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.nomoveloopinvariants'] %}
+
+ {% endif %}
+ {% if opts['common']['optimization.other'] != '' %}
+
+ {% endif %}
+
+ {% if opts['common']['warnings.syntaxonly'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.pedantic'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.pedanticerrors'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.nowarn'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.unused'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.uninitialized'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.allwarn'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.extrawarn'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.missingdeclaration'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.conversion'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.pointerarith'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.padded'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.shadow'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.logicalop'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.agreggatereturn'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.floatequal'] %}
+
+ {% endif %}
+ {% if opts['common']['warnings.toerrors'] %}
+
+ {% endif %}
+
+ {% if opts['common']['warnings.other'] != '' %}
+
+ {% endif %}
+
+ {% if opts['common']['debugging.level'] != 'none' %}
+
+ {% endif %}
+ {% if opts['common']['debugging.format'] != '' %}
+
+ {% endif %}
+ {% if opts['common']['debugging.prof'] %}
+
+ {% endif %}
+ {% if opts['common']['debugging.gprof'] %}
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% if opts['as']['usepreprocessor'] %}
+
+ {% endif %}
+ {% if opts['as']['nostdinc'] %}
+
+ {% endif %}
+
+
+
+ {% if opts['as']['otherwarnings'] != '' %}
+
+ {% endif %}
+ {% if opts['as']['verbose'] %}
+
+ {% endif %}
+ {% if opts['as']['other'] != '' %}
+
+ {% endif %}
+
+
+
+ {% if opts['c']['nostdinc'] %}
+
+ {% endif %}
+
+
+
+ {% if opts['c']['compiler.std'] %}
+
+ {% endif %}
+ {% if opts['c']['otheroptimizations'] != '' %}
+
+ {% endif %}
+ {% if opts['c']['warnings.missingprototypes'] %}
+
+ {% endif %}
+ {% if opts['c']['warnings.strictprototypes'] %}
+
+ {% endif %}
+ {% if opts['c']['warnings.badfunctioncast'] %}
+
+ {% endif %}
+ {% if opts['c']['otherwarnings'] != '' %}
+
+ {% endif %}
+ {% if opts['c']['verbose'] %}
+
+ {% endif %}
+ {% if opts['c']['other'] != '' %}
+
+ {% endif %}
+
+
+
+ {% if opts['cpp']['nostdinc'] %}
+
+ {% endif %}
+ {% if opts['cpp']['nostdincpp'] %}
+
+ {% endif %}
+
+
+
+ {% if opts['cpp']['compiler.std'] %}
+
+ {% endif %}
+
+ {% if opts['cpp']['optimization.noexceptions'] %}
+
+ {% endif %}
+ {% if opts['cpp']['optimization.nortti'] %}
+
+ {% endif %}
+ {% if opts['cpp']['optimization.nousecxaatexit'] %}
+
+ {% endif %}
+ {% if opts['cpp']['optimization.nothreadsafestatics'] %}
+
+ {% endif %}
+ {% if opts['cpp']['otheroptimizations'] != '' %}
+
+ {% endif %}
+
+ {% if opts['cpp']['warnabi'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warnings.ctordtorprivacy'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warnings.noexcept'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warnings.nonvirtualdtor'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warnings.strictnullsentinel'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warnings.signpromo'] %}
+
+ {% endif %}
+ {% if opts['cpp']['warneffc'] %}
+
+ {% endif %}
+ {% if opts['cpp']['otherwarnings'] != '' %}
+
+ {% endif %}
+
+ {% if opts['cpp']['verbose'] %}
+
+ {% endif %}
+ {% if opts['cpp']['other'] != '' %}
+
+ {% endif %}
+
+
+
+
+
+
+
+ {% if opts['ld']['gcsections'] %}
+
+ {% endif %}
+
+ {% if opts['ld']['nostart'] %}
+
+ {% endif %}
+ {% if opts['ld']['nodeflibs'] %}
+
+ {% endif %}
+ {% if opts['ld']['nostdlibs'] %}
+
+ {% endif %}
+
+
+ {% if opts['ld']['other'] != '' %}
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% endfor %}
+
+
+
+
+
+
+ {% for cfg_key in options %}
+ {% set opts = options[cfg_key] %}
+
+
+
+ {% endfor %}
+ {% for cfg_key in options %}
+ {% set opts = options[cfg_key] %}
+
+
+
+ {% endfor %}
+
+
+
+
diff --git a/tools/export/e2studio/rz_a1h_gdbinit.tmpl b/tools/export/e2studio/.gdbinit.tmpl
similarity index 100%
rename from tools/export/e2studio/rz_a1h_gdbinit.tmpl
rename to tools/export/e2studio/.gdbinit.tmpl
diff --git a/tools/export/e2studio/__init__.py b/tools/export/e2studio/__init__.py
index 447dee58a8..e937a318fa 100644
--- a/tools/export/e2studio/__init__.py
+++ b/tools/export/e2studio/__init__.py
@@ -14,12 +14,9 @@ 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.
"""
-from os.path import splitext, basename
+from tools.export.gnuarmeclipse import GNUARMEclipse
-from tools.export.exporters import Exporter, deprecated_exporter
-
-@deprecated_exporter
-class E2Studio(Exporter):
+class E2Studio(GNUARMEclipse):
NAME = 'e2 studio'
TOOLCHAIN = 'GCC_ARM'
@@ -27,22 +24,24 @@ class E2Studio(Exporter):
'RZ_A1H',
]
+ # override
def generate(self):
- libraries = []
- for lib in self.resources.libraries:
- l, _ = splitext(basename(lib))
- libraries.append(l[3:])
- ctx = {
- 'name': self.project_name,
- 'include_paths': self.resources.inc_dirs,
- 'linker_script': self.resources.linker_script,
+ jinja_ctx = self.collect_tmpl_vars()
- 'object_files': self.resources.objects,
- 'libraries': libraries,
- 'symbols': self.toolchain.get_symbols()
- }
- self.gen_file('e2studio/%s_project.tmpl' % self.target.lower(), ctx, '.project')
- self.gen_file('e2studio/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')
- self.gen_file('e2studio/%s_gdbinit.tmpl' % self.target.lower(), ctx, '.gdbinit')
- self.gen_file('e2studio/launch.tmpl', ctx, '%s OpenOCD.launch' % self.project_name)
+ print
+ print 'Create a e2 studio C++ managed project'
+ print 'Project name: {0}'.format(self.project_name)
+ print 'Target: {0}'.format(self.toolchain.target.name)
+ print 'Toolchain: {0}'.format(self.TOOLCHAIN)
+
+ self.gen_file('e2studio/.cproject.tmpl', jinja_ctx, '.cproject', trim_blocks=True, lstrip_blocks=True)
+ self.gen_file('e2studio/.gdbinit.tmpl', jinja_ctx, '.gdbinit')
+ self.gen_file('e2studio/launch.tmpl', jinja_ctx, '%s OpenOCD.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)
+
+ self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx, '.project', trim_blocks=True, lstrip_blocks=True)
+ self.gen_file('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')
+ self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx, 'makefile.targets', trim_blocks=True, lstrip_blocks=True)
+
+ print
+ print 'Done. Import the project located at \'{0}\' in e2 studio.'.format(self.project_name)
diff --git a/tools/export/e2studio/rz_a1h_cproject.tmpl b/tools/export/e2studio/rz_a1h_cproject.tmpl
deleted file mode 100644
index d54ad2f337..0000000000
--- a/tools/export/e2studio/rz_a1h_cproject.tmpl
+++ /dev/null
@@ -1,324 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/export/e2studio/rz_a1h_project.tmpl b/tools/export/e2studio/rz_a1h_project.tmpl
deleted file mode 100644
index 0bab8dd408..0000000000
--- a/tools/export/e2studio/rz_a1h_project.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
- {{name}}
- This file was automagically generated by mbed.org. For more information, see http://mbed.org/handbook/Exporting-To-e2studio
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/tools/export/e2studio/vk_rz_a1h_cproject.tmpl b/tools/export/e2studio/vk_rz_a1h_cproject.tmpl
deleted file mode 100644
index 85dcd99424..0000000000
--- a/tools/export/e2studio/vk_rz_a1h_cproject.tmpl
+++ /dev/null
@@ -1,318 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools/export/e2studio/vk_rz_a1h_gdbinit.tmpl b/tools/export/e2studio/vk_rz_a1h_gdbinit.tmpl
deleted file mode 100644
index a59f78c10c..0000000000
--- a/tools/export/e2studio/vk_rz_a1h_gdbinit.tmpl
+++ /dev/null
@@ -1,29 +0,0 @@
-define hook-step
-mon cortex_a maskisr on
-end
-
-define hook-stepi
-mon cortex_a maskisr on
-end
-
-define hook-next
-mon cortex_a maskisr on
-end
-
-define hook-nexti
-mon cortex_a maskisr on
-end
-
-define hook-finish
-mon cortex_a maskisr on
-end
-
-define hook-stop
-mon cortex_a maskisr off
-end
-
-define hook-kill
-mon reset init
-end
-
-set mem inaccessible-by-default off
\ No newline at end of file
diff --git a/tools/export/e2studio/vk_rz_a1h_project.tmpl b/tools/export/e2studio/vk_rz_a1h_project.tmpl
deleted file mode 100644
index 0bab8dd408..0000000000
--- a/tools/export/e2studio/vk_rz_a1h_project.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
- {{name}}
- This file was automagically generated by mbed.org. For more information, see http://mbed.org/handbook/Exporting-To-e2studio
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/tools/export/gnuarmeclipse/__init__.py b/tools/export/gnuarmeclipse/__init__.py
index 3a6f480d73..1a432a4c45 100644
--- a/tools/export/gnuarmeclipse/__init__.py
+++ b/tools/export/gnuarmeclipse/__init__.py
@@ -126,19 +126,13 @@ class GNUARMEclipse(Exporter):
flags['cxx_flags'] += header_options
return flags
- # override
- def generate(self):
- """
- Generate the .project and .cproject files.
- """
+ def validate_resources(self):
if not self.resources.linker_script:
raise NotSupportedException("No linker script found.")
- print
- print 'Create a GNU ARM Eclipse C++ managed project'
- print 'Project name: {0}'.format(self.project_name)
- print 'Target: {0}'.format(self.toolchain.target.name)
- print 'Toolchain: {0}'.format(self.TOOLCHAIN)
+ def create_jinja_ctx(self):
+
+ self.validate_resources()
self.resources.win_to_unix()
@@ -276,6 +270,20 @@ class GNUARMEclipse(Exporter):
# will be called repeatedly, to generate multiple UIDs.
'u': u,
}
+ return jinja_ctx
+
+ # override
+ def generate(self):
+ """
+ Generate the .project and .cproject files.
+ """
+ jinja_ctx = self.create_jinja_ctx()
+
+ print
+ print 'Create a GNU ARM Eclipse C++ managed project'
+ print 'Project name: {0}'.format(self.project_name)
+ print 'Target: {0}'.format(self.toolchain.target.name)
+ print 'Toolchain: {0}'.format(self.TOOLCHAIN)
self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx,
'.project', trim_blocks=True, lstrip_blocks=True)