Skip to content
This repository
Browse code

Fixed rebuilding melbourne from dependencies.

  • Loading branch information...
commit fc851894255a24bf89ac14439e4655231590f659 1 parent d2a88c1
Brian Shirai authored June 23, 2011
2  lib/ext/melbourne/Rakefile
@@ -81,7 +81,7 @@ melbourne_build = "build/melbourne20.#{$DLEXT}"
81 81
 
82 82
 file melbourne_build => project_files
83 83
 
84  
-graph_dependencies source_files
  84
+graph_dependencies source_files, [], ext_dir
85 85
 
86 86
 import dependency_file
87 87
 
9  rakelib/dependency_grapher.rb
@@ -88,10 +88,11 @@ class SourceFile < Node
88 88
 
89 89
     attr_reader :name, :object_name, :includes, :dependencies
90 90
 
91  
-    def initialize(name, parser)
  91
+    def initialize(name, parser, objects_dir=nil)
92 92
       super parser
93 93
       @name = name
94 94
       @object_name = name.sub(/((c(pp)?)|S)$/, 'o')
  95
+      @objects_dir = objects_dir
95 96
       @includes = []
96 97
     end
97 98
 
@@ -110,6 +111,7 @@ def collect_dependencies
110 111
 
111 112
     def print_dependencies(out, max)
112 113
       str = "#{@object_name}:"
  114
+      str = "#{@objects_dir}/#{str}" if @objects_dir
113 115
       out.print str
114 116
 
115 117
       width = str.size
@@ -390,7 +392,7 @@ def parse(lines)
390 392
     end
391 393
   end
392 394
 
393  
-  attr_accessor :file_names, :directories, :defines, :system_defines
  395
+  attr_accessor :file_names, :directories, :defines, :system_defines, :objects_dir
394 396
   attr_reader :sources
395 397
 
396 398
   def initialize(files, directories=[], defines=nil)
@@ -398,6 +400,7 @@ def initialize(files, directories=[], defines=nil)
398 400
     @directories = directories
399 401
     @defines = defines
400 402
 
  403
+    @objects_dir = nil
401 404
     @system_defines = {}
402 405
     @sources = []
403 406
   end
@@ -416,7 +419,7 @@ def process
416 419
     get_system_defines
417 420
 
418 421
     @file_names.each do |name|
419  
-      source = SourceFile.new name, self
  422
+      source = SourceFile.new name, self, @objects_dir
420 423
       parser = FileParser.new source, @directories
421 424
 
422 425
       parser.parse_file name
3  rakelib/ext_helper.rb
@@ -225,11 +225,12 @@ def dependency_file
225 225
   ".depends.mf"
226 226
 end
227 227
 
228  
-def graph_dependencies(sources, directories=[])
  228
+def graph_dependencies(sources, directories=[], objects_dir=nil)
229 229
   directories = Array(directories)
230 230
   directories.concat [".", include18_dir, include19_dir]
231 231
 
232 232
   grapher = DependencyGrapher.new sources, directories
  233
+  grapher.objects_dir = objects_dir
233 234
   grapher.process
234 235
 
235 236
   File.open dependency_file, "w" do |file|

0 notes on commit fc85189

Please sign in to comment.
Something went wrong with that request. Please try again.