Makefiles: Propagate recursive command failures

Return the failing submake status from the top-level and Debian build
loops instead of turning an early failure into success. Collect and
check the statuses of the parallel iSCSI and SRP cleanup jobs as well.
This commit is contained in:
Gleb Chesnokov
2026-08-21 19:58:59 +03:00
parent f0b22d068b
commit f30bf2b208
4 changed files with 32 additions and 15 deletions
+12 -3
View File
@@ -6,6 +6,8 @@ ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
SCST_DIR := $(shell echo "$$PWD")/../scst/src
ifeq ($(KVER),)
@@ -158,11 +160,18 @@ check:
clean:
rm -rf conftest/pre_cflags conftest/kcflags
rm -rf conftest/*/{build-output,result}*.txt
status=0; pids=(); \
for d in conftest/* src; do \
[ -d "$$d" ] && $(MAKE) -C $(KDIR) M=$(shell pwd)/$$d $@ & \
rm -f $$d/result*.txt; \
if [ -d "$$d" ]; then \
$(MAKE) -C $(KDIR) M=$(shell pwd)/$$d $@ & \
pids+=("$$!"); \
fi; \
rm -f $$d/result*.txt || status=$$?; \
done; \
wait
for pid in "$${pids[@]}"; do \
wait "$$pid" || status=$$?; \
done; \
exit $$status
extraclean: clean
rm -f *.orig *.rej