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