Permalink
Browse files

Fixed rebuilding melbourne from dependencies.

  • Loading branch information...
1 parent d2a88c1 commit fc851894255a24bf89ac14439e4655231590f659 @brixen brixen committed Jun 23, 2011
Showing with 9 additions and 5 deletions.
  1. +1 −1 lib/ext/melbourne/Rakefile
  2. +6 −3 rakelib/dependency_grapher.rb
  3. +2 −1 rakelib/ext_helper.rb
@@ -81,7 +81,7 @@ melbourne_build = "build/melbourne20.#{$DLEXT}"
file melbourne_build => project_files
-graph_dependencies source_files
+graph_dependencies source_files, [], ext_dir
import dependency_file
@@ -88,10 +88,11 @@ class SourceFile < Node
attr_reader :name, :object_name, :includes, :dependencies
- def initialize(name, parser)
+ def initialize(name, parser, objects_dir=nil)
super parser
@name = name
@object_name = name.sub(/((c(pp)?)|S)$/, 'o')
+ @objects_dir = objects_dir
@includes = []
end
@@ -110,6 +111,7 @@ def collect_dependencies
def print_dependencies(out, max)
str = "#{@object_name}:"
+ str = "#{@objects_dir}/#{str}" if @objects_dir
out.print str
width = str.size
@@ -390,14 +392,15 @@ def parse(lines)
end
end
- attr_accessor :file_names, :directories, :defines, :system_defines
+ attr_accessor :file_names, :directories, :defines, :system_defines, :objects_dir
attr_reader :sources
def initialize(files, directories=[], defines=nil)
@file_names = files
@directories = directories
@defines = defines
+ @objects_dir = nil
@system_defines = {}
@sources = []
end
@@ -416,7 +419,7 @@ def process
get_system_defines
@file_names.each do |name|
- source = SourceFile.new name, self
+ source = SourceFile.new name, self, @objects_dir
parser = FileParser.new source, @directories
parser.parse_file name
View
@@ -225,11 +225,12 @@ def dependency_file
".depends.mf"
end
-def graph_dependencies(sources, directories=[])
+def graph_dependencies(sources, directories=[], objects_dir=nil)
directories = Array(directories)
directories.concat [".", include18_dir, include19_dir]
grapher = DependencyGrapher.new sources, directories
+ grapher.objects_dir = objects_dir
grapher.process
File.open dependency_file, "w" do |file|

0 comments on commit fc85189

Please sign in to comment.