aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-26 16:09:14 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-26 16:09:14 -0700
commit85f34a929dc0f8c82f7167fe100d5264d7374876 (patch)
treeb91491510bf7d8165bcfeb1f3a54bf4d36a05318 /Makefile
parent6fe1b1407ed91823daa5d487abe457ff37463349 (diff)
parenta22ae753cb297cb8a1e3ae950ae4415190cd51d5 (diff)
downloadgit-85f34a929dc0f8c82f7167fe100d5264d7374876.tar.gz
git-85f34a929dc0f8c82f7167fe100d5264d7374876.tar.xz
Merge branch 'rs/cocci'
Code cleanup. * rs/cocci: use strbuf_addstr() for adding constant strings to a strbuf, part 2 add coccicheck make target contrib/coccinelle: fix semantic patch for oid_to_hex_r()
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index df4f86bb3..e8b060a23 100644
--- a/Makefile
+++ b/Makefile
@@ -461,6 +461,7 @@ CURL_CONFIG = curl-config
PTHREAD_LIBS = -lpthread
PTHREAD_CFLAGS =
GCOV = gcov
+SPATCH = spatch
export TCL_PATH TCLTK_PATH
@@ -2308,6 +2309,18 @@ check: common-cmds.h
exit 1; \
fi
+C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
+%.cocci.patch: %.cocci $(C_SOURCES)
+ @echo ' ' SPATCH $<; \
+ for f in $(C_SOURCES); do \
+ $(SPATCH) --sp-file $< $$f; \
+ done >$@ 2>$@.log; \
+ if test -s $@; \
+ then \
+ echo ' ' SPATCH result: $@; \
+ fi
+coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci))
+
### Installation rules
ifneq ($(filter /%,$(firstword $(template_dir))),)
@@ -2499,6 +2512,7 @@ clean: profile-clean coverage-clean
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
+ $(RM) contrib/coccinelle/*.cocci.patch*
$(MAKE) -C Documentation/ clean
ifndef NO_PERL
$(MAKE) -C gitweb clean