[lug] OT: Makefile oddity

Tom Tromey tromey at redhat.com
Fri Apr 19 17:09:56 MDT 2002


>>>>> ">" == 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.

>> 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.

Tom



More information about the LUG mailing list