Makefile question

Angelo Fraietta afraiett at bigpond.net.au
Wed Nov 24 18:10:13 UTC 2004


Etienne Fortin wrote:

>Hi everyone,
>I'm currently trying to structure my application directories and
>Makefile and I have some interrogations. I read the Makefile README and
>I don't understand completely how to use the leaf and directory
>Makefiles.
>  
>
I found it too complicated to make my application this way

>What I want to do is have a main Makefile at the root of my sources that
>link the final executable of the application. This Makefile recurse all
>subdirectory, each compiling some .o from some sources. The main
>Makefile at the root just link all the .o made by the subdirs into the
>executable.
>  
>
What I did was make a library for each directory, with each directory 
containing a Makefile
E.g.

CURRENT_DIR=$PWD
echo $CURRENT_DIR

# make the engine library
cd ../engine
echo Making engine in $PWD
make $1

#make the engine interface library
cd ../engineinterface
echo Making engineinterface in $PWD
make $1

#make the link driver physical libraries
cd ../link_driver/hal_rtems
echo Making link physical layer driver in $PWD
make $1

#make the link layer libraries
cd ../
echo Making link logical layer in $PWD
make $1


It is probably not the best way to do it, but I have my source shared 
with three different operating systems and it works for me

>My problem is that I don't understand how to make that all work with the
>directory and leaf Makefiles concept of RTEMS applications. It seems
>that a directory Makefile is just used to force creation of
>sub-standalone-executables that are in subdirs. But I really just want
>to compile sub-modules from a main application executable.
>  
>
I found a really good book for understanding Makefiles was
Oram, Andrew, and Steve Talbott. 1991. Managing Projects with make. 
Second ed. Cambridge: O'Reilly.

>Any help will be appreciated.
>  
>
I hope this helped

Good luck

-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


http://www.users.bigpond.com/angelo_f/

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)






More information about the users mailing list