Skip to content

Commit e07fcda

Browse files
authored
Merge pull request #3287 from sg-/make-build
Unify output directory for mbed-cli and exporters
2 parents a987cc0 + f0e3ff4 commit e07fcda

File tree

11 files changed

+26
-17
lines changed

11 files changed

+26
-17
lines changed

tools/export/cdt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def generate(self):
1414
super(Eclipse, self).generate()
1515
ctx = {
1616
'name': self.project_name,
17-
'elf_location': join('.build',self.project_name)+'.elf',
17+
'elf_location': join('BUILD',self.project_name)+'.elf',
1818
'c_symbols': self.toolchain.get_symbols(),
1919
'asm_symbols': self.toolchain.get_symbols(True),
2020
'target': self.target,

tools/export/iar/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ def build(project_name, log_name="build_log.txt", cleanup=True):
165165
os.remove(project_name + ".ewp")
166166
os.remove(project_name + ".ewd")
167167
os.remove(project_name + ".eww")
168+
# legacy output file location
168169
if exists('.build'):
169170
shutil.rmtree('.build')
171+
if exists('BUILD'):
172+
shutil.rmtree('BUILD')
170173

171174
if ret_code !=0:
172175
# Seems like something went wrong.

tools/export/iar/ewp.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
</option>
2121
<option>
2222
<name>ExePath</name>
23-
<state>$PROJ_DIR$\.build\Exe</state>
23+
<state>$PROJ_DIR$\BUILD\Exe</state>
2424
</option>
2525
<option>
2626
<name>ObjPath</name>
27-
<state>$PROJ_DIR$\.build\Obj</state>
27+
<state>$PROJ_DIR$\BUILD\Obj</state>
2828
</option>
2929
<option>
3030
<name>ListPath</name>
31-
<state>$PROJ_DIR$\.build\List</state>
31+
<state>$PROJ_DIR$\BUILD\List</state>
3232
</option>
3333
<option>
3434
<name>Variant</name>

tools/export/iar/iar_nucleo_f746zg.ewp.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<wantNonLocal>1</wantNonLocal>
1717
<debug>1</debug>
1818
<option>
19-
<state>$PROJ_DIR$\.build\iar_arm\Exe</state>
19+
<state>$PROJ_DIR$\BUILD\Exe</state>
2020
<name>ExePath</name>
2121
</option>
2222
<option>
23-
<state>$PROJ_DIR$\.build\iar_arm\Obj</state>
23+
<state>$PROJ_DIR$\BUILD\Obj</state>
2424
<name>ObjPath</name>
2525
</option>
2626
<option>
27-
<state>$PROJ_DIR$\.build\iar_arm\List</state>
27+
<state>$PROJ_DIR$\BUILD\List</state>
2828
<name>ListPath</name>
2929
</option>
3030
<option>

tools/export/iar/iar_rz_a1h.ewp.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<wantNonLocal>1</wantNonLocal>
1717
<debug>1</debug>
1818
<option>
19-
<state>$PROJ_DIR$\.build\iar_arm\Exe</state>
19+
<state>$PROJ_DIR$\BUILD\Exe</state>
2020
<name>ExePath</name>
2121
</option>
2222
<option>
23-
<state>$PROJ_DIR$\.build\iar_arm\Obj</state>
23+
<state>$PROJ_DIR$\BUILD\Obj</state>
2424
<name>ObjPath</name>
2525
</option>
2626
<option>
27-
<state>$PROJ_DIR$\.build\iar_arm\List</state>
27+
<state>$PROJ_DIR$\BUILD\List</state>
2828
<name>ListPath</name>
2929
</option>
3030
<option>

tools/export/makefile/Makefile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else
1313
RM = '$(SHELL)' -c "rm -rf \"$(1)\""
1414
endif
1515

16-
OBJDIR := .build
16+
OBJDIR := BUILD
1717
# Move to the build directory
1818
ifeq (,$(filter $(OBJDIR),$(notdir $(CURDIR))))
1919
.SUFFIXES:

tools/export/makefile/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ def build(project_name, log_name="build_log.txt", cleanup=True):
141141
if cleanup:
142142
remove("Makefile")
143143
remove(log_name)
144+
# legacy .build directory cleaned if exists
144145
if exists('.build'):
145146
shutil.rmtree('.build')
147+
if exists('BUILD'):
148+
shutil.rmtree('BUILD')
146149

147150
if ret_code != 0:
148151
# Seems like something went wrong.

tools/export/uvision/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,11 @@ def build(project_name, log_name='build_log.txt', cleanup=True):
226226
os.remove(log_name)
227227
os.remove(project_name+".uvprojx")
228228
os.remove(project_name+".uvoptx")
229+
# legacy .build directory cleaned if exists
229230
if exists('.build'):
230-
shutil.rmtree(".build")
231+
shutil.rmtree('.build')
232+
if exists('BUILD'):
233+
shutil.rmtree('BUILD')
231234

232235
# Returns 0 upon success, 1 upon a warning, and neither upon an error
233236
if ret_code != 0 and ret_code != 1:

tools/export/uvision/uvision.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
<NotGenerated>0</NotGenerated>
4747
<InvalidFlash>1</InvalidFlash>
4848
</TargetStatus>
49-
<OutputDirectory>.\.build\uvision5\</OutputDirectory>
49+
<OutputDirectory>.\BUILD\</OutputDirectory>
5050
<OutputName>{{name}}</OutputName>
5151
<CreateExecutable>1</CreateExecutable>
5252
<CreateLib>0</CreateLib>
5353
<CreateHexFile>0</CreateHexFile>
5454
<DebugInformation>1</DebugInformation>
5555
<BrowseInformation>1</BrowseInformation>
56-
<ListingPath>.\.build\uvision5\</ListingPath>
56+
<ListingPath>.\BUILD\</ListingPath>
5757
<HexFormatSelection>1</HexFormatSelection>
5858
<Merge32K>0</Merge32K>
5959
<CreateBatchFile>0</CreateBatchFile>

tools/memap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def parse_section_gcc(self, line):
138138
""" Parse data from a section of gcc map file
139139
140140
examples:
141-
0x00004308 0x7c ./.build/K64F/GCC_ARM/mbed-os/hal/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.o
142-
.text 0x00000608 0x198 ./.build/K64F/GCC_ARM/mbed-os/core/mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/HAL_CM4.o
141+
0x00004308 0x7c ./BUILD/K64F/GCC_ARM/mbed-os/hal/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.o
142+
.text 0x00000608 0x198 ./BUILD/K64F/GCC_ARM/mbed-os/core/mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/HAL_CM4.o
143143
144144
Positional arguments:
145145
line - the line to parse a section from

0 commit comments

Comments
 (0)