Subject: Re: [Boost-build] make rule with extra variables + figuring out the full target path
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-02-10 15:50:32
On Wednesday 10 February 2010 22:32:59 Fadi Beyrouti wrote:
> > >
> > > 1. Is there a way to get that path?
> > > 2. Is there a better/cleaner way of doing what I want to do?
> > Does it work if you add
> > constant EXTRA_VAR : SOME_VALUE ;
> > somewhere in your Jamfile? In fact, even
> > EXTRA_VAR = SOME_VALUE ;
> > will work, but 'constant' are inherited by child Jamfiles, so is better.
> Thanks Volodya for the clarifications.
> This actually works only partially. The reason is that I am actually inside a
> for loop
> for local TARGET in $(TARGETS)
> make $(TARGET).myext :
> my_source_file :
> @my_action :
> <location>"dir1/dir2/dir3" ;
> constant EXTRA_VAR : $(TARGET) ;
> unfortunately $(EXTRA_VAR) always takes the value of the last element of the
> list of $(TARGETS). This is kind of why I use the "on" construct. Is there any
> way of getting that target passed to the action?
Oh, your original email did not mention the loop. Try this:
import feature ;
import toolset ;
feature.feature whatever : : free ;
toolset.flags my_action EXTRA_VAR : <whatever> ;
and then use <whatever>$(TARGET) as extra requirement when defining a 'make' metatarget.
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