Merge branch 'sg/coccicheck-updates'
Update the way we use Coccinelle to find out-of-style code that need to be modernised. * sg/coccicheck-updates: coccinelle: extract dedicated make target to clean Coccinelle's results coccinelle: put sane filenames into output patches coccinelle: exclude sha1dc source files from static analysis coccinelle: use $(addsuffix) in 'coccicheck' make target coccinelle: mark the 'coccicheck' make target as .PHONY
This commit is contained in:
commit
bce8031d9a
24
Makefile
24
Makefile
@ -569,7 +569,7 @@ SPATCH = spatch
|
|||||||
export TCL_PATH TCLTK_PATH
|
export TCL_PATH TCLTK_PATH
|
||||||
|
|
||||||
SPARSE_FLAGS =
|
SPARSE_FLAGS =
|
||||||
SPATCH_FLAGS = --all-includes
|
SPATCH_FLAGS = --all-includes --patch .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2680,10 +2680,16 @@ check: command-list.h
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
|
C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
|
||||||
%.cocci.patch: %.cocci $(C_SOURCES)
|
ifdef DC_SHA1_SUBMODULE
|
||||||
|
COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
|
||||||
|
else
|
||||||
|
COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
|
||||||
|
endif
|
||||||
|
|
||||||
|
%.cocci.patch: %.cocci $(COCCI_SOURCES)
|
||||||
@echo ' ' SPATCH $<; \
|
@echo ' ' SPATCH $<; \
|
||||||
ret=0; \
|
ret=0; \
|
||||||
for f in $(C_SOURCES); do \
|
for f in $(COCCI_SOURCES); do \
|
||||||
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
|
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
|
||||||
{ ret=$$?; break; }; \
|
{ ret=$$?; break; }; \
|
||||||
done >$@+ 2>$@.log; \
|
done >$@+ 2>$@.log; \
|
||||||
@ -2697,7 +2703,9 @@ C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
|
|||||||
then \
|
then \
|
||||||
echo ' ' SPATCH result: $@; \
|
echo ' ' SPATCH result: $@; \
|
||||||
fi
|
fi
|
||||||
coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci))
|
coccicheck: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.cocci))
|
||||||
|
|
||||||
|
.PHONY: coccicheck
|
||||||
|
|
||||||
### Installation rules
|
### Installation rules
|
||||||
|
|
||||||
@ -2909,7 +2917,10 @@ profile-clean:
|
|||||||
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
||||||
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
|
||||||
|
|
||||||
clean: profile-clean coverage-clean
|
cocciclean:
|
||||||
|
$(RM) contrib/coccinelle/*.cocci.patch*
|
||||||
|
|
||||||
|
clean: profile-clean coverage-clean cocciclean
|
||||||
$(RM) *.res
|
$(RM) *.res
|
||||||
$(RM) $(OBJECTS)
|
$(RM) $(OBJECTS)
|
||||||
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
|
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
|
||||||
@ -2921,7 +2932,6 @@ clean: profile-clean coverage-clean
|
|||||||
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
|
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
|
||||||
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
||||||
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
|
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
|
||||||
$(RM) contrib/coccinelle/*.cocci.patch*
|
|
||||||
$(MAKE) -C Documentation/ clean
|
$(MAKE) -C Documentation/ clean
|
||||||
ifndef NO_PERL
|
ifndef NO_PERL
|
||||||
$(MAKE) -C gitweb clean
|
$(MAKE) -C gitweb clean
|
||||||
@ -2937,7 +2947,7 @@ endif
|
|||||||
$(RM) GIT-USER-AGENT GIT-PREFIX
|
$(RM) GIT-USER-AGENT GIT-PREFIX
|
||||||
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
|
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
|
||||||
|
|
||||||
.PHONY: all install profile-clean clean strip
|
.PHONY: all install profile-clean cocciclean clean strip
|
||||||
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
|
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
|
||||||
.PHONY: FORCE cscope
|
.PHONY: FORCE cscope
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user