Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-09-19 02:15:40

Hi Bojan,

> I am new to Boost.Build and I am introducing it as the build system
> at my company. Many times, we need to run a tool after a program has
> been generated. How would you suggest to do this?
> I was thinking of a custom generator, which would essentially perform
> the same task as built-in exe and lib generators, and run the additional
> program. I thought it might be used along the following lines:
> my-exe some_name : [ glob *.cpp ] : <post-run>tool ;
> my-lib a_lib : [ glob *.cpp ] : <post-run>tool ;
> However, I have no idea how to go about writing such a beast. Ideally,
> it would simply inherit from the built-in exe and lib rules and change
> properties or run the tool.
> Can you please point me in the right direction?

You can use the following:

exe main : main.cpp ;
notfile main_postprocess : @postprocess : main ;
actions postprocess
do_something $(>)

(Provided you use the CVS version).

For convenience, I attach my email describing this feature.

- Volodya

Vladimir Prus
Boost.Build V2:
 --Boundary-00=_cWmLDaINHv2N34l Content-Type: message/rfc822;
name="forwarded message"
Content-Transfer-Encoding: 7bit
Content-Description: Vladimir Prus <ghost_at_[hidden]>: [jamboost] Proposal: 'notfile' main target
Content-Disposition: inline
Return-path: <sentto-4392937-9510-1113226312-ghost=cs.msu.su_at_[hidden]>
Envelope-to: ghost_at_[hidden]
Delivery-date: Mon, 11 Apr 2005 17:32:11 +0400
Received: from ([])
by with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32)
(Exim 4.50)
id 1DKz1P-0006ZB-Lp
for ghost_at_[hidden]; Mon, 11 Apr 2005 17:32:11 +0400
Received: from ( [])
by (8.12.11/8.12.11) with SMTP id j3BDW0hX044509
for <ghost_at_[hidden]>; Mon, 11 Apr 2005 17:32:09 +0400 (MSD)
(envelope-from sentto-4392937-9510-1113226312-ghost=cs.msu.su_at_[hidden])
Received: from [] by with NNFMP; 11 Apr 2005 13:31:53 -0000
Received: from [] by with NNFMP; 11 Apr 2005 13:31:53 -0000
X-Yahoo-Newman-Property: groups-email
X-Sender: ghost_at_[hidden]
X-Apparently-To: jamboost_at_[hidden]
Received: (qmail 482 invoked from network); 11 Apr 2005 13:31:50 -0000
Received: from unknown (
by with QMQP; 11 Apr 2005 13:31:50 -0000
Received: from unknown (HELO (
by with SMTP; 11 Apr 2005 13:31:49 -0000
Received: from Debian-exim by with spam-scanned (Exim 4.50)
id 1DKz0v-0006Xe-6F
for jamboost_at_[hidden]; Mon, 11 Apr 2005 17:31:47 +0400
Received: from ([])
by with esmtp (Exim 4.50)
id 1DKz0v-0006XM-3s
for jamboost_at_[hidden]; Mon, 11 Apr 2005 17:31:41 +0400
To: jamboost_at_[hidden]
User-Agent: KMail/1.7.2
Message-Id: <200504111731.35957.ghost_at_[hidden]>
X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on
X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
X-eGroups-Msg-Info: 2:12:4
From: Vladimir Prus <ghost_at_[hidden]>
X-Yahoo-Profile: vladimir_prus
MIME-Version: 1.0
Mailing-List: list jamboost_at_[hidden]; contact jamboost-owner_at_[hidden]
Delivered-To: mailing list jamboost_at_[hidden]
List-Id: <>
Precedence: bulk
List-Unsubscribe: <mailto:jamboost-unsubscribe_at_[hidden]>
Date: Mon, 11 Apr 2005 17:31:35 +0400
Subject: [jamboost] Proposal: 'notfile' main target
Reply-To: jamboost_at_[hidden]
Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: ClamAV 0.80/665/Fri Jan 14 23:49:38 2005
clamav-milter version 0.80j
X-Virus-Status: Clean
X-UID: 2342
X-Length: 4656
I think it would be good to add a target that just runs some command, witho=
creating any files. When such target is built, the command is just run, and=
no up-to-date checks are made for any files.
There are two use cases.
1. In my projects the system tests are run with some rather long command. I=
like to just type "bjam system-tests" and run that command.=20
2. Recently, C=E9dric wanted to run some tool on source .dsp files. And th=
no way to tell what the tool does and what files it produces. The tool just=
must be run.
I propose this interface:
notfile <name> : <action> : <sources>=20
: <requirements> ... all the regular paramenters ;
The <action> parameter can have two forms:
1. "some command" in which case the command is run verbatim
For example
notfile say : "echo hi" ; =
2. @name_of_the_rule, in which can the named rule/action will be invoked. F=
notfile hello_valgrind : @valgrind : hello ;
actions valgrind
valgrind $(>)
The first will just execute the command. The second will invoke the 'valgri=
tool on the source -- the 'hello' target.
The implementation is ready -- it actually took me less time to code than=20
writing this message ;-) Any comments?
Vladimir Prus
Boost.Build V2:
Yahoo! Groups Links

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