Forum: Ruby Doing rake-like stuff with mkmf?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ef9ecd30591995af2cf62cde10b26e49?d=identicon&s=25 Wincent Colaiuta (Guest)
on 2007-06-09 16:18
(Received via mailing list)
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?

Cheers,
Wincent
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (Guest)
on 2007-06-11 06:34
(Received via mailing list)
Hi,

At Sat, 9 Jun 2007 23:15:08 +0900,
Wincent Colaiuta wrote in [ruby-talk:254933]:
> Is there a way to do this using mkmf? Or do I have to manually tweak
> the generated Makefile myself?

create_makefie in mkmf appends the content of "depend" file if
it exists, so that you can add your own rules.
97550977337c9f0a0e1a9553e55bfaa0?d=identicon&s=25 Jano Svitok (Guest)
on 2007-06-11 22:15
(Received via mailing list)
On 6/9/07, Wincent Colaiuta <win@wincent.com> wrote:
>
> Cheers,
> Wincent

There's mkrf (http://rubyforge.org/projects/mkrf) aimed at replacing
mkmf generated makefile with rakefile.
This topic is locked and can not be replied to.