@@ -44,7 +44,8 @@ def generate(self):
44
44
self .resources .c_sources +
45
45
self .resources .cpp_sources ]
46
46
47
- libraries = [splitext (lib )[0 ][3 :] for lib in self .resources .libraries ]
47
+ libraries = [self .prepare_lib (basename (lib )) for lib
48
+ in self .resources .libraries ]
48
49
49
50
ctx = {
50
51
'name' : self .project_name ,
@@ -70,6 +71,7 @@ def generate(self):
70
71
'elf2bin_cmd' : "\' " + self .toolchain .elf2bin + "\' " ,
71
72
'link_script_ext' : self .toolchain .LINKER_EXT ,
72
73
'link_script_option' : self .LINK_SCRIPT_OPTION ,
74
+ 'user_library_flag' : self .USER_LIBRARY_FLAG ,
73
75
}
74
76
75
77
for key in ['include_paths' , 'library_paths' , 'linker_script' ,
@@ -108,6 +110,11 @@ class GccArm(Makefile):
108
110
NAME = 'Make-GCC-ARM'
109
111
TOOLCHAIN = "GCC_ARM"
110
112
LINK_SCRIPT_OPTION = "-T"
113
+ USER_LIBRARY_FLAG = "-L"
114
+
115
+ @staticmethod
116
+ def prepare_lib (libname ):
117
+ return "-l:" + libname
111
118
112
119
113
120
class Armc5 (Makefile ):
@@ -117,6 +124,11 @@ class Armc5(Makefile):
117
124
NAME = 'Make-ARMc5'
118
125
TOOLCHAIN = "ARM"
119
126
LINK_SCRIPT_OPTION = "--scatter"
127
+ USER_LIBRARY_FLAG = "--userlibpath "
128
+
129
+ @staticmethod
130
+ def prepare_lib (libname ):
131
+ return libname
120
132
121
133
122
134
class IAR (Makefile ):
@@ -126,3 +138,10 @@ class IAR(Makefile):
126
138
NAME = 'Make-IAR'
127
139
TOOLCHAIN = "IAR"
128
140
LINK_SCRIPT_OPTION = "--config"
141
+ USER_LIBRARY_FLAG = "-L"
142
+
143
+ @staticmethod
144
+ def prepare_lib (libname ):
145
+ if "lib" == libname [:3 ]:
146
+ libname = libname [3 :]
147
+ return "-l" + splitext (libname )[0 ]
0 commit comments