Jim Weirich <jweirich / one.net> wrote in message news:<1048292858.3875.140.camel / traken>... > 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 Jim, Thanks a lot. That did the trick. --- I like rake very much. Last year I tried some of the make-alternatives but all those were in some way still unsatisfactory for what I was looking for. Xake + ruby = rake is a perfect match. You did a great job. Thanks. Manfred