This simple sample shows how to structure a "full dependency" application build using GNU make, without using recursive make. The cool thing is that it is very easy to add a new library or application to the build process, and you automatically get full header dependency tracking without needing to run a separate "make depend" step. It Just Works (tm). In addition, it doesn't litter your source directories with .o or .d files; those all go into an easily removed (or symlinked) "bin" directory. Similarly, the actual build targets (apps and libs) end up in the top level of the bin directory; .o and .d files end up in sub-directories of that. To test it out, just run "make". GCC and GNU make is required. It will build two libraries: bin/lib1.a and bin/lib2.a. It will build two applications that use these libraries: bin/app1 and bin/app2. Run make again and watch nothing change. Now, touch lib1/lib1.h, which is only used by app1 (not lib1 !). Run make again. Watch only app1 get re-built! This system is set up to build two kinds of targets: applications (really just executables), and libraries (static libraries only in this version). To use this on your own, copy Makefile, LibMakefile and AppMakefile to the root of your build tree. Right under this build tree, put directories for your apps and libs. In each lib directory, put a file that looks like lib1/Makefile, but change the LIBNAME to be the name of your directory. Same thing for applications: put a copy of app1/Makefile into your application directory, and change APPNAME to the name of that directory. "make" from the top level. You're done! For big projects, this process of not doing recursive make usually is considerable faster, and in addition, this system always keeps your dependencies up to date, so there's no wiping everything and re-building just for the sake of it. Copyright 2005 Jon Watte. I release this sample under the MIT license: free for any use, provided you hold me harmless from any such use you make, and you retain my copyright on the actual sources. If you like it, please send me e-mail: makesample {at} mindcontrol {dot} org