Boost logo

Boost-Build :

Subject: Re: [Boost-build] prototyping alternative Boost.Build syntax
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-10-29 16:50:44


AMDG

On 10/29/2016 02:23 PM, Stefan Seefeld wrote:
>
> OK, wonderful. It seems I now have all the pieces to get started with my
> first python-based makefile.
>
> A few related questions:
>
> * it sounds like right now, whether a file needs to be remade is
> determined by comparing modification times. Is that correct ? What would
> it take to use checksums instead ? (just out of curiosity)
>

Yes it uses modification times. Using a checksum
would require changes to the engine. (I seem to
recall that there's a way to update based on
file contents by abusing the #include scanner,
but it's way more trouble than it's worth.)

> * can a target be something other than a file, perhaps with no
> filesystem representation at all ?
>

Yes. NOTFILE marks a target as not
referring to a real file.

> * what is the environment an action is executed in ? Is this the
> environment 'b2' was started in ? Can I modify that environment (either
> globally or locally) prior to executing actions ?
>

  b2 doesn't change the environment at all.
If you want to modify the environment it
has to be done as part of the action body.

> * The bjam.define_action() function takes a list and an int as third and
> fourth argument. What are these used for ?
>

  The list is a list of variable names.
The variable names should be a list of
targets which will be translated from
the target name to the filesystem path.

Example:

actions link bind LIBRARIES {
  g++ $(>) -o $(<) $(LIBRARIES)
}

LIBRARIES = <pbin>lib.a ;
SEARCH on <pbin>lib.a = ./bin ;

Then in the body of link, $(LIBRARIES) will
expand to ./bin/lib.a.

The int is the flags defined here:
https://github.com/boostorg/build/blob/develop/src/engine/rules.h#L54

> * Is there a way to control the output, i.e. filter whatever output
> actions generate (for example to colour it, as per a recent suggestion
> from the list) ?
>

You can only adjust whether there is output or not.
(The quietly flag suppresses output for an action)
Anything further requires changes to the C implementation.

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