From 0d85f673edbfe34a209bff386f513737b1f55535 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Fri, 11 Jul 2014 11:13:22 +0300 Subject: [PATCH] Fixed compile with IAR Added get_dep_opt for ARM class --- workspace_tools/toolchains/__init__.py | 18 +++++++++++------- workspace_tools/toolchains/arm.py | 5 ++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/workspace_tools/toolchains/__init__.py b/workspace_tools/toolchains/__init__.py index d7abd4bf58..2cfdb06ab5 100644 --- a/workspace_tools/toolchains/__init__.py +++ b/workspace_tools/toolchains/__init__.py @@ -528,7 +528,7 @@ class mbedToolchain: self.compiled += 1 self.progress("compile", result['source'], build_update=True) - self.debug(result['command']) + self.debug("Command: %s" % ' '.join(result['command'])) self._compile_output([ result['code'], result['output'], @@ -581,11 +581,9 @@ class mbedToolchain: deps = self.parse_dependencies(dep_path) if len(deps) == 0 or self.need_update(object, deps): - - # Compile command = cc + ['-D%s' % s for s in self.get_symbols()] + ["-I%s" % i for i in includes] + ["-o", object, source] - if hasattr(self, "get_dep_opt"): + if asm_mode is False and hasattr(self, "get_dep_opt"): command.extend(self.get_dep_opt(dep_path)) if hasattr(self, "cc_extra"): @@ -602,6 +600,8 @@ class mbedToolchain: # Parse output for Warnings and Errors self.parse_output(stderr) + self.debug("Return: %s" % rc) + self.debug("Output: %s" % stderr) # Check return code if rc != 0: @@ -614,6 +614,7 @@ class mbedToolchain: command = self._compile_command(source, object, includes) if command is None: return True + self.debug("Command: %s" % ' '.join(command)) _, stderr, rc = run_cmd(command, dirname(object)) self._compile_output([rc, stderr, command]) @@ -654,7 +655,7 @@ class mbedToolchain: self.binary(r, elf, bin) if self.target.name.startswith('LPC'): - self.debug("LPC Patch %s" % filename) + self.debug("LPC Patch: %s" % filename) patch(bin) self.var("compile_succeded", True) @@ -666,9 +667,11 @@ class mbedToolchain: return bin def default_cmd(self, command): - self.debug(command) + self.debug("Command: %s" % ' '.join(command)) stdout, stderr, rc = run_cmd(command) - self.debug(stdout) + self.debug("Return: %s" % rc) + self.debug("Output: %s" % ' '.join(stdout)) + if rc != 0: for line in stderr.splitlines(): self.tool_error(line) @@ -682,6 +685,7 @@ class mbedToolchain: if self.VERBOSE: if type(message) is ListType: message = ' '.join(message) + message = "[DEBUG] " + message self.notify({'type': 'debug', 'message': message}) def cc_info(self, severity, file, line, message, target_name=None, toolchain_name=None): diff --git a/workspace_tools/toolchains/arm.py b/workspace_tools/toolchains/arm.py index b1d4564943..381f15763c 100644 --- a/workspace_tools/toolchains/arm.py +++ b/workspace_tools/toolchains/arm.py @@ -114,7 +114,10 @@ class ARM(mbedToolchain): match.group('line'), match.group('message') ) - + + def get_dep_opt(self, dep_path): + return ["--depend", dep_path] + def archive(self, objects, lib_path): self.default_cmd([self.ar, '-r', lib_path] + objects)