2 # filter converting from .depend to .dot
3 # tested on .depend generated by ocamldep
10 target, deps = line.split(/\s*:\s*/)
11 while deps =~ /\\\s*$/ # deal with lines continued with trailing \
12 deps.sub!(/\s*\\\s*$/, '')
13 line = $stdin.readline
14 deps += ' ' + line.lstrip
16 sources, targets = target.split, deps.split
18 for tgt in targets # ignore file extensions
19 src.sub!(/\.[^.]+/, '')
20 tgt.sub!(/\.[^.]+/, '')
21 edges << [src, tgt] unless src == tgt # ignore self deps
27 print "\"#{src}\" -> \"#{tgt}\";\n"