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

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun Oct 15 18:47:01 EDT 2006

I don't think that there is the exact feature that you want. 

The easiest close thing would be to turn your exe into a shell scripts
that does mzscheme -qu test-predictions.ss and then have your makefile
do "mzc -k test-predictions.ss". That'll re-compile .ss files in a
Make-like manner.

You could build that feature, if you wanted to, tho. You'd need to
first compile the files, and then use read-syntax on the contents of
the .zo files and then extract a the syntax properties (see the docs on
'module-direct-requires and similar) from the module that contains each
file's dependencies.

hth,
Robby

At Sun, 15 Oct 2006 13:30:18 -0700, Eric Hanchrow wrote:
> 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
> say
> 
>     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
> maintained.
> 
> 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
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.