MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / MDK45Project

Function MDK45Project

tools/targets/keil.py:219–307  ·  view source on GitHub ↗
(env, tree, target, script)

Source from the content-addressed store, hash-verified

217
218# The common part of making MDK4/5 project
219def MDK45Project(env, tree, target, script):
220 project_path = os.path.dirname(os.path.abspath(target))
221
222 root = tree.getroot()
223 out = open(target, 'w')
224 out.write('<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n')
225
226 CPPPATH = []
227 CPPDEFINES = env.get('CPPDEFINES', [])
228 LINKFLAGS = ''
229 CXXFLAGS = ''
230 CCFLAGS = ''
231 CFLAGS = ''
232 ProjectFiles = []
233
234 # add group
235 groups = tree.find('Targets/Target/Groups')
236 if groups is None:
237 groups = SubElement(tree.find('Targets/Target'), 'Groups')
238 groups.clear() # clean old groups
239 for group in script:
240 group_tree = MDK4AddGroup(ProjectFiles, groups, group['name'], group['src'], project_path, group)
241
242 # get each include path
243 if 'CPPPATH' in group and group['CPPPATH']:
244 if CPPPATH:
245 CPPPATH += group['CPPPATH']
246 else:
247 CPPPATH += group['CPPPATH']
248
249 # get each group's link flags
250 if 'LINKFLAGS' in group and group['LINKFLAGS']:
251 if LINKFLAGS:
252 LINKFLAGS += ' ' + group['LINKFLAGS']
253 else:
254 LINKFLAGS += group['LINKFLAGS']
255
256 # get each group's CXXFLAGS flags
257 if 'CXXFLAGS' in group and group['CXXFLAGS']:
258 if CXXFLAGS:
259 CXXFLAGS += ' ' + group['CXXFLAGS']
260 else:
261 CXXFLAGS += group['CXXFLAGS']
262
263 # get each group's CCFLAGS flags
264 if 'CCFLAGS' in group and group['CCFLAGS']:
265 if CCFLAGS:
266 CCFLAGS += ' ' + group['CCFLAGS']
267 else:
268 CCFLAGS += group['CCFLAGS']
269
270 # get each group's CFLAGS flags
271 if 'CFLAGS' in group and group['CFLAGS']:
272 if CFLAGS:
273 CFLAGS += ' ' + group['CFLAGS']
274 else:
275 CFLAGS += group['CFLAGS']
276

Callers 2

MDK4ProjectFunction · 0.85
MDK5ProjectFunction · 0.85

Calls 11

_make_path_relativeFunction · 0.90
xml_indentFunction · 0.90
MDK4AddGroupFunction · 0.85
MDK4AddLibToGroupFunction · 0.85
MDK4AddGroupForFNFunction · 0.85
clearMethod · 0.80
openFunction · 0.50
setFunction · 0.50
writeMethod · 0.45
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected