示例#1
0
target_elf = env.BuildProgram()
AlwaysBuild(target_elf)

#
# Target: Build the .bin file
#
_name = env.get("PROGNAME")

target_bin = env.ElfToBin(join("$BUILD_DIR", _name), target_elf)

# Target: Build the .hex file
#
target_hex = env.ElfToHex(join("$BUILD_DIR", _name), target_elf)
# Target: Build the .lst file
#
target_lst = env.ElfToLst(join("$BUILD_DIR", _name), target_elf)

#
# Target: Upload firmware
#
upload = env.Alias(["upload"], target_bin, "$UPLOADCMD")
AlwaysBuild(upload)

#
# Target: Print binary size
#

target_size = env.Alias(
    "size", target_elf,
    env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE"))