mbed-os for GR-LYCHEE
Dependents: mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more
tools/export/cdt/__init__.py@0:f782d9c66c49, 2018-02-02 (annotated)
- Committer:
- dkato
- Date:
- Fri Feb 02 05:42:23 2018 +0000
- Revision:
- 0:f782d9c66c49
mbed-os for GR-LYCHEE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:f782d9c66c49 | 1 | import re |
dkato | 0:f782d9c66c49 | 2 | |
dkato | 0:f782d9c66c49 | 3 | from os.path import join, exists, realpath, relpath, basename |
dkato | 0:f782d9c66c49 | 4 | from os import makedirs |
dkato | 0:f782d9c66c49 | 5 | |
dkato | 0:f782d9c66c49 | 6 | from tools.export.makefile import Makefile, GccArm, Armc5, IAR |
dkato | 0:f782d9c66c49 | 7 | |
dkato | 0:f782d9c66c49 | 8 | class Eclipse(Makefile): |
dkato | 0:f782d9c66c49 | 9 | """Generic Eclipse project. Intended to be subclassed by classes that |
dkato | 0:f782d9c66c49 | 10 | specify a type of Makefile. |
dkato | 0:f782d9c66c49 | 11 | """ |
dkato | 0:f782d9c66c49 | 12 | def generate(self): |
dkato | 0:f782d9c66c49 | 13 | """Generate Makefile, .cproject & .project Eclipse project file, |
dkato | 0:f782d9c66c49 | 14 | py_ocd_settings launch file, and software link .p2f file |
dkato | 0:f782d9c66c49 | 15 | """ |
dkato | 0:f782d9c66c49 | 16 | super(Eclipse, self).generate() |
dkato | 0:f782d9c66c49 | 17 | starting_dot = re.compile(r'(^[.]/|^[.]$)') |
dkato | 0:f782d9c66c49 | 18 | ctx = { |
dkato | 0:f782d9c66c49 | 19 | 'name': self.project_name, |
dkato | 0:f782d9c66c49 | 20 | 'elf_location': join('BUILD',self.project_name)+'.elf', |
dkato | 0:f782d9c66c49 | 21 | 'c_symbols': self.toolchain.get_symbols(), |
dkato | 0:f782d9c66c49 | 22 | 'asm_symbols': self.toolchain.get_symbols(True), |
dkato | 0:f782d9c66c49 | 23 | 'target': self.target, |
dkato | 0:f782d9c66c49 | 24 | 'include_paths': [starting_dot.sub('%s/' % self.project_name, inc) for inc in self.resources.inc_dirs], |
dkato | 0:f782d9c66c49 | 25 | 'load_exe': str(self.LOAD_EXE).lower() |
dkato | 0:f782d9c66c49 | 26 | } |
dkato | 0:f782d9c66c49 | 27 | |
dkato | 0:f782d9c66c49 | 28 | if not exists(join(self.export_dir,'eclipse-extras')): |
dkato | 0:f782d9c66c49 | 29 | makedirs(join(self.export_dir,'eclipse-extras')) |
dkato | 0:f782d9c66c49 | 30 | |
dkato | 0:f782d9c66c49 | 31 | |
dkato | 0:f782d9c66c49 | 32 | self.gen_file('cdt/pyocd_settings.tmpl', ctx, |
dkato | 0:f782d9c66c49 | 33 | join('eclipse-extras',self.target+'_pyocd_settings.launch')) |
dkato | 0:f782d9c66c49 | 34 | self.gen_file('cdt/necessary_software.tmpl', ctx, |
dkato | 0:f782d9c66c49 | 35 | join('eclipse-extras','necessary_software.p2f')) |
dkato | 0:f782d9c66c49 | 36 | |
dkato | 0:f782d9c66c49 | 37 | self.gen_file('cdt/.cproject.tmpl', ctx, '.cproject') |
dkato | 0:f782d9c66c49 | 38 | self.gen_file('cdt/.project.tmpl', ctx, '.project') |
dkato | 0:f782d9c66c49 | 39 | |
dkato | 0:f782d9c66c49 | 40 | |
dkato | 0:f782d9c66c49 | 41 | class EclipseGcc(Eclipse, GccArm): |
dkato | 0:f782d9c66c49 | 42 | LOAD_EXE = True |
dkato | 0:f782d9c66c49 | 43 | NAME = "Eclipse-GCC-ARM" |
dkato | 0:f782d9c66c49 | 44 | |
dkato | 0:f782d9c66c49 | 45 | class EclipseArmc5(Eclipse, Armc5): |
dkato | 0:f782d9c66c49 | 46 | LOAD_EXE = False |
dkato | 0:f782d9c66c49 | 47 | NAME = "Eclipse-Armc5" |
dkato | 0:f782d9c66c49 | 48 | |
dkato | 0:f782d9c66c49 | 49 | class EclipseIAR(Eclipse, IAR): |
dkato | 0:f782d9c66c49 | 50 | LOAD_EXE = True |
dkato | 0:f782d9c66c49 | 51 | NAME = "Eclipse-IAR" |
dkato | 0:f782d9c66c49 | 52 | |
dkato | 0:f782d9c66c49 | 53 |