[lug] OT: Makefile oddity

D. Stimits stimits at idcomm.com
Fri Apr 19 22:55:59 MDT 2002


Tom Tromey wrote:
> 
> >>>>> ">" == D Stimits <stimits at idcomm.com> writes:
> 
> >> Then I use them as targets or dependencies. Well, in some cases, if I
> >> "touch a.cpp", it has decided that all a.cpp, b.cpp, and c.cpp are out
> >> of date.
> >> [ ... ]
> >> Due to the make rules, this is not harmful, it merely cd's to the
> >> directory and tries to make all of them one at a time...resulting in a
> >> string of cd for every single .cpp file, and the message that it is
> >> already up to date.
> 
> Actually, to me this sounds like something your Makefile is doing.

Perhaps, but not via the include files. The only thing in the include
file is a "SRC_PROJECT_TITLE = filename.cpp" type list, that it is in
fact correctly seeing.

> 
> >> I guess I'm going to have to use fewer Makefiles and subdirectories
> >> and just use one huge Makefile
> 
> I recommend the paper "Recursive Make Considered Harmful".  It
> explains nicely why this approach is a good one.

That paper has been around a long time, I'm familiar with it. But there
is a very important purpose behind doing it this way, it opens up
breaking down the huge conglomeration into separate subprojects in a way
that they can be shipped and unpacked in the same parent directory, and
all live together, using some files in common, with no unpacking
overwriting the Makefile that provides the metadata for any given
subproject. This in turn will finally make it reasonable to do other
packaging formats without problem.

D. Stimits, stimits at idcomm.com

> 
> Tom
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list