Re: Building two programs and setting INCLUDE for each (with :conf rule)

Bram Neijt <[email protected]> Wed, 10 Aug 2005 13:24:15 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Hi.

Locally defining the variables now works, however, I now have a small
problem with the (still experimental) :conf rule
I would like to be able to use the :conf rule just like I use the
:program rule now, adding variable only to the actual conf rule:

(Something like this, which doesn't work)
:conf {var_INCLUDE = $MyOwnList } {required} gtkmm.h

However, reading the documentation on
http://www.a-a-p.org/exec/user-configure.html it seems that I will be
forced to overwrite the INCLUDE global variable before use and later
set it back like this:

oldinclude = $INCLUDE
INCLUDE = $MyOwnList
:conf {required} gtkmm.h
INCLUDE = $oldinclude

How should this be handled? (The above seems just silly)

Greetings,
  Bram Neijt

On 8/10/05, Bram Moolenaar <[email protected]> wrote:
> 
> Bram -
> 
> > I found some information about this in the mailintlist archive, but
> > I'm just running this through here, because these messages used the
> > SOURCES variable (which is now outdated as far as I know).
> >
> > I've got two ":program"'s in the same aap file, each requiering a
> > different INCLUDE (and DEFINE and LIBS).
> >
> > Now, resetting INCLUDE doesn't seem to work, because before the recipe
> > is executed, the variable is reset (which is how it should be).
> 
> You set the variable when the recipe is parsed, which is before the
> dependencies are figured out and the build commands executed.  Thus only
> the last value of INCLUDE will be used.
> 
> > So, my question is: what is the best way to handle this? And I'd love
> > to see this be added to the "building two programs" example in the
> > manual.
> >
> > What I found in the mailinglist was:
> > OneIncludes="-Ia"
> > TwoIncludes="-Ib"
> >
> > :program one : one.cc { var_INCLUDE = $OneIncludes}
> >
> > :program two : two.cc { var_INCLUDE = $TwoIncludes}
> >
> > Is this (most probably) going to be the standard way of handling this?
> > Or should I create or use scopes or something?
> 
> Since the compiler flags are related to the source file this is indeed
> the right method.
> 
> Somehow it's quite difficult to find these things in the documentation.
> I often have the same problem myself.  If someone can suggest a better
> organisation that is very welcome.
> 
> - Bram
> 
> --
> How To Keep A Healthy Level Of Insanity:
> 5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
>    over their caffeine addictions, switch to expresso.
> 
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
>  \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf