Clone of official tools

Revision:
47:21ae3e5a7128
Parent:
43:2a7da56ebd24
diff -r e502676b7f84 -r 21ae3e5a7128 export/makefile/__init__.py
--- a/export/makefile/__init__.py	Thu Feb 04 15:25:02 2021 +0100
+++ b/export/makefile/__init__.py	Thu Feb 04 17:17:13 2021 +0100
@@ -18,7 +18,7 @@
 from builtins import str
 
 from os.path import splitext, basename, relpath, join, abspath, dirname,\
-    exists
+    exists, normpath
 from os import remove
 import sys
 from subprocess import check_output, CalledProcessError, Popen, PIPE
@@ -73,7 +73,7 @@
 
         self.resources.win_to_unix()
 
-        to_be_compiled = [splitext(src)[0] + ".o" for src in
+        to_be_compiled = [normpath(splitext(src)[0]) + ".o" for src in
                           self.resources.s_sources +
                           self.resources.c_sources +
                           self.resources.cpp_sources]
@@ -87,9 +87,10 @@
             'name': self.project_name,
             'to_be_compiled': to_be_compiled,
             'object_files': self.resources.objects,
-            'include_paths': list(set(self.resources.inc_dirs)),
+            'include_paths': list(set([ normpath(p) for p
+                                        in self.resources.inc_dirs])),
             'library_paths': self.resources.lib_dirs,
-            'linker_script': self.resources.linker_script,
+            'linker_script': normpath(self.resources.linker_script),
             'libraries': libraries,
             'ld_sys_libs': sys_libs,
             'hex_files': self.resources.hex_files,
@@ -138,7 +139,9 @@
         new_asm_flags = []
         for flag in ctx['asm_flags']:
             if flag.startswith('-I'):
-                new_asm_flags.append("-I{}/{}".format(ctx['vpath'][0], flag[2:]))
+                new_asm_flags.append("-I"+
+                                     normpath(join(ctx['vpath'][0],
+                                                   flag[2:])))
             elif flag.startswith('--preinclude='):
                 new_asm_flags.append("--preinclude={}/{}".format(ctx['vpath'][0], flag[13:]))
             else: