diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 19:07:55 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 19:07:55 +0000 |
| commit | 8da109fa1ec17fb4096470fe97135f41cdd3345b (patch) | |
| tree | c5a08c8c9abae9b7f0514f680f56553a7a03656a /doc/rake/example/Rakefile2 | |
| parent | b43ab1d7f1a8bc1a6fbca4d193c37fb0c6d28281 (diff) | |
| download | ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.tar.gz ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.tar.xz ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.zip | |
* lib/rake: updated to rake code to rake-0.8.7 source code base.
* lib/rake/loaders/makefile.rb (Rake::MakefileLoader#process_line):
respace dependencies too.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc/rake/example/Rakefile2')
| -rw-r--r-- | doc/rake/example/Rakefile2 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/rake/example/Rakefile2 b/doc/rake/example/Rakefile2 new file mode 100644 index 000000000..35310eceb --- /dev/null +++ b/doc/rake/example/Rakefile2 @@ -0,0 +1,35 @@ +# Example Rakefile -*- ruby -*- +# Using the power of Ruby + +task :default => [:main] + +def ext(fn, newext) + fn.sub(/\.[^.]+$/, newext) +end + +SRCFILES = Dir['*.c'] +OBJFILES = SRCFILES.collect { |fn| ext(fn,".o") } + +OBJFILES.each do |objfile| + srcfile = ext(objfile, ".c") + file objfile => [srcfile] do |t| + sh "gcc #{srcfile} -c -o #{t.name}" + end +end + +file "main" => OBJFILES do |t| + sh "gcc -o #{t.name} main.o a.o b.o" +end + +task :clean do + rm_f FileList['*.o'] + Dir['*~'].each { |fn| rm_f fn } +end + +task :clobber => [:clean] do + rm_f "main" +end + +task :run => ["main"] do + sh "./main" +end |
