Following the pattern I’ve seen in widespread use, I use rake in my
Ruby projects for most high-level tasks (running specs, building gems
etc) and mkmf to make C extension makefiles.
mkmf works great for the simple case where you just want to compile
some C files and link to some libraries; the default behaviour seems
to handle most things automatically.
But what if I want to do some more sophisticated rake-like stuff where
I manually specify dependencies? For example:
Start with ANTLR grammar file “Grammar.g”
Whenever this file is updated, have to run ANTLR on it and this
regenerates new “GrammarLexer.c” and “GrammarParser.c” files
In this case want to rebuild the extension
Is there a way to do this using mkmf? Or do I have to manually tweak
the generated Makefile myself?