Building a program from a library

Richard Boulton <[email protected]> Wed, 17 Dec 2003 12:14:27 +0000
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
I have the following aap recipe:
---begin---
bar.c:
     :print int main(){return 0;} >$target
:lib baz : bar.c
:program bar : baz
---end---

I would expect this to build the program "bar".  However, instead I get:

$ aap
Aap: Error in recipe "/data/home/richard/stuff/tmp/main.aap" line 4: Do 
not know how to make an object out of "baz"
$

I can make the recipe work by changing it to:
---begin---
bar.c:
     :print int main(){return 0;} >$target
:lib baz {filetype=object} : bar.c
:program bar : baz
---end---

With this latter recipe, aap creates "libbaz.a", and then links it into 
executable "bar".

Can anyone explain why the attribute is neccessary, and if this is 
intentional or a bug?

Assuming it's not intentional, should there be rules somewhere (in 
default.aap perhaps?) which say how to convert a node of filetype "lib" 
to one of type "object"?  Or should there be build rules for building a 
program using a "lib"?  Or should it be addressed in some other way.

-- 
Richard



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click