summaryrefslogtreecommitdiff
path: root/tools/eclipse.py
diff options
context:
space:
mode:
authoryaxing.chen <[email protected]>2021-01-25 11:33:00 +0800
committeryaxing.chen <[email protected]>2021-01-25 11:33:00 +0800
commita77e99f7c226f0ad8bfc057fbcbe838b069e56e3 (patch)
tree63cda7715f9061d2bbc29e11fc78e002f8d57a42 /tools/eclipse.py
parent46a2e685a2bd8a1986fdb83a19771f890035a524 (diff)
fixbug:keep makefile.targets while it has existed
Diffstat (limited to 'tools/eclipse.py')
-rw-r--r--tools/eclipse.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/eclipse.py b/tools/eclipse.py
index b9d34782a1..0d8d465cbc 100644
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -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 = 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)