#!/usr/bin/env rake task :default => "hello" file "hello" => ["hello.o", "main.o"] do |t| sh "gcc -o #{t} #{t.prerequisites}" end file "hello.o" => "hello.c" do |t| sh "gcc -c -o #{t} #{t.prerequisites}" end file "main.o" => "main.c" do |t| sh "gcc -c -o #{t} #{t.prerequisites}" end