Mercurial > projects > dwt2
diff rakefile @ 59:7e0547d89731
Debug builds
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 30 Mar 2009 12:09:37 +0200 |
parents | e2ca9bdc80f2 |
children | 66be6a990713 |
line wrap: on
line diff
--- a/rakefile Sat Mar 28 02:46:49 2009 +0100 +++ b/rakefile Mon Mar 30 12:09:37 2009 +0200 @@ -92,12 +92,22 @@ ########################################################################## # Routines # - +def isDebug + if ENV['DEBUG'] + ENV['DEBUG'] == "1" + else + false + end +end def buildTree( basedir, srcdir, resdir, dcargs=nil, libname=nil ) if libname == nil libname = basedir end - puts "Building #{libname}" + dbg_str = ""; + if isDebug + dbg_str = "Debug " + end + puts "#{dbg_str}Building #{libname}" resdir_abs = File.expand_path( File.join( basedir, resdir )) srcdir_abs = File.expand_path( File.join( basedir, srcdir )) @@ -119,6 +129,10 @@ end rsp.puts "-c" rsp.puts "-op" + if isDebug + rsp.puts "-debug" + rsp.puts "-g" + end Find.find( srcdir_abs ) do |path| if path =~ /\.d$/ then rsp.puts path.to_path[ srcdir_abs.size+1 .. -1 ] @@ -135,6 +149,9 @@ sh cmd, :verbose => false do |ok, res| if !ok then Find.find( srcdir_abs ) do |path| + if FileTest.file?(path) && path =~ /\.o(bj)?$/ then + FileUtils.rm path + end if FileTest.file?(path) && path =~ /\.di$/ then FileUtils.rm path end @@ -206,6 +223,10 @@ rsp.puts "-I#{srcdir_abs.to_path}" rsp.puts "-I#{DIR_IMP.to_path}" rsp.puts "-J#{resdir_abs.to_path}" + if isDebug + rsp.puts "-debug" + rsp.puts "-g" + end if dflags.size > 0 then rsp.puts dflags end