Merged mhbuildsbr.c into mhbuild.c, cause it is not used elsewhere.
[mmh] / makedeps2dot
1 BEGIN {
2         FS = " *: *"
3
4         ignore["all"] = 1
5         ignore["configure"] = 1
6         ignore["Makefile"] = 1
7         ignore["install"] = 1
8         ignore["uninstall"] = 1
9         ignore["clean"] = 1
10         ignore["distclean"] = 1
11         ignore["realclean"] = 1
12         ignore["mostlyclean"] = 1
13         ignore["superclean"] = 1
14         ignore["mmhdist"] = 1
15         ignore["lint"] = 1
16
17         print "digraph foo {"
18 }
19
20 /^\t/ {
21         next
22 }
23
24 $1 ~ /^[a-zA-Z_]+$/ {
25         if ($1 in ignore) {
26                 next
27         }
28         split($2, dep, /[ \t]+/)
29         for (i in dep) {
30                 if (dep[i] ~ /^\$/) {
31                         continue
32                 }
33                 if (dep[i] ~ "^"$1"\\.(o|sh)$") {
34                         continue
35                 }
36                 print "\t\"" dep[i] "\" [shape=box];"
37                 print "\t\"" dep[i] "\" -> \"" $1 "\";"
38         }
39         print ""
40 }
41
42 END {
43         print "}"
44 }