Commit 4f1110f7 authored by Anton Midyukov's avatar Anton Midyukov

Makefile: Create a report directory at each iteration

Also now there will be no garbage (temporary directories) when executing DIRECT_TARGETS.
parent 6777e4ed
......@@ -19,12 +19,6 @@ export ARCHES ARCH
export PATH := $(CURDIR)/bin:$(PATH)
# supervise target tracing; leave stderr alone
ifdef REPORT
export REPORT_PATH := $(shell mktemp --tmpdir mkimage-profiles.report.XXXXXXX)
POSTPROC := | report-filter > $(REPORT_PATH)
endif
# recursive make considered useful for m-p
MAKE += -r --no-print-directory
......@@ -62,12 +56,12 @@ SHELL = /bin/bash
fi; \
say "** ARCH: $$ARCH"; \
fi; \
if $(MAKE) -f main.mk ARCH=$$ARCH $@ $(POSTPROC); then \
if [ -n "$(REPORT)" ]; then \
$(MAKE) -f reports.mk ARCH=$$ARCH REPORT=$(REPORT); \
fi; \
if [ -n "$(REPORT)" ]; then \
REPORT_PATH=$$(mktemp --tmpdir mkimage-profiles.report.XXXXXXX); \
$(MAKE) -f main.mk ARCH=$$ARCH $@ | report-filter > $$REPORT_PATH || exit 1; \
$(MAKE) -f reports.mk ARCH=$$ARCH REPORT=$(REPORT) REPORT_PATH=$$REPORT_PATH; \
else \
exit 1; \
$(MAKE) -f main.mk ARCH=$$ARCH $@ || exit 1; \
fi; \
if [ -n "$(AUTOCLEAN)" ]; then $(MAKE) distclean; fi; \
done; \
......
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