do |t| sh "cc #{t.source} -c -o #{t.name}" end NOTE: Because of a quirk in Ruby syntax, parentheses are required around a rule when the first argument is a regular expression. The following rule might be used for Java files: rule '.class' => ->(t_name){ t_name .sub(/\.class$/, '.java') .sub(/^classes\//, 'src/') } do |t| java_compile(t.source, t.name) end Below is an example of a simple Rake recipe: namespace :cake do desc 'make pancakes' task :pancake => [:flour,:milk,:egg,:baking_powder] do puts "sizzle" end task :butter do puts "cut 3 tablespoons of butter into tiny squares" end task :flour => :butter do puts "use hands to knead butter squares into 1 1/2 cup flour" end task :milk do puts "add 1 1/4 cup milk" end task :egg do puts "add 1 egg" end task :baking_powder do puts "add 3 1/2 teaspoons baking powder" end end See also Make Apache Maven Apache Ant External links Rake documentation Using the Rake build language by Martin Fowler Ruby on Rails Rake tutorial at railsenvy.com Custom Rake Tasks at railscasts.com Rake Tutorial at lukaszwrobel.pl Programming tools Build automation Software using the MIT license Ruby (programming language)