1# lines are taken from https://ruby.github.io/rake/doc/rakefile_rdoc.html 2 3 4task :name0 5 6task name1: [:prereq1, :prereq2] 7 8task 'name2' => %w[prereq1 prereq2] 9 10task name3: %w[prereq1 prereq2] 11 12task name4: [:prereq1, :prereq2] do |t| 13 # actions (may reference t) 14end 15 16file "prog" => ["a.o", "b.o"] do |t| 17 sh "cc -o #{t.name} #{t.prerequisites.join(' ')}" 18end 19 20directory "testdata/examples/doc" 21 22multitask copy_files: %w[copy_src copy_doc copy_bin] do 23 puts "All Copies Complete" 24end 25 26# TODO 27rule '.o' => ['.c'] do |t| 28 sh "cc #{t.source} -c -o #{t.name}" 29end 30 31# TODO 32rule( /\.o$/ => [ 33 proc {|task_name| task_name.sub(/\.[^.]+$/, '.c') } 34]) do |t| 35 sh "cc #{t.source} -c -o #{t.name}" 36end 37 38# TODO 39import ".depends.mf" 40 41namespace "main" do 42 task :build do 43 # Build the main program 44 end 45end 46 47namespace "samples" do 48 task :build do 49 # Build the sample programs 50 end 51end 52 53task build: %w[main:build samples:build] 54