Skip to content

Instantly share code, notes, and snippets.

@foo9
Created January 11, 2013 08:51
Show Gist options
  • Save foo9/4509048 to your computer and use it in GitHub Desktop.
Save foo9/4509048 to your computer and use it in GitHub Desktop.
# encoding: utf-8
# 参考:Rake http://www2s.biglobe.ne.jp/~idesaku/sss/tech/rake/
require 'rake/clean'
CC = "gcc"
SRCS = FileList["**/*.c"]
OBJS = SRCS.ext("o")
CLEAN.include(OBJS)
CLOBBER.include("hellowork")
task :default => "hellowork"
file "hellowork" => OBJS do |t|
sh "#{CC} -o #{t.name} #{t.prerequisites.join(' ')}"
end
rule ".o" => ".c" do |t|
sh "#{CC} -c #{t.source}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment