Boost logo

Boost-Build :

Subject: Re: [Boost-build] target which depends on successful build
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-07-02 16:02:45


AMDG

On 07/02/2015 01:26 PM, Steve Lorimer wrote:
> I have the following Jamfile which installs my binary as binary.version
> (ie: it adds additional information to the name of the binary)
>
> constant EXE : my_app ;
>
> exe $(EXE) : [ glob *.cpp ] ;
>
> install install-target : $(EXE) : <location>. ;
>
> notfile . : @tag-file : install-target : ;
> actions tag-file
> {
> mv $(>) $(>).$(VERSION)
> }
>
> It works, but is a little klunky:
>
> 1. install-target and tag-file action are duplicated in every Jamfile which
> needs them. I would like to put this in the Jamroot, but simply moving it
> doesn't work (I think because it depends on the current path and target
> name) - is there any way to create a rule/aciton like this which can live
> in the Jamroot and be called from Jamfiles?
>

It should be possible to define tag-file
in Jamroot, but the targets need to be defined
in each Jamfile. You could put the target
declarations in a rule which you define in
Jamroot and then call that rule from each Jamfile.

> 2. every time I build, it will always call the tag-file action, instead of
> only when the exe target is rebuilt. How can I make my tag-file action only
> run when the exe is updated?
>

I don't think that a notfile target is really
appropriate for this, since you're creating
an actual file in this action. Just create
a normal file target and mark the source as
TEMPORARY.

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