From 04009dc99476b67f0644eb80456a9d7682ccbc7b Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Thu, 28 Aug 2014 15:15:36 +0200 Subject: [PATCH] Add a make cocci target --- Makefile.am | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Makefile.am b/Makefile.am index 9949cdd5f..8af2fcb60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,4 +16,23 @@ check-local: --kyuafile='$(top_srcdir)/Kyuafile' \ --build-root='$(top_builddir)' +COCCI_ARGS= -I ${top_srcdir} \ + -I /usr/include \ + -I /usr/local/include \ + -I ${top_srcdir}/libpkg \ + -I ${top_srcdir}/src \ + -I ${top_srcdir}/external/expat/lib \ + -I ${top_srcdir}/external/libyaml/include \ + -I ${top_srcdir}/external/libucl/include \ + -I ${top_srcdir}/external/uthash \ + -I ${top_srcdir}/external/sqlite \ + -I ${top_srcdir}/external/libelf + +cocci: + for c in ${top_srcdir}/tests/cocci/*.cocci ; do \ + spatch ${COCCI_ARGS} -in_place -sp_file $c -dir libpkg ; \ + spatch ${COCCI_ARGS} -in_place -sp_file $c -dir src ; \ + done + + SUBDIRS = external libpkg src tests scripts docs