Merged mhbuildsbr.c into mhbuild.c, cause it is not used elsewhere.
[mmh] / makedeps2dot
diff --git a/makedeps2dot b/makedeps2dot
new file mode 100644 (file)
index 0000000..1f8da81
--- /dev/null
@@ -0,0 +1,44 @@
+BEGIN {
+       FS = " *: *"
+
+       ignore["all"] = 1
+       ignore["configure"] = 1
+       ignore["Makefile"] = 1
+       ignore["install"] = 1
+       ignore["uninstall"] = 1
+       ignore["clean"] = 1
+       ignore["distclean"] = 1
+       ignore["realclean"] = 1
+       ignore["mostlyclean"] = 1
+       ignore["superclean"] = 1
+       ignore["mmhdist"] = 1
+       ignore["lint"] = 1
+
+       print "digraph foo {"
+}
+
+/^\t/ {
+       next
+}
+
+$1 ~ /^[a-zA-Z_]+$/ {
+       if ($1 in ignore) {
+               next
+       }
+       split($2, dep, /[ \t]+/)
+       for (i in dep) {
+               if (dep[i] ~ /^\$/) {
+                       continue
+               }
+               if (dep[i] ~ "^"$1"\\.(o|sh)$") {
+                       continue
+               }
+               print "\t\"" dep[i] "\" [shape=box];"
+               print "\t\"" dep[i] "\" -> \"" $1 "\";"
+       }
+       print ""
+}
+
+END {
+       print "}"
+}