Clone of official tools

Committer:
The Other Jimmy
Date:
Wed Jan 04 11:58:24 2017 -0600
Revision:
31:8ea194f6145b
Child:
35:da9c89f8be7d
Update tools to follow mbed-os tools release 5.3.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
The Other Jimmy 31:8ea194f6145b 1 from os.path import join, exists, realpath, relpath, basename
The Other Jimmy 31:8ea194f6145b 2 from os import makedirs
The Other Jimmy 31:8ea194f6145b 3
The Other Jimmy 31:8ea194f6145b 4 from tools.export.makefile import Makefile, GccArm, Armc5, IAR
The Other Jimmy 31:8ea194f6145b 5
The Other Jimmy 31:8ea194f6145b 6 class Eclipse(Makefile):
The Other Jimmy 31:8ea194f6145b 7 """Generic Eclipse project. Intended to be subclassed by classes that
The Other Jimmy 31:8ea194f6145b 8 specify a type of Makefile.
The Other Jimmy 31:8ea194f6145b 9 """
The Other Jimmy 31:8ea194f6145b 10 def generate(self):
The Other Jimmy 31:8ea194f6145b 11 """Generate Makefile, .cproject & .project Eclipse project file,
The Other Jimmy 31:8ea194f6145b 12 py_ocd_settings launch file, and software link .p2f file
The Other Jimmy 31:8ea194f6145b 13 """
The Other Jimmy 31:8ea194f6145b 14 super(Eclipse, self).generate()
The Other Jimmy 31:8ea194f6145b 15 ctx = {
The Other Jimmy 31:8ea194f6145b 16 'name': self.project_name,
The Other Jimmy 31:8ea194f6145b 17 'elf_location': join('BUILD',self.project_name)+'.elf',
The Other Jimmy 31:8ea194f6145b 18 'c_symbols': self.toolchain.get_symbols(),
The Other Jimmy 31:8ea194f6145b 19 'asm_symbols': self.toolchain.get_symbols(True),
The Other Jimmy 31:8ea194f6145b 20 'target': self.target,
The Other Jimmy 31:8ea194f6145b 21 'include_paths': self.resources.inc_dirs,
The Other Jimmy 31:8ea194f6145b 22 'load_exe': str(self.LOAD_EXE).lower()
The Other Jimmy 31:8ea194f6145b 23 }
The Other Jimmy 31:8ea194f6145b 24
The Other Jimmy 31:8ea194f6145b 25 if not exists(join(self.export_dir,'eclipse-extras')):
The Other Jimmy 31:8ea194f6145b 26 makedirs(join(self.export_dir,'eclipse-extras'))
The Other Jimmy 31:8ea194f6145b 27
The Other Jimmy 31:8ea194f6145b 28
The Other Jimmy 31:8ea194f6145b 29 self.gen_file('cdt/pyocd_settings.tmpl', ctx,
The Other Jimmy 31:8ea194f6145b 30 join('eclipse-extras',self.target+'_pyocd_settings.launch'))
The Other Jimmy 31:8ea194f6145b 31 self.gen_file('cdt/necessary_software.tmpl', ctx,
The Other Jimmy 31:8ea194f6145b 32 join('eclipse-extras','necessary_software.p2f'))
The Other Jimmy 31:8ea194f6145b 33
The Other Jimmy 31:8ea194f6145b 34 self.gen_file('cdt/.cproject.tmpl', ctx, '.cproject')
The Other Jimmy 31:8ea194f6145b 35 self.gen_file('cdt/.project.tmpl', ctx, '.project')
The Other Jimmy 31:8ea194f6145b 36
The Other Jimmy 31:8ea194f6145b 37
The Other Jimmy 31:8ea194f6145b 38 class EclipseGcc(Eclipse, GccArm):
The Other Jimmy 31:8ea194f6145b 39 LOAD_EXE = True
The Other Jimmy 31:8ea194f6145b 40 NAME = "Eclipse-GCC-ARM"
The Other Jimmy 31:8ea194f6145b 41
The Other Jimmy 31:8ea194f6145b 42 class EclipseArmc5(Eclipse, Armc5):
The Other Jimmy 31:8ea194f6145b 43 LOAD_EXE = False
The Other Jimmy 31:8ea194f6145b 44 NAME = "Eclipse-Armc5"
The Other Jimmy 31:8ea194f6145b 45
The Other Jimmy 31:8ea194f6145b 46 class EclipseIAR(Eclipse, IAR):
The Other Jimmy 31:8ea194f6145b 47 LOAD_EXE = True
The Other Jimmy 31:8ea194f6145b 48 NAME = "Eclipse-IAR"
The Other Jimmy 31:8ea194f6145b 49
The Other Jimmy 31:8ea194f6145b 50