Add `buildprog` target; other improvements
This commit is contained in:
parent
08d3aa86b7
commit
6800d63f4f
|
@ -12,10 +12,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
Builder for ST STM32 Series ARM microcontrollers.
|
||||
"""
|
||||
|
||||
from os.path import isfile, join
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
|
||||
|
@ -174,17 +170,16 @@ if "arduino" in env.subst("$PIOFRAMEWORK"):
|
|||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildProgram()
|
||||
|
||||
#
|
||||
# Target: Build the .bin file
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_elf = None
|
||||
if "nobuild" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_elf = env.BuildProgram()
|
||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
||||
|
||||
AlwaysBuild(env.Alias("nobuild", target_firm))
|
||||
target_buildprog = env.Alias("buildprog", target_firm)
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
@ -199,24 +194,25 @@ AlwaysBuild(target_size)
|
|||
#
|
||||
|
||||
if "mbed" in env.subst("$PIOFRAMEWORK") and not env.subst("$UPLOAD_PROTOCOL"):
|
||||
upload = env.Alias(
|
||||
["upload", "uploadlazy"], target_firm,
|
||||
target_upload = env.Alias(
|
||||
"upload", target_firm,
|
||||
[env.VerboseAction(env.AutodetectUploadPort,
|
||||
"Looking for upload disk..."),
|
||||
env.VerboseAction(env.UploadToDisk, "Uploading $SOURCE")])
|
||||
elif "arduino" in env.subst("$PIOFRAMEWORK"):
|
||||
upload = env.Alias(
|
||||
["upload", "uploadlazy"], target_firm,
|
||||
target_upload = env.Alias(
|
||||
"upload", target_firm,
|
||||
[env.VerboseAction(env.AutodetectUploadPort,
|
||||
"Looking for upload disk..."),
|
||||
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")])
|
||||
else:
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_firm,
|
||||
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE"))
|
||||
AlwaysBuild(upload)
|
||||
target_upload = env.Alias(
|
||||
"upload", target_firm,
|
||||
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE"))
|
||||
AlwaysBuild(target_upload)
|
||||
|
||||
#
|
||||
# Default targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
||||
Default([target_buildprog, target_size])
|
||||
|
|
Loading…
Reference in New Issue