Makefiles for multi-directory applications

Ralf Corsepius corsepiu at faw.uni-ulm.de
Thu Nov 20 15:52:18 UTC 2003


On Thu, 2003-11-20 at 16:27, Alan Cudmore wrote:
> I have used the makefiles for RTEMS applications and demos for simple apps 
> with a handful of C files in one directory.

IMO, you should reconsider this decision :-(

> Now I would like to create makefiles for an application with multiple 
> levels of directories.
> In my directory tree, the make file calls other makefiles in 
> sub-directories and compiles the C files for each sub-system ( or task ). 
> When it gets to the part of the directory tree with the RTEMS startup code, 
> that is where I would like to link it into an executable.
> 
> What rules do I use in a subsystem makefile to just compile C files into 
> objects ( and not try to link or create an application? )
> 
> Is there an example of a multi-directory build like this?
RTEMS-3.x.x and may-be RTEMS-4.0.0 had used them this way.

> I want to take advantage of the RTEMS_MAKEFILE_PATH and the makefile 
> includes for portability.
Err, ... these files are highly non-portable ... If I had to decide,
these files would have been removed years ago.

>  I can easily see what settings the RTEMS makefile 
> is using and put them in my own makefile, but then it would have to be set 
> for each RTEMS target..

I would not want to do what you are trying.

I'd recommend you to write normal Makefiles as you would do for
non-RTEMS applications and use them.

Ralf





More information about the users mailing list