788cad885e
The purpose is being able to examine particular target interdependency graph for a given image having been configured to avoid convoluted dependencies (loops in particular). The implementation is based on SHELL hook hint by John Graham-Cumming: http://cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
34 lines
488 B
Bash
Executable File
34 lines
488 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "digraph {"
|
|
echo " { node [fontname=Helvetica,fontsize=20];"
|
|
|
|
while read first second third rest; do
|
|
FROM=; TO=
|
|
case "$first" in
|
|
"trace:building")
|
|
case "$third" in
|
|
"->")
|
|
FROM="$second"; TO="$rest";;
|
|
*)
|
|
continue;;
|
|
esac
|
|
;;
|
|
*)
|
|
continue;;
|
|
esac
|
|
[ -n "$FROM" -a -n "$TO" ] || continue
|
|
for to in $TO; do
|
|
out=" \"$FROM\" -> \"$to\""
|
|
case $to in
|
|
*distro/*)
|
|
echo "$out [weight=10];";;
|
|
*)
|
|
echo "$out";;
|
|
esac
|
|
done
|
|
done
|
|
|
|
echo " }"
|
|
echo "}"
|