提交 033d254c 编写于 作者: B Bernard Xiong

[tools] rename KConfig menu name

上级 a1e5a3b3
menu "Real-time Kernel"
menu "RT-Thread Kernel"
config RT_NAME_MAX
int "The maximal size of kernel object name"
......
import os
# make rtconfig.h from .config
def mk_rtconfig(filename):
try:
config = file(filename)
except:
print 'open .config failed'
return
rtconfig = file('rtconfig.h', 'w')
rtconfig.write('#ifndef RT_CONFIG_H__\n')
rtconfig.write('#define RT_CONFIG_H__\n\n')
empty_line = 1
for line in config:
line = line.lstrip(' ').replace('\n', '').replace('\r', '')
if len(line) == 0: continue
if line[0] == '#':
if len(line) == 1:
if empty_line:
continue
rtconfig.write('\n')
empty_line = 1
continue
rtconfig.write('/*%s */\n' % line[1:])
empty_line = 0
else:
empty_line = 0
setting = line.split('=')
if len(setting) >= 2:
if setting[0].startswith('CONFIG_'):
setting[0] = setting[0][7:]
if setting[1] == 'y':
rtconfig.write('#define %s\n' % setting[0])
else:
rtconfig.write('#define %s %s\n' % (setting[0], setting[1]))
rtconfig.write('#endif\n')
rtconfig.close()
if __name__ == "__main__":
mk_rtconfig('.config')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册