summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 76267262c1..c3001709c7 100644
--- a/Makefile
+++ b/Makefile
@@ -2329,9 +2329,17 @@ check: common-cmds.h
C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
%.cocci.patch: %.cocci $(C_SOURCES)
@echo ' ' SPATCH $<; \
+ ret=0; \
for f in $(C_SOURCES); do \
- $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS); \
- done >$@ 2>$@.log; \
+ $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
+ { ret=$$?; break; }; \
+ done >$@+ 2>$@.log; \
+ if test $$ret != 0; \
+ then \
+ cat $@.log; \
+ exit 1; \
+ fi; \
+ mv $@+ $@; \
if test -s $@; \
then \
echo ' ' SPATCH result: $@; \