#!/usr/bin/env rake require 'rake/clean' task :default => "hello" CLEAN.include("*.o", "hello") rule '.o' => ['.c'] do |t| sh "gcc -c -o #{t} #{t.source}" end file "hello" => ["hello.o", "main.o"] do |t| sh "gcc -o #{t} #{t.prerequisites}" end