1

I made at .bat file that modifies a .h file containing a #define BUILD_VER so that it gets incremented every time I build.

There is also a #define MAJOR_VER in the same .h file that defines the version that the customers will see.

I'm trying to figure out a way to get the MAJOR_VER and BUILD_VER attached the to the binary output file (I'm using MSP430's so the output is a .txt files.)

So with something like this

#define MAJOR_VER 22
#define BUILD_VER 4321

...and building "Project_A"

"Project_A.txt" <== current default behaviour

"Project_A_V22_4321.txt" <==What I'm looking for

It would be nice if I could set an IDE variable using these #defines somehow.

This posts answers how to create custom IDE variables, which I didn't see the last time I started looking into this IAR project variable like $PROJ_DIR$

I know I could just write another .bat script to modify the file name, but this seems cleaner to me. And a little more obvious if I were new to the project.

Any thoughts?

Community
  • 1
  • 1
  • I usually don't do this on normal write/build/test cycle. Instead I have written a deployment script which is called manually from the command line when I want to create the production build. So for me it's separate action, but you perhaps could attach script to post build action? I don't *think* IAR Workbench supports this kind of post build processing out of the box. – user694733 May 15 '17 at 06:23

0 Answers0