Re: More on Actions, routes and builders in general

Lars Ivar Igesund <[email protected]> Thu, 17 Jun 2004 19:15:23 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Bram Moolenaar wrote:

> Lars Ivar Igesund wrote:
> 
> 
>>In the d.aap module, the only difference between the object,libobject 
>>and dllobject out types were their build attribute. What I did there, 
>>was to have an action d_compile that did the main work, and three 
>>compiles; one for each out type that only added the buildaction 
>>attribute before executing d_compile. Do I still have to do it this way, 
>>or can I find out what the outtype of action should be ($OUTTYPE) so I 
>>can add the correct buildaction based on that variable?
>>
>>Something like:
>>
>>@if OUTTYPE == "libobject":
>>	:attr {buildaction = buildlib} $target
> 
> 
> We don't have $OUTTYPE.  I think this is just a small optimization, not
> really worth changing.
> 
> Looking at the d module I notice that the d_compile, d_build, d_builddll
> and d_buildlib actions use ":do" to redirect the work to another action.
> Those should be rewritten to use define_action().

I didn't get what "those" pointed to, but; The reason why it was done 
this way, was mostly to don't need the full compile code in all three 
actions. So I tried with three actions (one for each outtype) and no 
redirection. As I understand it, all those three should be primary 
actions, all with "d" as intype and differing outtypes. This leads to 
trouble. Only the last defined action seems to be remembered. First, the 
last action was the one with libobject as outtype. In a recipe with a 
:lib and a :program, the lib built fine while the program crashed with 
the message:

Error in recipe "define_action(build) from libobject,object,default to 
default" line 474: No commands defined for d_buildlib program from object

Then i moved the define_action calls, making the one with object as 
outtype the last. Then I got the following message on the lib target:

Error in recipe "define_action(buildlib) from libobject,object,default 
to default" line 474: No commands defined for d_build lib from libobject

> 
> It's strange that d_buildlib doesn't do anything when D_BUILDLIB_ACTION
> is not set.  Not even an error.
> 

An unintended omission. My new version don't have any default stuff 
happening if no tool has been loaded. It makes the default recipe to 
dependant on one compiler before the compiler landscape is stabilized, 
while it also becomes a hell to keep it up to date (it's already in a 
tool). Instead it prints a message about the supported tool chains that 
can be installed.

Lars Ivar Igesund



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND