Skip to content

Commit 84ad98a

Browse files
committed
Add buildprog target; other improvements
1 parent 51665a5 commit 84ad98a

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

builder/main.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""
16-
Builder for Teensy boards
17-
"""
18-
1915
from os.path import isfile, join
2016

2117
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
@@ -211,17 +207,16 @@
211207
# Target: Build executable and linkable firmware
212208
#
213209

214-
target_elf = env.BuildProgram()
215-
216-
#
217-
# Target: Build the firmware file
218-
#
219-
220-
if "uploadlazy" in COMMAND_LINE_TARGETS:
210+
target_elf = None
211+
if "nobuild" in COMMAND_LINE_TARGETS:
221212
target_firm = join("$BUILD_DIR", "firmware.hex")
222213
else:
214+
target_elf = env.BuildProgram()
223215
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
224216

217+
AlwaysBuild(env.Alias("nobuild", target_firm))
218+
target_buildprog = env.Alias("buildprog", target_firm)
219+
225220
#
226221
# Target: Print binary size
227222
#
@@ -235,14 +230,15 @@
235230
# Target: Upload by default firmware file
236231
#
237232

238-
upload = env.Alias(["upload", "uploadlazy"], target_firm,
239-
[env.VerboseAction("$UPLOADHEXCMD", "Uploading $SOURCE")] +
240-
([env.VerboseAction("$REBOOTER", "Rebooting...")]
241-
if "REBOOTER" in env else []))
242-
AlwaysBuild(upload)
233+
target_upload = env.Alias(
234+
"upload", target_firm,
235+
[env.VerboseAction("$UPLOADHEXCMD", "Uploading $SOURCE")] +
236+
([env.VerboseAction("$REBOOTER", "Rebooting...")]
237+
if "REBOOTER" in env else []))
238+
AlwaysBuild(target_upload)
243239

244240
#
245241
# Default targets
246242
#
247243

248-
Default([target_firm, target_size])
244+
Default([target_buildprog, target_size])

0 commit comments

Comments
 (0)