Boost logo

Boost-Build :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-04-02 15:06:57

David Abrahams wrote:

> Larry, what are you trying to accomplish here?
> If you just want to use classic Jam, stop defining BOOST_ROOT and leave
> off the project-root call.
> If you're trying to use Boost.Build, you have to accept that the Jamfile
> gets processed twice.

I'm trying to emulate what I'm currently doing with make.
I want a way to run an example program in a subdirectory
even though it's up-to-date. Currently I do this with a "run"
make target. I'd also like to run a regression test which run's this
example program, saves the output, and compares with
an expected output. I notice that many, if not all, boost tests
use assert in <cassert> (e.g. python/test/back_reference.cpp ) or
the macros in boost /test/test_tools.hpp (e.g. smart_ptr/smart_ptr_test.cpp ).
I'll probably use that for my tests, but being able to run an example
program with output to stdout would help users understand my code;
so, I want to keep that with the jamfiles I create. In addition, the code
prints out the pointer graph with indentation to represent to-from arcs,
and this would also help users' understanding. Hence, I want to
specify a target which just runs this example program.

> Since the Jamfile is getting processed twice, test-rule is invoked
> twice. You could write:
> -----
> project-root ;
> actions test-rule
> {
> echo "action output is" $(<)
> touch test.out
> }
> rule test-rule
> {
> ECHO "rule output is" $(<) ;
> }
> if ! $(gIN_LIB_INCLUDE)
> {
> test-rule always-target ;
> }

Yep. that works. I created a test/Jamfile with another always-target and
wanted to see if I could just build that without building the top Jamfile always-target.
I tried:
jam test/always-target
jam \<test\>always-target
I tried the 2nd because jam_src/Jamfile.html, under "Object Rule" describes
the use of grist to uniquely identify a target. Also, under "Pseudotargets",
grist was also mentioned; so, I thought it might work, but I guess NOT from
the command line. The output from the 2nd was:

rule output is always-target
at test_jam
rule output is always-target
don't know how to make <test_jam>always-target
...found 1 target...
...can't find 1 target...

Is there anyway to just "build" test/always-target?


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