Merge pull request #4264 from margguo/fixbug/keep_makefile_targets

fixbug:keep makefile.targets while it has existed
This commit is contained in:
Bernard Xiong 2021-01-25 16:22:19 +08:00 committed by GitHub
commit 02a2670f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -523,10 +523,15 @@ def TargetEclipse(env, reset=False, prj_name=None):
# generate projcfg.ini file
if not os.path.exists('.settings/projcfg.ini'):
if os.path.exists("template.uvprojx"):
file = os.path.abspath("template.uvprojx")
# if search files with uvprojx or uvproj suffix
items = os.listdir(".")
if len(items) > 0:
for item in items:
if item.endswith(".uvprojx") or item.endswith(".uvproj"):
file = os.path.abspath(item)
break
else:
file = os.path.abspath("template.uvproj")
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:
print('Fail!')
@ -540,9 +545,10 @@ def TargetEclipse(env, reset=False, prj_name=None):
return
# add clean2 target to fix issues when files too many
if rt_studio.gen_makefile_targets(os.path.abspath("makefile.targets")) is False:
print('Fail!')
return
if not os.path.exists('makefile.targets'):
if rt_studio.gen_makefile_targets(os.path.abspath("makefile.targets")) is False:
print('Fail!')
return
project = ProjectInfo(env)

View File

@ -238,9 +238,9 @@ def get_mcu_info(uvproj_file_path):
if result:
return result.group(1)
else:
return ""
return "unknown"
else:
return ""
return "unknown"
def gen_makefile_targets(output_file_path):