From: Jim Weirich Date: 2003-03-22T09:23:21+09:00 Subject: Re: Rake problem? On Fri, 2003-03-21 at 14:44, Manfred wrote: > Hi, > > I tried to execute the examples which came with rake. > > When executing Rakefile1 then gcc gets invoked even when main is properly build. > > However rake -f Rakefile2 works fine. > > Is it an error or do I miss anything? Its an error in Rakefile1 in the examples. I have a file task ("main") depending on a normal task (:obj). Since the time stamp of normal tasks is always the current time, "main" is always out of date. (Perhaps this approach needs some more thought. This means a file task should never depend on a non-file task ... an unfortunate restriction.) Apply the attached patch to correct Rakefile1. I'll have to review the examples. I intended to write some annotations to the examples but haven't done that yet. Thanks for the feedback. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) --- Rakefile1 19 Mar 2003 12:48:05 -0000 1.1 +++ Rakefile1 21 Mar 2003 23:47:43 -0000 @@ -17,9 +17,10 @@ Sys.run "gcc #{src} -c -o #{t.name}" end -task :obj => ["a.o", "b.o", "main.o"] +OBJFILES = ["a.o", "b.o", "main.o"] +task :obj => OBJFILES -file "main" => [:obj] do |t| +file "main" => OBJFILES do |t| Sys.run "gcc -o #{t.name} main.o a.o b.o" end