Hierarchical builds (Was: Re: Linking a program with a directory??)

Magnus Therning <[email protected]> Sat, 24 Jul 2004 12:36:19 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
I decided to split off the discussion to make each thread about one
thing and one thing only :-)

On Fri, Jul 23, 2004 at 08:37:59PM +0200, Bram Moolenaar wrote:
>
>> Of course I had to try out the hierarchical build as well. Again I got
>> stuck though :-(
>> 
>>  main.aap:
>> 
>>   :child foo/main.aap
>>   :child bar/main.aap
>> 
>>  foo/main.aap:
>> 
>>   :dll foo : foo.c
>> 
>>  bar/main.aap:
>> 
>>   :program { add_LIBS = $(DLLPRE)foo$(DLLSUF) }
>>       : main.c
>
>The foo library was created in the "foo" directory, thus in the "bar"
>directory you need to use "../foo/$(DLLPRE)foo$(DLLSUF)".

I have now modified my aap files like this:

  main.aap:
 
   :child foo/main.aap
   :child bar/main.aap
 
  foo/main.aap:
 
   :dll foo : foo.c
 
  bar/main.aap:
 
   all: bar

   INCLUDE = -I../foo

   :program { add_LIBS = ../foo/$(DLLPRE)foo$(DLLSUF) } bar
       : main.c

This doesn't work, because aap doesn't connect
'../foo/$(DLLPRE)foo$(DLLSUF)' with ':dll foo : foo.c' dependency-wise.
Is this something that is being worked on?

I'd even like to see that the following would create such a dependency
connection:

   :program { add_LDFLAGS = -L../foo } { add_LIBS = -lfoo } bar
       : main.c

In my perception this would bring aap to place where recursive aap files
can't be considered harmful in the same way makefiles are[1].

/M

1. http://aegis.sourceforge.net/auug97.pdf

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
[email protected]
http://magnus.therning.org/

Beware of bugs in the above code; I have only proved it correct, not tried
it.
     -- Donald Knuth
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBAjujiMWTaatN+6QRAhBGAKCxe/AFcNrfLyi75smL/xKVUtt/mgCg2xl3
TUqh42eKHiZqQWp8ArgKsk4=
=POpj
-----END PGP SIGNATURE-----