Re: Converting from Imake!

Bram Moolenaar <[email protected]> Tue, 26 Apr 2005 22:37:55 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Joey -

> On Apr 26, 2005, at 2:37 PM, Bram Moolenaar wrote:
> 
> >> 11) Hierarchical build from top down, or from any of the subdirs
> >> without issue (preferably without strange command line args).
> >
> > You don't need to worry about this, just define what depends on what 
> > and Aap will figure out in what order they need to be build.
> 
> Is that the only way?  Here is why this is somewhat problematic for me: 
>   I would like to sometimes build shared, sometimes static, sometimes 
> both depending on something I set in my SDDAS.aap file (I was going to 
> look at the conditional build at some point here).   For us, this 
> depends on the platform I am on.
> 
> If I add an "all: libant/libant.a libPromote/libPromote.a" to my 
> toplevel, everything works for static.  But what about my shared which 
> is defined in the main.aap of libant?  Do I have to define every target 
> twice?  Once in libant/main.aap and once in the toplevel main.aap?

Well, you need to define something.  The simplest would be to use a
virtual target for each thing you want to build, thus a "shared" and a
"static" target.  Then the dependencies for them.

If you have lots of these you could do it with a variable argument on
the command line, such as

	aap METHOD=static 
	aap METHOD=shared

And then use an "if" command:

	@if _no.METHOD == 'static':
	   EXT = .a
	@else:
	   EXT = .obj

	all: libant/libant$EXT libPromote/libPromote$EXT

Something like that.

> I was thinking, maybe I could depend on install; however, I need libant 
> to build and be installed, then libPromote will work.  Right now, it 
> will build libant and libPromote but they both get installed at the 
> same time instead of build libant, install libant, build libPromote, 
> install libPromote.  The reason why it is working now is because libant 
> was previously built and installed so it succeeds.

I wouldn't mess with the standard targets, that would be very confusing.

> Right now I am only working with two directories, but I have about 
> fifteen I need to build in sequential order.  First be built, 
> shared/static/both, installed in the right place, and the build should 
> continue onward.

"In the right order" means there are dependencies.  You should tell Aap
about them, then it will be taken care off automatically.

> Does any of this make sense?  I feel like I am rambling! :-)

It makes sense.  You appear to want something like a "global virtual
target", thus one that may appear in every child script.  So that the
toplevel recipy doesn't need to know about targets in the children.

-- 
GALAHAD: No, please.  Please! I can defeat them!  There's only a hundred.
GIRLS:   He will beat us easily.  We haven't a chance.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix