[Rake-devel] Building native extensions with Rake

Luis Lavena luislavena at gmail.com
Tue Nov 18 15:09:53 EST 2008

On Tue, Nov 18, 2008 at 3:55 PM, Berger, Daniel <Daniel.Berger at qwest.com> wrote:
>> -----Original Message-----
>> From: rake-devel-bounces at rubyforge.org
>> [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Luis Lavena
>> Sent: Tuesday, November 18, 2008 10:52 AM
>> To: Rake Development and Discussion
>> Subject: [Rake-devel] Building native extensions with Rake
>> Hello everybody,
>> I'm working on a series of tasks that ease the compilation of
>> Ruby C Extensions with Rake. The goal of these tasks are ease
>> the building and compilation of Ruby C extensions, also
>> looking into be merged/integrated into Rake.
>> http://github.com/luislavena/rake-compiler/tree/master
> I doubt I'll have a chance to dig into the source, so could you
> summarize? Do you mean default tasks for 'build' and 'clean', for
> example? That would be nice.

In the Readme you can see the objective on this package.

* Generates one task compile for each extension you define in your Rakefile.

* Adds convention over folder structure and also adds the dependencies
between the files to avoid recompilation when is no need for it.

* It uses a temporary folder for you to inspect intermediate files
generated in the build process. (this also simplify the clean rules
about symbols and object files).

* simplifies end-user code, replacing long and duplicated across
project tasks to one-liners:


* It follows the same rules used by RubyGems when building the extensions
# ruby extconf.rb
# make
# cp .so to lib/

So if something doesn't work with it, it definitely will not work with
your packaged gem.

* The possibility to generate binary gems with extensions bundled,
easing the binary release process.

* The possibility to extend this to cover Java (Rake::JavaJarTask) to
generate .jar packages.

Neither of these tasks and goals mess with the build generation by
itself. They only simplify the compilation and bundling.

Right now it only assumes extconf as configure script and make as
builder, but this could be changed in the configuration.
Luis Lavena
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

More information about the Rake-devel mailing list