Boost logo

Boost-Build :

Subject: Re: [Boost-build] Attaching a Jam target to the Boost Build Clean rule
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-12-27 03:36:36


On 12/26/2017 07:35 PM, Capeci, Doug via Boost-build wrote:
> I have user-defined meta-target rule invocations in my Jamfiles that should only execute when option --clean is provided to the Boost b2 executable. What is the easiest way to have this happen?

  There's no good way to do this. The --clean option
does not provide any hook to specify how a target
gets cleaned. I'm not sure why you would need clean
to do anything other than rm all the targets that
exist, anyway.

  You can make it work for --clean-all, by adjusting
the generator for test-01, to add
DEPENDS clean-all : test-01.clean ;
(Note: I'm assuming that test-01.clean is a
jam level target here, not a metatarget.)

  It's tricky to make this work for clean, because
clean allows you to select specific targets to
clean, instead of just deleting everything that
is reachable.

> Here is an some example Jamfile.file input:
> mytest-clean test-01.clean
> : test-01.out
> ;
> explicit test-01.clean ;
> mytest-clean is a user-defined rule that I want invoked when the user specifies --clean on the b2 command line. Note that test-01 is a target name that is created by another user-defined generator.

In Christ,
Steven Watanabe

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