List Info

Thread: why generator only for non-top-level target? (was Re: main-target-alternative howto




why generator only for non-top-level target? (was Re: main-target-alternative howto
country flaguser name
United States
2007-09-07 06:48:55
On 09/06/07 11:34, Larry Evans wrote:
> On 09/05/07 14:19, Vladimir Prus wrote:
> [snip]
>> Just calling a function does not automatically
creates a main target.
>> There are just two ways to create a main target:
>>
>>         - Call the targets.main-target-alternative
>>         - Call some existing rule that creates main
target. That will
>>         will eventually call
targets.main-target-alternative
>>
> I tried the 1st way by modifying:
> 
> http://svn.boost.org/t
rac/boost/browser/trunk/tools/build/v2/example/customization
/Jamfile
> 
> as follows:
> <--- cut here ---
> import verbatim ;
> import targets ;
> 
> exe codegen : codegen.cpp class.verbatim
usage.verbatim
>      t1.verbatim ;
> 
> targets.main-target-alternative t1_cpp ;
> 
> verbatim t1_cpp : t1.verbatim ;
>  >--- cut here ---
[snip]
A simplified Jamfile:
<--- cut here ---
obj t1_obj : t1.verbatim ;

verbatim t1_cpp : t1.verbatim ;
 >--- cut here ---
with some debug ECHO's at:

http://svn.boost.org/trac/bo
ost/browser/trunk/tools/build/v2/build/targets.jam#L1532


shows targets.main-target-alternative is called for both
t1_obj and
t1_cpp; however, the attempt to construct t1_cpp gives:

  warn: Unable to construct ./t1_cpp

One difference between the processing is at:

http://svn.boost.org/trac/bo
ost/browser/trunk/tools/build/v2/build/targets.jam#L1409


For t1_obj, r is non-null:

   r='object(property-set)9'  
r='object(file-target)77'

; however, for t1_cpp, r is null at this point.

This seems like a bug because if t1.cpp is generated for
t1_obj, it should be generated for t1_cpp.
Is there some reason why a target (e.g. t1.cpp) is
generated
when it's not a top-level target, but is not generated when
it
is a top-level target (e.g. t1_cpp)?

( Maybe I'm mixing my terminology a bit in that I call
t1.cpp
a target, when actually it's ./bin/gcc-4.1/debug/t1.cpp and
maybe should be called a "concrete target" whereas
t1_cpp should be
called a meta-target or something else.)

TIA,
Larry.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: why generator only for non-top-level target?
country flaguser name
United States
2007-09-08 09:10:30
On 09/07/07 06:48, Larry Evans wrote:
[snip]
 > A simplified Jamfile:
 > <--- cut here ---
 > obj t1_obj : t1.verbatim ;
 >
 > verbatim t1_cpp : t1.verbatim ;
 >  >--- cut here ---

With this verbatim main target rule, I'd expected a
t1_cpp.cpp file to
be produced from the t1.verbatim file using the generator,
verbatim.inline-file.  However, --debug-generator showed
output:

      *** construct VERBATIM
          from { t1.verbatim.VERBATIM }

so, apparently, the verbatim rule generated by:

import type ;
type.register VERBATIM : verbatim ;

in verbatim.jam has VERBATIM type associated with it instead
of the
target type, CPP, in the generator registration:

import generators ;
generators.register-standard verbatim.inline-file : VERBATIM
: CPP ;

found also in the verbatim.jam file.

So now the question is, how is a main-target rule defined
that will
invoke the verbatim.inline-file action?  I tried defining
verbatim.inline-file rule; however, it did nothing.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )