🏗️ Refactor build encrypt / rename (#22124)

This commit is contained in:
Scott Lahteine
2021-06-13 15:43:33 -05:00
committed by Scott Lahteine
parent 14ffc66c45
commit 2aa35577f2
8 changed files with 59 additions and 63 deletions

View File

@ -6,10 +6,13 @@ from os.path import join
Import("env")
env.AddPostAction(
"$BUILD_DIR/${PROGNAME}.elf",
env.VerboseAction(" ".join([
"$OBJCOPY", "-O", "srec",
"\"$BUILD_DIR/${PROGNAME}.elf\"", "\"$BUILD_DIR/${PROGNAME}.srec\""
]), "Building " + join("$BUILD_DIR", "${PROGNAME}.srec"))
)
board = env.BoardConfig()
board_keys = board.get("build").keys()
if 'encrypt' in board_keys:
env.AddPostAction(
join("$BUILD_DIR", "${PROGNAME}.bin"),
env.VerboseAction(" ".join([
"$OBJCOPY", "-O", "srec",
"\"$BUILD_DIR/${PROGNAME}.elf\"", "\"" + join("$BUILD_DIR", board.get("build.encrypt")) + "\""
]), "Building $TARGET")
)