summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-30 14:07:19 -0700
committerJunio C Hamano <gitster@pobox.com>2017-03-30 14:07:19 -0700
commit876eb616d306868793997df1adc0331d0f18012f (patch)
treee6ec49453769c963d3550a2641a19387f3ba626a /Makefile
parente711824c5ec4eb65f5022c75f33a4c5f0b157b65 (diff)
parentf5c2bc2b9699d9333e7e73c68db4ee266c24f9cf (diff)
downloadgit-876eb616d306868793997df1adc0331d0f18012f.tar.gz
Merge branch 'jk/make-coccicheck-detect-errors'
Build fix. * jk/make-coccicheck-detect-errors: Makefile: detect errors in running spatch
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9f8b35ad41..9b36068ac5 100644
--- a/Makefile
+++ b/Makefile
@@ -2348,9 +2348,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: $@; \