[Coco] OT: Unix/Linux Makefile question

Mark McDougall msmcdoug at optushome.com.au
Sun Feb 6 16:53:09 EST 2005


KnudsenMJ at aol.com wrote:

> Does Unix/Linux Make have a keyword you can set so that all individual  
> object files (*.o) will be looked for and placed in a subdirectory of where all  
> your C files are?

Most unix gcc projects build objects into an 'obj' subdirectory from the 
project or source root directory. The idea being that you can build multiple 
versions of cross-platform projects without disturbing each other. (The 
xmame project is one such project).

And of course making a 'clean' target in your makefile is very useful for 
cleaning the source tree immediately before taking an archival/backup copy 
of your project.

Make is very powerful and whilst I've only ever bothered to learn enough to 
'get by' I've no doubt you can achieve exactly what you want. Your best bet 
is to take a look at a few projects using gcc and choose one whose directory 
structure is suitable for your purposes, then look at the makefile for that.

Regards,

-- 
|              Mark McDougall                | "Electrical Engineers do it
| <http://members.optushome.com.au/msmcdoug> |   with less resistance!"



More information about the Coco mailing list