Commit 800c31bf28aa4ffb82a7ac8f94b4ee8f4da863de

Authored by Jürgen Knödlseder
1 parent 9820edef

Add targets for code analysis

Showing 1 changed file with 75 additions and 0 deletions
Makefile.am
@@ -29,6 +29,81 @@ install-data-local: $(HTML_INSTALL_DATA_TARGETS) @@ -29,6 +29,81 @@ install-data-local: $(HTML_INSTALL_DATA_TARGETS)
29 29
30 uninstall-local: $(HTML_UNINSTALL_DATA_TARGETS) 30 uninstall-local: $(HTML_UNINSTALL_DATA_TARGETS)
31 31
  32 +#
  33 +# Additional rules
  34 +#
  35 +
  36 +# Add static-analysis rule:
  37 +static-analysis: cppcheck sloccount cppncss
  38 +
  39 +# Add dynamic-analysis rule:
  40 +dynamic-analysis: coverage valgrind
  41 +
  42 +# Add cppcheck rule
  43 +cppcheck:
  44 + @if type cppcheck >/dev/null 2>&1; then \
  45 + cppcheck -v --enable=all --xml \
  46 + src/* src 2> cppcheck-result.xml; \
  47 + else \
  48 + echo "cppcheck not found in PATH."; \
  49 + fi
  50 +
  51 +# Add sloccount rule
  52 +sloccount:
  53 + @if type sloccount >/dev/null 2>&1; then \
  54 + sloccount --duplicates --wide --details \
  55 + src test > sloccount.sc; \
  56 + else \
  57 + echo "sloccount not found in PATH."; \
  58 + fi
  59 +
  60 +# Add cppncss rule
  61 +cppncss:
  62 + @if type cppncss >/dev/null 2>&1; then \
  63 + cppncss -r -v -x -k -f=cppncss-raw-report.xml \
  64 + src inst/*/src; \
  65 + else \
  66 + echo "cppncss not found in PATH."; \
  67 + fi
  68 +
  69 +# Add coverage rule
  70 +coverage:
  71 + @if type gcovr >/dev/null 2>&1; then \
  72 + gcovr -r . -x -o gcovr-reports-data.xml; \
  73 + else \
  74 + echo "gcovr script not found in PATH."; \
  75 + fi
  76 +
  77 +# Add Valgrind rule
  78 +valgrind:
  79 + @if type valgrind >/dev/null 2>&1; then \
  80 + $(MAKE) -C test valgrind; \
  81 + else \
  82 + echo "valgrind not found in PATH."; \
  83 + fi
  84 +
  85 +# Add Sphinx rule
  86 +sphinx:
  87 + @if type sphinx-build >/dev/null 2>&1; then \
  88 + sphinx-build -b html doc/source doc/html; \
  89 + else \
  90 + echo "sphinx-build not found in PATH."; \
  91 + fi
  92 +
  93 +# Install Sphinx files
  94 +sphinx-install:
  95 + @if test -f $(srcdir)/doc/html/index.html ; then \
  96 + $(mkinstalldirs) $(DESTDIR)$(docdir)/html && \
  97 + for file in $(srcdir)/doc/html/*.* ; do \
  98 + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/html" ; \
  99 + $(INSTALL_DATA) "$$file" $(DESTDIR)$(docdir)/html ; \
  100 + done ; \
  101 + cp -r $(srcdir)/doc/html/_sources $(DESTDIR)$(docdir)/html/ ; \
  102 + cp -r $(srcdir)/doc/html/_static $(DESTDIR)$(docdir)/html/ ; \
  103 + fi
  104 +
  105 +# Add documentation rule:
  106 +#doc: doxygen sphinx
32 107
33 # Non-Automake subdirectories to distribute 108 # Non-Automake subdirectories to distribute
34 DISTDIRS = doc/html doc/html/images 109 DISTDIRS = doc/html doc/html/images