From ebc479f145d0804f0fd050aeccaa4f3481aa870c Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Mon, 29 Nov 2021 17:35:14 +0300 Subject: [PATCH] pio: fix indirect dependency on the build-and-copy .bin --- code/scripts/espurna_utils/build.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/scripts/espurna_utils/build.py b/code/scripts/espurna_utils/build.py index be56f86b..e2dfd9c3 100644 --- a/code/scripts/espurna_utils/build.py +++ b/code/scripts/espurna_utils/build.py @@ -50,17 +50,20 @@ def firmware_destination(env): def app_add_target_build_and_copy(env): from SCons.Script import Copy - copy_dest = firmware_destination(env) - copy = env.Command( - copy_dest, "${BUILD_DIR}/${PROGNAME}.bin", Copy("$TARGET", "$SOURCE") - ) + target = firmware_destination(env) + env.AddTarget( "build-and-copy", - copy_dest, - actions=None, # command invocation already handles this + "${BUILD_DIR}/${PROGNAME}.bin", + env.Command( + target, + "${BUILD_DIR}/${PROGNAME}.bin", + Copy("$TARGET", "$SOURCE") + ), title="Build firmware.bin and store a copy", description="Build and store firmware.bin as $ESPURNA_BUILD_DESTINATION/espurna--$ESPURNA_BUILD_NAME.bin (default destination is $PROJECT_DIR)", ) + env.Alias("build-and-copy", target) # TODO: *could* be a Builder object, just the same it will detect targets via src_suffix & suffix properties