Since uVision does not support
__BUILD__
I need a kind of BUILD-Counter which increments automatically. The Build should be an array of chars which can be included into the project. Any idea?
Could you just use __DATE__ and __TIME__ instead?
If not, you would need some external utility that creates/modifies a suitable 'C' source or header file and gets run with each build.
Then you either have the 'C' file in your project, or have another 'C' file include the header.
You could do this with a 'Custom Translator' - see: www.keil.com/.../uv3_ca_usecustomtranslator.htm
__DATE__ and __TIME__ is no chice. Using the 'Custom Translator' is a way I can see. Now I need a tiny program which I can call from the translator, which reads a text file (e.g. build.txt), which contains only "1" for the first call, increment the number and write it back. Does anybody have such a tool?
The bad thing about __DATE__ and __TIME__ is that they require the specific file to be always recompiled, or you will get multiple binaries with the same build info.
About a program to count up the contents of a text file - yes I have such a program, but it takes me some time to move the code from a unix machine to a windows machine, build it, copy the binary to a web server somewhere and then post a link to you.
As a developer, you should be able to write your own tiny app in 2-3 minutes max.
"The bad (sic) thing about __DATE__ and __TIME__ is that they require the specific file to be always recompiled"
Yes, of course; but that's easily achieved in uVision - you just check 'always build' in the file options.
I routinely have a file called "timestamp.c" for exactly this purpose!
I think you would have to do the same with the Custom Translator?
Why not?
(I'm sure there are plenty of reasons - but which one is yours?)
As a developer, you should be able to write your own tiny app in 2-3 minutes max. Yes - but - I'm an embedded programmer and don't have any Windows-Compilers. That's why I'm asking for someones help.
What do you mean? Reason for what? Not programming Windows?
Interesting - I must have missed that I can force "always build" for a single file. A lot of IDE don't support that, so the user must remember to do a full build, or use a pre-build rule to delete the output file.
One system I used - I have forgotten which - did always run the pre-build rules before each debugging session, so it always complained that the target binary was old :)
I don't think I could manage to be absolutely 100% purely an embedded programmer. There are too many free compilers and I too often have ideas I want to try and that should/must be run on a Windoze, Linux or BSD box.
I can select gcc, Borland, Watcom or a couple of other reasonably good - and free - compilers. Then there is Perl, PHP, Python, ...
Without the ability to create utilities and customize our environments, a lot of the joy of this job niche is lost.
I understand your point of view. In the earlier days, I also used to program with TurboC, Borland-C and ever VB. But because I'm coming from the hardware corner, I prefere to develop hardware and software. In cases like this, I'm looking around for some help ;-)
"What do you mean? Reason for what?"
Read the subject line for the specific post...
;-)