fixbug:keep makefile.targets while it has existed
This commit is contained in:
parent
46a2e685a2
commit
a77e99f7c2
|
@ -523,10 +523,15 @@ def TargetEclipse(env, reset=False, prj_name=None):
|
||||||
|
|
||||||
# generate projcfg.ini file
|
# generate projcfg.ini file
|
||||||
if not os.path.exists('.settings/projcfg.ini'):
|
if not os.path.exists('.settings/projcfg.ini'):
|
||||||
if os.path.exists("template.uvprojx"):
|
# if search files with uvprojx or uvproj suffix
|
||||||
file = os.path.abspath("template.uvprojx")
|
items = os.listdir(".")
|
||||||
|
if len(items) > 0:
|
||||||
|
for item in items:
|
||||||
|
if item.endswith(".uvprojx") or item.endswith(".uvproj"):
|
||||||
|
file = item
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
file = os.path.abspath("template.uvproj")
|
file = ""
|
||||||
chip_name = rt_studio.get_mcu_info(file)
|
chip_name = rt_studio.get_mcu_info(file)
|
||||||
if rt_studio.gen_projcfg_ini_file(chip_name, prj_name, os.path.abspath(".settings/projcfg.ini")) is False:
|
if rt_studio.gen_projcfg_ini_file(chip_name, prj_name, os.path.abspath(".settings/projcfg.ini")) is False:
|
||||||
print('Fail!')
|
print('Fail!')
|
||||||
|
@ -540,9 +545,10 @@ def TargetEclipse(env, reset=False, prj_name=None):
|
||||||
return
|
return
|
||||||
|
|
||||||
# add clean2 target to fix issues when files too many
|
# add clean2 target to fix issues when files too many
|
||||||
if rt_studio.gen_makefile_targets(os.path.abspath("makefile.targets")) is False:
|
if not os.path.exists('makefile.targets'):
|
||||||
print('Fail!')
|
if rt_studio.gen_makefile_targets(os.path.abspath("makefile.targets")) is False:
|
||||||
return
|
print('Fail!')
|
||||||
|
return
|
||||||
|
|
||||||
project = ProjectInfo(env)
|
project = ProjectInfo(env)
|
||||||
|
|
||||||
|
|
|
@ -238,9 +238,9 @@ def get_mcu_info(uvproj_file_path):
|
||||||
if result:
|
if result:
|
||||||
return result.group(1)
|
return result.group(1)
|
||||||
else:
|
else:
|
||||||
return ""
|
return "unknown"
|
||||||
else:
|
else:
|
||||||
return ""
|
return "unknown"
|
||||||
|
|
||||||
|
|
||||||
def gen_makefile_targets(output_file_path):
|
def gen_makefile_targets(output_file_path):
|
||||||
|
|
Loading…
Reference in New Issue