[Rake-devel] Suggestion: allow passing of extra command-lineargsto the task

Steven Knight knight at baldmt.com
Tue Jun 15 09:11:30 EDT 2004

> > > After rake finishes the current file, it then walks through a queue of
> > > subdirectories (that is modified by subdirs).  It clears out all task
> > > objects, then looks for a rakefile in the next directory off the queue.
> > 
> > I remember reading some arguments against recursive makefiles, though I
> > admit I didn't understand them at the time. Anyone?

The standard paper describing the pitfalls of recursive use of Make is
Peter Miller's "Recursive Make Considered Harmful":


It's pretty much required reading these days for people working on
software build issues.

The Makefile hackery that Miller describes in the paper does give you
a way to structure a Make-based build so that it has a global view
of the dependency graph, but it relies on macro conventions that are
difficult to extend for complicated build situations.  The paper really
only tries to demonstrate how you *could* use Make to work around the
recursive-invocation problems it describes.  Miller himself uses a build
tool called "cook" that he wrote many years back and has maintained since.

> [Bennett, Patrick] I don't see how there could be an argument against
> them.  I implemented them as explicit commands, so it's under complete
> user control (which can still be turned off with a command-line flag).
> I would only be opposed to it if it was an automatic behavior where rake
> automatically descended all directories looking for rakefiles.  That
> would be very, very, bad.  It (IMO) pretty much has to be a command
> within rakefile's which the user uses to explicitly name subdirectories
> to be checked.

Miller's paper doesn't argue against traditional hierarchical use of
a Makefile in each subdirectory, but against structuring your build by
recursively *invoking* the build tool in each subdirectory so that each
invocation has an incomplete view of only part of the dependency graph.
It's still possible, of course, for a user to write their build files in
this way, but the underlying build tool should support (and encourage)
a global view of the dependency graph.


More information about the Rake-devel mailing list