Skip to content

Commit

Permalink
Rake can't process output of 'gcc -MM'
Browse files Browse the repository at this point in the history
  • Loading branch information
wedesoft committed Oct 4, 2010
1 parent f11c159 commit c716d1b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ OBJ = CC_FILES.ext 'o'
$CXXFLAGS = ENV[ 'CXXFLAGS' ] || ''
$CXXFLAGS = "#{$CXXFLAGS} -fPIC -DNDEBUG"
if RbConfig::CONFIG[ 'rubyhdrdir' ]
$CXXFLAGS += "#{$CXXFLAGS} -I#{RbConfig::CONFIG[ 'rubyhdrdir' ]} " +
$CXXFLAGS = "#{$CXXFLAGS} -I#{RbConfig::CONFIG[ 'rubyhdrdir' ]} " +
"-I#{RbConfig::CONFIG[ 'rubyhdrdir' ]}/#{RbConfig::CONFIG[ 'arch' ]}"
else
$CXXFLAGS += "#{$CXXFLAGS} -I#{RbConfig::CONFIG[ 'archdir' ]}"
$CXXFLAGS = "#{$CXXFLAGS} -I#{RbConfig::CONFIG[ 'archdir' ]}"
end
$LIBRUBYARG = RbConfig::CONFIG[ 'LIBRUBYARG' ]
$SITELIBDIR = RbConfig::CONFIG[ 'sitelibdir' ]
Expand Down Expand Up @@ -164,8 +164,11 @@ rule '.o' => '.cc' do |t|
sh "#{CXX} #{$CXXFLAGS} -c -o #{t.name} #{t.source}"
end

file ".depends.mf" => CC_FILES do |t|
sh "#{CXX} -MM #{$CXXFLAGS} #{t.prerequisites.join ' '} > #{t.name}"
file ".depends.mf" do |t|
sh "makedepend -f- -- #{$CXXFLAGS} -- #{CC_FILES.join ' '} > #{t.name}"
end
CC_FILES.each do |t|
file t.ext(".o") => t
end
import ".depends.mf"

Expand Down

0 comments on commit c716d1b

Please sign in to comment.