reports.mk: fixups and hardening
No need for .reports/ in toplevel directory even after build failure, and a few more hasty hacking fixups are also due, shame on me.
This commit is contained in:
parent
7d09fed79b
commit
0439df3159
10
reports.mk
10
reports.mk
@ -6,7 +6,7 @@ include lib/common.mk
|
||||
|
||||
BUILDDIR := $(shell sed -n 's/^.* BUILDDIR = \(.*\)/\1/p' "$(REPORT_PATH)")
|
||||
BUILDLOG := $(BUILDDIR)/$(BUILD_LOG)
|
||||
REPORTDIR := $(BUILDDIR)/reports/
|
||||
REPORTDIR := $(BUILDDIR)/reports
|
||||
IMAGE_OUTPATH := $(shell sed -n 's/^IMAGE_OUTPATH = \(.*\)/\1/p' $(BUILDLOG))
|
||||
|
||||
# for a multi-image build there's no sense to refer to buildroot
|
||||
@ -16,7 +16,9 @@ SHORTEN := >/dev/null
|
||||
endif
|
||||
|
||||
all: reports/targets reports/scripts
|
||||
@cp -a $(REPORTDIR) $(IMAGE_OUTPATH).reports
|
||||
@if [ -n "$(IMAGE_OUTPATH)" ]; then \
|
||||
cp -a $(REPORTDIR) $(IMAGE_OUTPATH).reports; \
|
||||
fi
|
||||
|
||||
reports/prep:
|
||||
@mkdir -p "$(REPORTDIR)"
|
||||
@ -25,14 +27,14 @@ reports/scripts: reports/prep
|
||||
@grep "^mki.*scripts: Run: " $(BUILDLOG) \
|
||||
| sed -rn "s,^.*($(BUILDDIR)|$(SYMLINK))/(.*)'$$,\2,p" \
|
||||
> "$(REPORTDIR)/$*.log" \
|
||||
&& echo "** scripts report: $(BUILDDIR)/$(@F).log" $(SHORTEN)
|
||||
&& echo "** scripts report: $(REPORTDIR)/$(@F).log" $(SHORTEN)
|
||||
|
||||
reports/targets: reports/prep
|
||||
@if ! [ -n "$(REPORT_PATH)" -a -s "$(REPORT_PATH)" ]; then \
|
||||
exit 0; \
|
||||
fi; \
|
||||
if type -t dot >&/dev/null; then \
|
||||
REPORT_IMAGE="$(BUILDDIR)/$@.png"; \
|
||||
REPORT_IMAGE="$(REPORTDIR)/$(@F).png"; \
|
||||
report-targets < "$(REPORT_PATH)" \
|
||||
| dot -Tpng -o "$$REPORT_IMAGE" \
|
||||
&& echo "** target graph report: $$REPORT_IMAGE"; \
|
||||
|
Loading…
Reference in New Issue
Block a user