[ANN] Rant 0.3.6

S

Stefan Lang

Rant is a flexible build tool written entirely in Ruby,
similar to Rake.

== What's new in this release?

* Automatic cleanup of generated files
* Directed rules
* Constraining variables
* rant-import searches $LOAD_PATH
* Immediately build targets from Rantfiles

I'd appreciate suggestions about new features, names, etc.

== Installing Rant

You can install Rant as a RubyGem:
    % gem install --remote rant

or download the package from RubyForge(http://rubyforge.org/frs/?group_id=615)
and install with install.rb:
    % ruby install.rb

== More about Rant

The equivalent to a Makefile for make is the Rantfile. An
Rantfile is actually a valid Ruby script that is read by the
rant command.

Rant currently features:
* Defining custom tasks
* Automated packaging, testing and RDoc generation for Ruby
  applications and libraries.
* Primitive support for compiling C# sources portably with csc, cscc
  and mcs.
* Multiple buildfiles (e.g. one per directory).
* A configure plugin for easy environment and build-parameter
  checking (but not like autoconf!) which saves data in a yaml file.
* The rant-import command creates a monolithic rant script,
  so you don't depend on an rant installation anymore.


The following Rantfile solves the problem posted by Mark Probert.
Consider the following structure:
  Rantfile
  foo
  src_a/
    a_1.c
    a_2.c
  src_b/
    b_1.c
    b_2.c
  obj/
    a_1.o
    a_2.o
    b_1.o
    b_2.o

The Rantfile could look like:

import %w(directedrule autoclean)

desc "Build foo."
file :foo => "obj/libfoo.a" do |t|
sys "cc -o #{t.name} #{t.source}"
end

gen Directory, "obj"

ro = gen DirectedRule, "obj" => sys["src_*"], :eek: => :c do |t|
rac.build "obj"
sys "cc -c -o #{t.name} #{t.source}"
end

file "obj/libfoo.a" => ro.candidates do |t|
sys "ar cr #{t.name} #{t.prerequisites.arglist}"
sys "ranlib #{t.name}"
end

desc "Cleanup."
gen AutoClean, :clean

Running rant:
% rant --tasks
rant foo # Build foo.
rant clean # Cleanup.
% rant
mkdir obj
cc -c -o obj/a_1.o src_a/a_1.c
cc -c -o obj/a_2.o src_a/a_2.c
cc -c -o obj/b_1.o src_b/b_1.c
ar cr obj/libfoo.a obj/a_1.o obj/a_2.o obj/b_1.o
ranlib obj/libfoo.a
cc -o foo obj/libfoo.a
% rant clean
rm -rf obj
rm -f foo

== Resources

Current docs:: http://make.rubyforge.org
Rubyforge page:: http://rubyforge.org/projects/make/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] Rant 0.3.4 0
Rake help required 4
[ANN] Rant 0.5.0 0
[ANN] Rant 0.4.8 5
[ANN] Rant 0.4.0 3
[ANN] Rant 0.3.8 10
[ANN] Rant 0.3.2 28
[ANN] Rant 0.4.6 2

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top