forked from bigtreetech/BIGTREETECH-TouchScreenFirmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MarlinBft - custom short (8+3) firmware name and bin output support (b…
…igtreetech#1037) * Custom short firmware name * Expand HARDWARE_SHORT descriptions to all env
- Loading branch information
1 parent
9fb7bb4
commit e1ce923
Showing
4 changed files
with
58 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Import("env") | ||
import shutil | ||
|
||
def make_short_file(source, target, env): | ||
print("Generating firmware with short file name...") | ||
buildDir = env.subst('$BUILD_DIR') | ||
build_flags = env.ParseFlags(env['BUILD_FLAGS']) | ||
flags = {k: v for (k, v) in build_flags.get("CPPDEFINES")} | ||
filename = flags.get("HARDWARE") + "." + flags.get("SOFTWARE_VERSION") | ||
filename_short = flags.get("HARDWARE_SHORT") + flags.get("SOFTWARE_VERSION_SHORT") | ||
# do some actions | ||
shutil.copyfile(buildDir+"/"+filename+".bin", buildDir+"/"+filename_short+".new") | ||
print("Done.") | ||
|
||
env.AddPostAction("buildprog", make_short_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters