Paper House
Paper House is a ruby gem to easily build C projects using Rake. It supports the following build targets:
Features Overview
- 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).
Example
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.
Installation
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
Documents
Author
Contributors
https://github.com/trema/paper-house/contributors
Alternatives
- 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
License
Trema is released under the GNU General Public License version 3.0: