Changes between Version 4 and Version 5 of DependencyAnalysis

Show
Ignore:
Timestamp:
08/13/07 09:24:35 (6 years ago)
Author:
pgavin@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DependencyAnalysis

    v4 v5  
    5151}}} 
    5252 
    53 So, please, if you have any other ideas, please put them here.  I want to get gtk2hs working with cabal, and this is a necessary step in that process.  I'd write some actual code, but I want to know what others are thinking and doing, so I don't duplicate work :) 
    54  
    55 Pete 
    56  
    5753== Interleaving dep chasing and building == 
    5854 
     
    6561 
    6662So the question is, what is a good interface between the dependency chaser and a make layer. 
     63 
     64---- 
     65 
     66I agree that having the dependency generation and make layers separate would be a good thing, but I don't know if that's 100% feasible.  Consider that the only time we will have a complete dependency graph is when the build is nearly done.  So, I don't really think we should try to build the graph at all (at least, in the direct sense). 
     67 
     68Here's the pseudocode for the algorithm I have in my head: 
     69 
     70{{{ 
     71 
     72for every target file T: 
     73   
     74  find the rule chain R that will build the file. (there should only be one) 
     75   
     76  starting from the final entry in the rule chain (e.g. the .chs.pp->.chs rule) and working backwards: 
     77     
     78    call the current source file A, and the target file B. (e.g. A=.chs.pp, B=.chs) 
     79    if B is older than A: 
     80        for each file D that is needed to build B from A: 
     81            if D is already on the stack, bail out 
     82            otherwise, recurse on D 
     83        compile B 
     84 
     85}}} 
     86 
     87Of course, other things are needed, but I think this is a good starting point.