Boost logo

Boost-Build :

From: aulwelling_at_[hidden]
Date: 2007-01-24 17:07:42


Hi all,

I am generating a C++ file using a script (called generateCode.pl) that
parses through other C++ files looking for certain keywords. Right now
I have created a rule and actions to accomplish this:

rule generateCode ( target : sources * : properties * )
{
}
actions generateCode
{
# syntax: generateCode.pl outputFile inputFiles
  generateCode.pl $(<) $(>)
}

I then include the generated file inside a custom rule that builds a
library from a list of sources
rule mylib ( Libname : sources * )
{
  lib $(Libname)
    : $(sources)
      version.cc
    :
    ;

  make version.cc : $(sources) : generateCode ;
}

I have 2 questions:

First, I'd really like to pass the header files that each source file
depends on to my script as well. Is there some way to get this list
into a variable so I can tack that onto my list of sources?

Second, I couldn't make this work without the corresponding (and empty)
rule. Could someone explain why? I didn't see that as a requirement
for using the make rule.

Thanks,
Ashley


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk