From 6647e8996a5ae3a4a3f97eedf18b1e9b823293f3 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 23 Apr 2012 12:42:13 +0300 Subject: [PATCH] reports.mk: fixed behaviour with no REPORT set Toplevel Makefile is a bit optimistic regarding calling reports.mk... --- reports.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reports.mk b/reports.mk index 764b9f4f..2899081b 100644 --- a/reports.mk +++ b/reports.mk @@ -1,9 +1,10 @@ # collect what's left +ifneq (,$(REPORT)) + BUILDDIR := $(shell sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' "$$REPORT_PATH") include lib/common.mk - all: reports/targets reports/scripts reports/prep: @@ -19,7 +20,8 @@ reports/scripts: reports/prep && echo "** scripts report: $(BUILDDIR)/$@.log" $(SHORTEN) reports/targets: reports/prep - @if type -t dot >&/dev/null; then \ + @if [ ! -s "$$REPORT_PATH" ]; then exit 0; fi; \ + if type -t dot >&/dev/null; then \ REPORT_IMAGE="$(BUILDDIR)/$@.png"; \ report-targets < "$$REPORT_PATH" \ | dot -Tpng -o "$$REPORT_IMAGE" \ @@ -31,3 +33,7 @@ reports/targets: reports/prep "target graph dot file: $$REPORT_DOT"; \ fi $(SHORTEN); \ mv "$$REPORT_PATH" "$(BUILDDIR)/$@.log" + +else +all:; @: +endif