[plt-scheme] How can I automatically include module dependencies in a makefile?

From: Eric Hanchrow (offby1 at blarg.net)
Date: Sun Oct 15 16:30:18 EDT 2006

Here's a problem: I've got a makefile that builds an executable from a
bunch of PLT scheme files, using mzc --exe.  I'd like the relevant
makefile rule to have accurate dependency information, so that the exe
gets rebuilt exactly when it needs to, no more and no less.  But,
being lazy, I don't want to maintain that dependency information
myself.  Since I frequently rename files, add files that don't affect
the exe, and change the module dependencies, it doesn't work to merely

    dds: $(wildcard *.ss)
            mzc --exe $@ test-predictions.ss

because the "wildcard" form picks up _all_ the files in the directory,
even if some aren't relevant to building the exe.

In the C world, this problem was solved long ago: the GNU C
preprocessor has an "-M" option which causes it to emit dependency
information as it reads a C file.  It can create little makefiles from
this information, which you include in your main makefile, et voila:
you have accurate dependency information, which is automatically

Is there some equivalent for PLT scheme?
Any word you have to hunt for in a thesaurus is the wrong
word.  There are no exceptions to this rule.
        -- Stephen King

Posted on the users mailing list.