equal
deleted
inserted
replaced
169 |
169 |
170 """ % locals() |
170 """ % locals() |
171 |
171 |
172 # write generated content to python file |
172 # write generated content to python file |
173 runtimefile_path = os.path.join(buildpath, |
173 runtimefile_path = os.path.join(buildpath, |
174 "runtime_%s.py"%location_str) |
174 "runtime_%s.py" % location_str) |
175 runtimefile = open(runtimefile_path, 'w') |
175 runtimefile = open(runtimefile_path, 'w') |
176 runtimefile.write(PyFileContent.encode('utf-8')) |
176 runtimefile.write(PyFileContent.encode('utf-8')) |
177 runtimefile.close() |
177 runtimefile.close() |
178 |
178 |
179 # C code for safe global variables access |
179 # C code for safe global variables access |
277 void __publish_%(location_str)s(void){ |
277 void __publish_%(location_str)s(void){ |
278 %(varpub)s |
278 %(varpub)s |
279 } |
279 } |
280 """ % locals() |
280 """ % locals() |
281 |
281 |
282 Gen_PyCfile_path = os.path.join(buildpath, "PyCFile_%s.c"%location_str) |
282 Gen_PyCfile_path = os.path.join(buildpath, "PyCFile_%s.c" % location_str) |
283 pycfile = open(Gen_PyCfile_path,'w') |
283 pycfile = open(Gen_PyCfile_path,'w') |
284 pycfile.write(PyCFileContent) |
284 pycfile.write(PyCFileContent) |
285 pycfile.close() |
285 pycfile.close() |
286 |
286 |
287 matiec_CFLAGS = '"-I%s"'%os.path.abspath( |
287 matiec_CFLAGS = '"-I%s"' % os.path.abspath( |
288 self.GetCTRoot().GetIECLibPath()) |
288 self.GetCTRoot().GetIECLibPath()) |
289 |
289 |
290 return ([(Gen_PyCfile_path, matiec_CFLAGS)], |
290 return ([(Gen_PyCfile_path, matiec_CFLAGS)], |
291 "", |
291 "", |
292 True, |
292 True, |
293 ("runtime_%s.py"%location_str, file(runtimefile_path,"rb"))) |
293 ("runtime_%s.py" % location_str, file(runtimefile_path,"rb"))) |
294 |
294 |