Hi,
The default name of the .bin file is as same as the project name, I want to rename the .bin file, for example insert the date to the file name.
I thought that post-build maybe can be used , but i am not sure what's the right command and how it works.
is there any post-build command works for that?
Hi Matherine Wang,
I think that the following post created by our colleague Erich Styger might be helpful for you, it explains the usage of Multiple Post-Build Steps in eclipse:
Executing Multiple Commands as Post-Build Steps in Eclipse | MCU on Eclipse
You can also take a look to the related links at the end of the post.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Carlos, mutiple post-build steps and links are useful for me.
a new question, how can i add software version to the name of the .bin file using post-build step?
I have two options but i am not sure whether feasible:
1. define a macro or variable for software version in source code, and using the marco or variable in the post-build step, but i am not sure how to use it here.
2. define a build variable for software version, it's easy used in post-build step, but i don't know how to use it in the source code? :smileyhappy:
is any one of these two options feasible?
The post-build commands are just commands that would be executed from a command prompt. In this case, it would just be the DOS rename command:
rename <old filename> <new filename>
EDIT: Thought the date could be inserted by inserting %DATE% into the rename command, but it seems it doesn't work. Perhaps someone else could chime in on how to accomplish that.
Hi David,
Thanks, rename command does not work for me, i tried cope instead of rename, it can work:
copy ${PWD}\ProjName.elf ${PWD}\NewName_%date:~0,4%%date:~5,2%%date:~8,2%.elf
BTW, %DATE% works for me.