toughts on the :child command

"John Williams" <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
I've been trying to work out how one might build a large project that uses
the :child command to combine several recipe files together.  The example
given in the tutorial involves too much boilerplace code for my liking,
and the logic just seems a little backwards to me.  Also I'm a little
constrained in how things work since I'm trying to replace Makefiles for
some complicated project and I want to keep the functionality as similar
as possible.

What I would *LIKE* to do is put a project-wide 'main.aap' in the root of
the project hierarchy and put a file to build libraries in the 'src/lib'
directory.  I want the build libraries to go into the 'lib/linux'
directory.

--- main.aap ---

Top = `os.getcwd()`
LibTop = $Top/lib/linux
INCLUDES = -I$Top/include
:child src/lib/child.aap

--- src/lib/child.aap ---

:dll $LibTop/foo : foo1.cc foo2.cc

--- end ---

Several things about this annoy me.  First, it seems like I shouldn't have
to set $Top; based on the name, I would have expected $TOPDIR to do this
for me, but instead it's just the opposite of what I want.  Ideally I'd
like $Top be expand to a relative path to the top-level directory, so the
AAP output isn't so verbose, but I can't figure out a clean way to do this. 
How about creating a new builtin variable that expands to "." in the
top-level file, "../.." in src/lib/child.app, etc.?  Such a variable
should probably also have a corresponding Python function just like $TOPDIR
has topdir().

My next problem is that the shared library built in src/lib/child.aap
doesn't get added to the dependencies of the 'all' target.  I could fix
this by writing my own "all" target like this:

  all : $LibTop/${DLLPRE}malloc${DLLSUF}

But that sure is ugly, and it would be a maintenence hassle when I'm
building a lot of programs or libraries in one project, as often happens
at my company.

--jw



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
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.