Subject: Re: [Boost-build] prototyping alternative Boost.Build syntax
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-10-29 16:23:07
On 29.10.2016 16:10, Steven Watanabe wrote:
> On 10/29/2016 01:45 PM, Stefan Seefeld wrote:
>> Cool, that worked ! Can you outline what the four calls do ?
>> bjam_interface.define_action("gcc.compile", "g++ -c -o $(<) $(>)",
>> , 0)
>> bjam_interface.call("gcc.compile", "hello.o", "hello.cpp")
>> bjam_interface.call("UPDATE_NOW", "hello.o")
>> from my guess:
>> * the first line defines an action
>> * the second line defines a rule by which "hello.o" is made from
>> "hello.cpp" using that action
>> * the third line requests "hello.o" to be remade ("now" - is that a
>> blocking call ?)
>> * not sure about the fourth line
> It clears the update list causing the default
> update phase to do nothing.
> There's actually one more component that's missing:
> bjam_interface.call("DEPENDS", "hello.o", "hello.cpp");
> gcc.compile doesn't automatically set up this
> dependency. (The first time you build it will
> update because hello.o is missing. However,
> without DEPENDS, touching hello.cpp won't cause
> hello.o to update.)
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)
* can a target be something other than a file, perhaps with no
filesystem representation at all ?
* 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 ?
* The bjam.define_action() function takes a list and an int as third and
fourth argument. What are these used for ?
* 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) ?
OK, enough questions for a start. :-)
-- ...ich hab' noch einen Koffer in Berlin...
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