> I'm still not sure how I would go about implementing it. Let's say you have an include file: buildno.h: -------------- #define BUILDNO 1234 then you have a Perl script for example, something like: incbuild.pl: ---------------- #!/usr/bin/perl my ($filename) = @ARGV; open(FILE, '<', $filename) or die "Error: Could not open file \"$filename\" ($!)"; @incfile = readline(FILE); close(FILE); # now we just look for the BUILDNO definition and increase it's value open (FILE, '>', $filename) or die "Error: Could not overwrite file \"$filename\" ($!)"; foreach (@incfile) { if ( /^#define\s+BUILDNO\s+(\d+)/ ) { print FILE "#define BUILDNO ". $1+1 ."\n"; } else { print FILE; } } close(FILE); ...And now we can put this script to our project into the pre-build option: incbuildno.pl buildno.h Now we can inlucde this buildno.h into C or even into ASM projects with #include "buildno.h" And i think pretty much that's it... Tamas PS: I did not test this script yet, just quickly typed in into this mail so maybe it does not even work but I hope you got the idea. On Sat, Oct 25, 2008 at 7:30 PM, Vitaliy wrote: > Jan-Erik Soderholm wrote: > > The pre-build BAT file (or whatever) runs some > > program that increments a "version" an writes > > it to some ASM include file as an EQU statement. > > That ASM file is then #include'ed in the > > main application. > > I'm still not sure how I would go about implementing it. > > > > Now the question is if one realy wants the *version* > > to be incremented with every build. Maybe some > > "build" number... > > Yeah, that's exactly what I'm after. Normally, you have: > > .. > > I would want it to auto-increment the build number automatically, > preferably > only when it's a build as opposed to a make. > > Has anyone done this sort of thing in MPLAB? I've been incrementing the > build number manually for now... > > > Vitaliy > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist