Boost logo

Boost-Build :

Subject: Re: [Boost-build] REBUILDS rule help
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-11-19 20:39:18


AMDG

On 11/19/2012 03:45 PM, Nogradi, Chris wrote:
> Anyone know why this does not work i.e. when $(target) is updated, file.c is NOT deleted:
>
> rule gen-ucfg ( target : source : properties * )
> {
> common.Clean clean : file.c ;
> REBUILDS $(target) : clean ;
> }
>
> However, this works ok i.e. file.c is deleted when $(target) is built (which is built all the time and not the behavior I want):
>
> rule gen-ucfg ( target : source : properties * )
> {
> common.Clean clean : file.c ;
> DEPENDS $(target) : clean ;
> }
>

REBUILDS only marks clean as being out of date.
It doesn't add it to the list of targets to be
updated.

You could try this:

rule gen-ucfg ( target : source : properties * )
{
    common.Clean $(target) : file.c ;
}

The effect is to append common.Clean to the
list of updating actions for $(target).
Thus, if updating $(target) succeeds,
file.c will be deleted.

In Christ,
Steven Watanabe


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