docs/master

diff scripts/makedeps2dot @ 234:eba3744fb238

Added my set of helper scripts. Removes the spell makefile target as it was not use{d,ful} anyway. Btw: I should have ran script/doubles before I printed the document. :-/
author markus schnalke <meillo@marmaro.de>
date Mon, 16 Jul 2012 11:23:30 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/makedeps2dot	Mon Jul 16 11:23:30 2012 +0200
     1.3 @@ -0,0 +1,51 @@
     1.4 +#!/usr/bin/env awk
     1.5 +#
     1.6 +# List dependencies in Makefile input,
     1.7 +# ignore a set of default targets and 1:1 dependencies
     1.8 +# and generate dot graph output
     1.9 +
    1.10 +BEGIN {
    1.11 +	FS = " *: *"
    1.12 +
    1.13 +	ignore["all"] = 1
    1.14 +	ignore["configure"] = 1
    1.15 +	ignore["Makefile"] = 1
    1.16 +	ignore["install"] = 1
    1.17 +	ignore["uninstall"] = 1
    1.18 +	ignore["clean"] = 1
    1.19 +	ignore["distclean"] = 1
    1.20 +	ignore["realclean"] = 1
    1.21 +	ignore["mostlyclean"] = 1
    1.22 +	ignore["superclean"] = 1
    1.23 +	ignore["mmhdist"] = 1
    1.24 +	ignore["lint"] = 1
    1.25 +
    1.26 +	print "digraph foo {"
    1.27 +}
    1.28 +
    1.29 +/^\t/ {
    1.30 +	next
    1.31 +}
    1.32 +
    1.33 +$1 ~ /^[a-zA-Z_]+$/ {
    1.34 +	if ($1 in ignore) {
    1.35 +		next
    1.36 +	}
    1.37 +	split($2, dep, /[ \t]+/)
    1.38 +	for (i in dep) {
    1.39 +		if (dep[i] ~ /^\$/) {
    1.40 +			continue
    1.41 +		}
    1.42 +		if (dep[i] ~ "^"$1"\\.(o|sh)$") {
    1.43 +			continue
    1.44 +		}
    1.45 +		sub(/\.o$/, ".c", dep[i]);
    1.46 +		print "\t\"" dep[i] "\" [shape=box];"
    1.47 +		print "\t\"" dep[i] "\" -> \"" $1 "\";"
    1.48 +	}
    1.49 +	print ""
    1.50 +}
    1.51 +
    1.52 +END {
    1.53 +	print "}"
    1.54 +}