From 83f1e380b90e87e3da37c5bea21dee7cd5962a80 Mon Sep 17 00:00:00 2001 From: James Churchill Date: Tue, 24 Feb 2015 21:02:25 +1000 Subject: [PATCH] Fix duplicate source includes and normalise trailing slash on input path --- CubeMX2Makefile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CubeMX2Makefile.py b/CubeMX2Makefile.py index ce198bb..7b1d4d5 100644 --- a/CubeMX2Makefile.py +++ b/CubeMX2Makefile.py @@ -44,7 +44,7 @@ sys.stderr.write("Unable to load template filer\r\n") sys.exit(C2M_ERR_LOAD_TEMPLATE) -proj_folder = sys.argv[1] +proj_folder = os.path.abspath(sys.argv[1]) if not os.path.isdir(proj_folder): sys.stderr.write("STM32CubeMX \"Toolchain Folder Location\" %s not found\r\n" % proj_folder) sys.exit(C2M_ERR_INVALID_COMMANDLINE) @@ -67,6 +67,7 @@ sources = [] for node in nodes: sources.append(re.sub(r'^PARENT-2-PROJECT_LOC/', '', node.text)) +sources=list(set(sources)) sources.sort() c_sources = 'C_SOURCES =' asm_sources = 'ASM_SOURCES ='