[jamming] Pre-parsing source files before building

Chris syndicate_dragon at yahoo.com
Mon Aug 20 10:17:51 PDT 2007


We have a tool which generates some of our source files. Unfortunately, the files need to be touched up a bit before our cranky compiler can use them. I am trying to make this pre-parsing an automated part of the jam build process, but I'm having some trouble finding the right magic words to make it work. The problem seems to be that the files may already exist and need not be parsed again if they have not changed from the previous build. I'm having a hard time coming up with a rule/dependencies that can detect if generated source files are newer than the final target and run the pre-parsing script on them before compiling them. The script we have automatically fixes all of the generated files, so it only needs to run once.

Here's what I have so far, which seems to work except for the pre-parsing step. AUXSRC are the sources generated by the tool. There are custom actions for Cc and Link to deal with our stupid compiler. I can detail those if someone thinks it necessary, but for brevity they are omitted here. The "Convert" rule/action handles converting the linker output to our download format.
 
LINKTARGET = flash.hex
FINALTARGET = app.bin
MAINSRC = srcfile1.c srcfile2.c ;
AUXSRC = genfile1.c genfile2.c ;
SRC = $(MAINSRC) $(AUXSRC) ;

Main $(LINKTARGET) : $(SRC) ;
Convert $(FINALTARGET) : $(LINKTARGET) ; 
Depends all : $(FINALTARGET) ;


Thanks,
Chris
       
---------------------------------
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.perforce.com/pipermail/jamming/attachments/20070820/bcdf7750/attachment.html


More information about the jamming mailing list