2012-03-19 15:42:10 +04:00
# collect what's left
2012-04-23 13:42:13 +04:00
i f n e q ( , $( REPORT ) )
2012-04-23 21:45:32 +04:00
BUILDDIR := $( shell sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' " $( REPORT_PATH) " )
2012-03-19 15:42:10 +04:00
2012-04-18 23:22:29 +04:00
i n c l u d e l i b / c o m m o n . m k
2012-04-23 21:45:32 +04:00
2012-04-18 23:22:29 +04:00
all : reports /targets reports /scripts
reports/prep :
2012-04-23 21:45:32 +04:00
@mkdir -p " $( BUILDDIR) /reports/ "
2012-04-18 23:22:29 +04:00
reports/scripts : reports /prep
@grep "^mki.*scripts: Run: " $( BUILDDIR) /$( BUILD_LOG) \
| sed -rn " s,^.*( $( BUILDDIR) | $( SYMLINK) )/(.*)' $$ ,\2,p " \
> " $( BUILDDIR) / $@ .log " \
&& echo " ** scripts report: $( BUILDDIR) / $@ .log " $( SHORTEN)
reports/targets : reports /prep
2012-04-23 21:45:32 +04:00
@if ! [ -n " $( REPORT_PATH) " -a -s " $( REPORT_PATH) " ] ; then \
exit 0; \
fi ; \
2012-04-23 13:42:13 +04:00
if type -t dot >& /dev/null; then \
2012-04-18 23:22:29 +04:00
REPORT_IMAGE = " $( BUILDDIR) / $@ .png " ; \
2012-04-23 21:45:32 +04:00
report-targets < " $( REPORT_PATH) " \
2012-03-19 15:42:10 +04:00
| dot -Tpng -o " $$ REPORT_IMAGE " \
2012-04-09 15:40:42 +04:00
&& echo " ** target graph report: $$ REPORT_IMAGE " ; \
else \
2012-04-18 23:22:29 +04:00
REPORT_DOT = " $( BUILDDIR) /targets.dot " ; \
2012-04-23 21:45:32 +04:00
report-targets < " $( REPORT_PATH) " > " $$ REPORT_DOT " \
2012-04-18 23:22:29 +04:00
&& echo "** graphviz missing, " \
" target graph dot file: $$ REPORT_DOT " ; \
fi $( SHORTEN) ; \
2012-04-23 21:45:32 +04:00
mv " $( REPORT_PATH) " " $( BUILDDIR) / $@ .log "
2012-04-23 13:42:13 +04:00
e l s e
all : ; @:
e n d i f