EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Rowley Crossworks and running batch files before builds

Started by Darcy October 13, 2008
Hi all,

We're trying to implement a bit of auto-versioning but I'm having
trouble working out how to run a batch file when I build the project.
The batch file queries SVN (SubWCRev) and pulls out revision numbers,
dates, paths etc and creates a .h file that is then included by some
of the source files in the project.

Things I've tried (and the problems):
Compiler Pre Build Command: Runs the batch file with every single
source file in the project (works, but slows down compile time 10 fold)
Linker Pre Build Command: The .h file file is created too late in the
process
Staging Project Stage Command: Keeps thinking i'm creating directories
and tries to set read/write access and fails
Combining Project Stage Command: Same problem...

Note: Staging Projects and Combining Projects can be created and used
for tasks that the main project is dependant on.

Have I missed something? It seems like there are a half dozen
different way to achieve this but I can't get any one of them to work
quite how i'd like it to. The whole Staging Project dependancy made
complete sense but I couldn't figure out how to stop it from failing
to set read/write permissions on a non-existant directory. The project
didn't seem capable of simply running a batch file...

Another thought, if I have a version.c including the created
version_auto.h, and the compiler pre-build command for version.c calls
the batch file which creates version_auto.h... then the post-build
command for version.c touches version.c and version.h (changing their
last modified dates) then this should alway ensure that the files are
compiled the next time around.

This seems a bit convoluted :) Can anyone suggest a much simpler way?

Thanks
Darcy

An Engineer's Guide to the LPC2100 Series


Memfault Beyond the Launch