On Wed, Mar 9, 2011 at 4:55 AM, Ajay Jain <[email protected]> wrote: > HI, > > I need a design suggestion. I am starting to write a build system > using make. My project is quite exhaustive. There are directories, > sub-directories and so on. What should be the structure of my > makefiles? > > 1) Should I keep a Makefile in every directory and subdirectory? What > should the top level directory contain? and What should the > subdirectories contain? > > 2) OR there should only be makefiles at top level?
There are many different approaches and philosophies. However, make was designed with the assumption that there would be a local ./Makefile and most developers expect/prefer that to be the case, so I'd lean toward #1. I maintain a toy build model at https://github.com/boyski/RMCH-Sample#readme. It builds a couple of HelloWorld-level programs and exists only to demonstrate my ideas about best practices. You're welcome to look at it. It _should_ work out of the box on any Unixy platform with gcc and GNU make 3.82 - run "make help" for details. This is an evolving thing, in fact I'm enhancing it at the moment. -David Boyce _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
