diff options
author | Dave Beckett <dave@dajobe.org> | 2013-11-08 08:45:18 -0800 |
---|---|---|
committer | Dave Beckett <dave@dajobe.org> | 2013-11-08 08:45:18 -0800 |
commit | d56cd106a2a79e18559bccaef167f940317e7598 (patch) | |
tree | 63e2f0524d4a54964aa6151fd5e8367ad5d16323 /librdfa/Makefile.am | |
parent | b9bd0316a30b9bc3994934ddcb869c0a4a02a098 (diff) | |
download | raptor-d56cd106a2a79e18559bccaef167f940317e7598.tar.gz |
Add analyze target
Diffstat (limited to 'librdfa/Makefile.am')
-rw-r--r-- | librdfa/Makefile.am | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/librdfa/Makefile.am b/librdfa/Makefile.am index 1be09e4a..6391e0bb 100644 --- a/librdfa/Makefile.am +++ b/librdfa/Makefile.am @@ -3,6 +3,14 @@ # Makefile for librdfa convienience library # +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + if LIBRDFA noinst_LTLIBRARIES = librdfa.la AM_CPPFLAGS = -DLIBRDFA_IN_RAPTOR -I$(srcdir) @@ -53,3 +61,21 @@ strtok_r.h \ config.h endif + +if MAINTAINER_MODE +# Run Clang static analyzer over sources. +analyze: $(SOURCES) + @list='$(SOURCES)'; \ + result=0; \ + for file in $$list; do \ + if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ + $(RECHO) "Analyzing $$file"; \ + $(ANALYZE_COMMAND) $(srcdir)/$$file; \ + status=$$?; \ + if test $$status != 0; then \ + result=1; \ + fi; \ + fi; \ + done; \ + set -e; exit $$result +endif |