Boost logo

Boost-Build :

From: Sven Van Echelpoel (sven.van.echelpoel_at_[hidden])
Date: 2008-08-19 03:14:21


I'm creating a generator for ANTLR using Boost.Build v2. By following
one of the samples I got everything to work, i.e. Boost.Build picks ups
any .g (grammar) file in the sources and generates the appropriate .cpp
and .h files. All I need right now is a way for adding the path to the
output directory to the requirements of target that has this .g file as
a source. How can I add an <include> feature from within the generator
rule? Most of what I learned about Boost.Build I got from pouring over
the code, but this one seems to elude me. Any help would be much

This is the generator rule I have so far:

rule antlr-compile-grammar
  local ANTLR_HOME = [ modules.peek : ANTLR_HOME ] ;
  local JARS = [ path.glob $(ANTLR_HOME)/lib : *.jar ] ;
  if [ ] = NT
      ANTLRCLASSPATH = [ string.join $(JARS) : ";" ] ;
      MV = ren ;
      ANTLRCLASSPATH = [ string.join $(JARS) : ":" ] ;
      MV = mv ;
actions antlr-compile-grammar
  "java" -classpath $(ANTLRCLASSPATH) org.antlr.Tool -fo $(<:D) $(>)
  "$(MV)" $(<:D)/$(<:B).c $(<)



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at