Boost logo

Boost-Build :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-03-31 19:32:39


I would like to have a target (an XML catalog) that is both ALWAYS and
NOUPDATE, meaning that:
1) The action for this target is always executed (ALWAYS does this)
2) The action for this target is executed before anything that depends on it
(i.e., any target built via XSLT) (the generated dependency does this)
3) Regeneration of this target does not result in regeneration of its
dependencies (NOUPDATE does this)

I can get any two of three, but not all three. It seems that the combination
of ALWAYS and NOUPDATE should do this.

Here's a short testcase: create a file foo.txt (or mark the target NOTFILE;
doesn't matter) and execute bjam twice on this Jamfile:

rule make-bar ( target : source )
{
ALWAYS $(source) ;
NOUPDATE $(source) ;
DEPENDS $(target) : $(source) ;
make-bar-action $(target) : $(source) ;
}

actions make-bar-action
{
echo "Making a bar from a foo" > bar.txt
}

make-bar bar.txt : foo.txt ;
DEPENDS all : bar.txt ;

The first time through, bar.txt should be generated because it doesn't exist.
The second time through, bar.txt should not be regenerated because it's only
dependency, foo.txt, is marked "NOUPDATE". Note that the ALWAYS foo.txt
doesn't make much sense here: in the real example, foo.txt is generated from
module settings, so we need to generate it every time.

My questions are:
1) Is there a way to do this without hacking Jam?
2) Would a Jam patch be accepted to deal with ALWAYS + NOUPDATE with the
semantics above?

Doug

 


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