diff --git a/tools/export/sw4stm32/__init__.py b/tools/export/sw4stm32/__init__.py index 4d6ebe6738..4d7ca53d5d 100644 --- a/tools/export/sw4stm32/__init__.py +++ b/tools/export/sw4stm32/__init__.py @@ -371,12 +371,9 @@ class Sw4STM32(GNUARMEclipse): preproc_cmd = "" # Hack for Windows. Build fails if command contains parentheses. - if ('(' in self.toolchain.preproc[0] or ')' in self.toolchain.preproc[0]) and self.toolchain.preproc[0][0] != "'": - preproc_cmd = '"' + \ - self.toolchain.preproc[0] + '"' + " " + \ - " ".join(self.toolchain.preproc[1:]) - else: - preproc_cmd = " ".join(self.toolchain.preproc) + preproc_cmd = '"' + \ + self.toolchain.preproc[0] + '"' + " " + \ + " ".join(self.toolchain.preproc[1:]) for id in ['debug', 'release']: opts = {} diff --git a/tools/export/sw4stm32/makefile.targets.tmpl b/tools/export/sw4stm32/makefile.targets.tmpl index 1cff1cd355..da87905d02 100644 --- a/tools/export/sw4stm32/makefile.targets.tmpl +++ b/tools/export/sw4stm32/makefile.targets.tmpl @@ -1,8 +1,6 @@ # DO NOT REMOVE! Generated by the SW4STM32 exporter from the mbed project. -ifeq ($(strip $(PREPROC_CMD)),) -PREPROC_CMD := {{cpp_cmd}} -endif +PREPROC_CMD ?= {{cpp_cmd}} ldclean: {% for config, opts in options.iteritems() %}