Paper House is a ruby gem to easily build C projects using Rake. It supports the following build targets:
- Provides a simple yet a powerful syntax to build above mentioned targets using predefined Rake tasks.
- Pure Ruby. No additional dependency on other external tools (makedepend etc.) to resolve file dependencies.
- Multi-Platform. Runs on both Linux and MacOSX, and supports all major version of Ruby (1.9.3, 2.0.0, 2.1.0).
Its usage is dead simple: to build an executable from all the *.c
and *.h
files in the current directory, just add the following lines
to your Rakefile
.
require 'paper_house'
PaperHouse::ExecutableTask.new :hello
This defines a new task hello
, and rake hello
will automatically
analyze all file dependencies of the source files, compile them into
an executable named hello
.
If you wish to customize the build process more, please set the following options defined in PaperHouse::ExecutableTask:
PaperHouse::ExecutableTask.new :hello do |task|
task.executable_name = 'hello_world'
task.target_directory = 'objects'
task.cc = 'llvm-gcc'
task.includes = 'includes'
task.sources = 'sources'
task.cflags = %w(-Werror -Wall -Wextra)
task.ldflags = '-L/some/path'
task.library_dependencies = 'm'
end
You can find more examples in the examples/ directory.
The simplest way to install Paper House is to use Bundler.
Add Paper House to your Gemfile
:
gem 'paper_house'
and install it by running Bundler:
$ bundle
https://github.com/trema/paper-house/contributors
- rake-compiler: https://github.com/luislavena/rake-compiler
- rake-builder: https://github.com/joeyates/rake-builder
- Rant: http://rant.rubyforge.org/
- cxxproject: https://github.com/marcmo/cxxproject
Trema is released under the GNU General Public License version 3.0: