Commit c692da6a authored by Michael Shigorin's avatar Michael Shigorin

reports.mk: cosmetic tweaks

REPORT_PATH comes from a makefile; let's use corresponding notation.
parent 7221c53c
...@@ -2,16 +2,14 @@ ...@@ -2,16 +2,14 @@
ifneq (,$(REPORT)) ifneq (,$(REPORT))
BUILDDIR := $(shell sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' "$$REPORT_PATH") BUILDDIR := $(shell sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' "$(REPORT_PATH)")
include lib/common.mk include lib/common.mk
all: reports/targets reports/scripts all: reports/targets reports/scripts
reports/prep: reports/prep:
@if ! [ -n "$$REPORT_PATH" -a -s "$$REPORT_PATH" ]; then \ @mkdir -p "$(BUILDDIR)/reports/"
exit 0; \
fi; \
mkdir -p "$(BUILDDIR)/reports/"
reports/scripts: reports/prep reports/scripts: reports/prep
@grep "^mki.*scripts: Run: " $(BUILDDIR)/$(BUILD_LOG) \ @grep "^mki.*scripts: Run: " $(BUILDDIR)/$(BUILD_LOG) \
...@@ -20,19 +18,21 @@ reports/scripts: reports/prep ...@@ -20,19 +18,21 @@ reports/scripts: reports/prep
&& echo "** scripts report: $(BUILDDIR)/$@.log" $(SHORTEN) && echo "** scripts report: $(BUILDDIR)/$@.log" $(SHORTEN)
reports/targets: reports/prep reports/targets: reports/prep
@if [ ! -s "$$REPORT_PATH" ]; then exit 0; fi; \ @if ! [ -n "$(REPORT_PATH)" -a -s "$(REPORT_PATH)" ]; then \
exit 0; \
fi; \
if type -t dot >&/dev/null; then \ if type -t dot >&/dev/null; then \
REPORT_IMAGE="$(BUILDDIR)/$@.png"; \ REPORT_IMAGE="$(BUILDDIR)/$@.png"; \
report-targets < "$$REPORT_PATH" \ report-targets < "$(REPORT_PATH)" \
| dot -Tpng -o "$$REPORT_IMAGE" \ | dot -Tpng -o "$$REPORT_IMAGE" \
&& echo "** target graph report: $$REPORT_IMAGE"; \ && echo "** target graph report: $$REPORT_IMAGE"; \
else \ else \
REPORT_DOT="$(BUILDDIR)/targets.dot"; \ REPORT_DOT="$(BUILDDIR)/targets.dot"; \
report-targets < "$$REPORT_PATH" > "$$REPORT_DOT" \ report-targets < "$(REPORT_PATH)" > "$$REPORT_DOT" \
&& echo "** graphviz missing, " \ && echo "** graphviz missing, " \
"target graph dot file: $$REPORT_DOT"; \ "target graph dot file: $$REPORT_DOT"; \
fi $(SHORTEN); \ fi $(SHORTEN); \
mv "$$REPORT_PATH" "$(BUILDDIR)/$@.log" mv "$(REPORT_PATH)" "$(BUILDDIR)/$@.log"
else else
all:; @: all:; @:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment