Permalink
Browse files

Using g++ -MM for extracting dependencies

  • Loading branch information...
1 parent 3f313b6 commit 6c827584960f67a766db7c9f76423738bd7897a8 @wedesoft committed Oct 6, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 Rakefile
View
@@ -171,7 +171,9 @@ rule '.o' => '.cc' do |t|
end
file ".depends.mf" do |t|
- sh "makedepend -f- -- #{$CXXFLAGS} -- #{CC_FILES.join ' '} > #{t.name}"
+ sh "g++ -MM #{$CXXFLAGS} #{CC_FILES.join ' '} | " +
+ "sed -e :a -e N -e 's/\\n/\\$/g' -e ta | " +
+ "sed -e 's/ *\\\\\\$ */ /g' -e 's/\\$/\\n/g' | sed -e 's/^/ext\\//' > #{t.name}"
end
CC_FILES.each do |t|
file t.ext(".o") => t

0 comments on commit 6c82758

Please sign in to comment.