Thanks Jorge and Mateusz!


That indeed does work. However, my project is obviously more complicated than this simple jamroot example and that is what I cannot get to work.  Here is another example:




exe main : file.c ;




use-project /TEST : DIR ;


Commands that work:


bjam /TEST//main   <- Builds main.exe

cd DIR

bjam file.obj             <- Builds file.obj!  Which I did not know worked before


Command that don’t appear to work:


bjam /TEST//test.obj

bjam DIR/test.obj

bjam DIR//test.obj


which all get something like this:


notice: could not find main target DIR//file.obj

notice: assuming it is a name of file to create.

don't know how to make <e>DIR//file.obj

...found 1 target...

...can't find 1 target...


Thanks again,






From: [] On Behalf Of Jorge Suit Perez Ronda
Sent: Wednesday, April 11, 2012 10:25 AM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] Compiling a single file


Hi, you can do

bjam file.obj


2012/4/11 Nogradi, Chris <>

Thanks for the reply. I have read through the tutorial before but I still must be missing it.

Based on this:

exe main : file.c ;

I understand I can do:

bjam main

and it will build file.obj and main.exe

however, I want to only build file.obj from the command line.  How do I do that?

bjam file does not work unless I explicitly add a:

obj file : file.c ;
exe main : file ;

But this is not practical to do all over the place. I just want a quick command line option to build/rebuild only an obj from the command line:

Maybe something like:

bjam main..file ??



-----Original Message-----
From: [] On Behalf Of Mateusz Loskot
Sent: Wednesday, April 11, 2012 9:36 AM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] Compiling a single file

On 11 April 2012 15:15, Nogradi, Chris <> wrote:
> Does anyone compile a single file from a lib or exe? If so what would the
> bjam syntax be to compile main.c only for something like this:
> exe : main.c ;

or similar but with a bit more verbose/complete explanation

Best regards,
Mateusz Loskot,
Unsubscribe & other changes:

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.

Thank you for your cooperation.

Unsubscribe & other changes: