Boost logo

Boost-Build :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-09-04 16:12:59


On 09/04/07 14:56, Larry Evans wrote:
> On 09/04/07 12:41, Vladimir Prus wrote:
>> This is something I've tried to do before, but found it again in
>> my todo list. Now, we call 'exe', 'lib' and other things
>> you define in Jamfiles a 'main target'. Inside code, we have 'virtual targets',
>> that are more like files. This 'main target' term seems confusing. How about
>> calling it 'metatarget'? In user documentation, we'll define it as 'metatarget',
> [snip]
> According to:
>
> http://www.boost.org/doc/html/bbv2/reference.html
>
> exe and lib are builtin rules. Do you mean the 1st arg to these
> rule invocations in Jamfiles are 'main targets'? Using the
[snip]
This reminded me of a problem I had with naming targets on the command
line. In a Jamfile.v2, I had to write:

exe main : main.cpp

obj main_obj : main.cpp

and to create the object, I had to `bjam --v2 main_obj`, or something
like that (now that I think a little more, there's something not quite
right about that description. What would that create main_obj.o on
unix and main_obj.obj on windows?).

Anyway, it seemed to me the extra _obj on the main for the obj rule was
redundant. Wouldn't it be simpler to have a Jamvfile.v2:

main.exe : main.cpp

main.obj : main.cpp

? Then, to just compile main, do `bjam --v2 main.obj`. OTOH, to create
the executable, do `bjam main.exe`. Now, just as now, the actual file
create would be main on unix and main.exe on windows.


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