Re: Dealing with build attributes of targets

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Adriaan de Groot wrote:

> Consider :ltlib (my favorite target type). An AAP command of this form looks 
> like:
> 
> :ltlib { attributes for ltlib, like installvar } target { attributes for the 
> target, like installdir } : { attributes XXX } sources { attributes for each 
> source individually }
> 
> What should attributes at the location XXX mean? The AAP code picks them out 
> specially (they have name=':' and are found at colonidx) into build_attr, and 
> later applies them to the target with
> 
>     add_buildrule(rpstack, work, recdict,
>                 type, cmd_attr, targetlist, build_attr,sourcelist)
> 
> I don't know exactly what buildrule() does, but this seems to be redundant .. 
> is there anything that you would want to put at XXX that can't be done with 
> the { attributes for the target } already? If there is, then @raise 
> UserError, "Adriaan is a Doofus".
> 
> If not, I'd like to change the meaning of the attributes at XXX to mean 
> (perhaps in addition) that they apply to all the sources, so that 
> 
> :ltlib { installvar = } conduit_time.la
>         { var_LDFLAGS = -L/opt/tmp -R/opt/tmp } :
>         { add_INCLUDE = -I$BDIR/timeconduit }
>         timeconduit/time-factory.cc
>         timeconduit/time-setup.cc
>         timeconduit/time-conduit.cc
>         timeconduit/time-setup_dialog.ui
> 
> does exactly what _I_ want.

I agree that the attributes that come right after the ":" should apply
to all the sources that come after it.  It's logical.

I think we should check that this is consistent with other commands, and
also for dependencies.  (problem with dependencies is that you can't put
an attribute at the start: "{attr} target : source", thus it uses
"target : {attr} source")

> Patch attached. Yes, I know that both this and the previous bdir()
> patch need documentation. I'd like to know if there is a Whelk's
> Chance in a Supernova of this going in, first, before I write the docs
> :)

Besides the missing documentation there is another problem: The
attributes should apply to the sources for this build command, but when
the source is also used elswhere, the attribute do not necessarily
apply.  Thus adding the attributes to the node is not a good idea.
The attributes should be passed to add_buildrule() and added to the
generated dependencies there.

-- 
   LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
   hacks him to the floor.  Blood.  Swashbuckling music (perhaps).
   LAUNCELOT races through into the castle screaming.
SECOND SENTRY: Hey!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.