AyushP123

makefile

Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.56 KB | None | 0 0
  1.  
  2. .PHONY: coverage-reconfigure coverage-reconfigure-maintainer-mode coverage-check
  3.  
  4. # This relies on GNU make (for the pattern rule) but it's just a convenience
  5. # as you can run these check-* targets with any make using:
  6. #
  7. #   cd tests ; make check-FOO
  8. #
  9. # So the pain of maintaining a huge list of target forwarding rules here isn't
  10. # worth it.
  11. #
  12. # Note: We use @PERCENT@ here instead of a literal % to suppress an automake
  13. # portability warning.
  14. check-@PERCENT@:
  15.     cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
  16.  
  17. ## --disable-shared as shared builds fail for me on x86-64 Debian etch.
  18. ## If you're using ccache, you need ccache >= 3.0, released 2010-06-20 (older
  19. ## versions don't handle --coverage properly).  You need ccache >= 3.2.2 to
  20. ## actually cache compilations with --coverage - older 3.x just disables
  21. ## caching for them.
  22. COVERAGE_CONFIGURE = \
  23.     $(srcdir)/configure CXXFLAGS='-O0 --coverage' --disable-shared VALGRIND=
  24.  
  25. coverage-reconfigure: distclean
  26.     $(COVERAGE_CONFIGURE)
  27.  
  28. coverage-reconfigure-maintainer-mode: distclean
  29.     $(COVERAGE_CONFIGURE) --enable-maintainer-mode
  30.  
  31. coverage-check:
  32.     ## GNU find specific.
  33.     find . -name '*.gcda' -delete
  34.     ## Don't run under valgrind even if configure was run by hand.
  35.     $(MAKE) $(AM_MAKEFLAGS) check VALGRIND=
  36.     rm -f xapian-letor.lcov
  37.     lcov --capture -d . --quiet --rc 'lcov_branch_coverage=1' --no-external -o xapian-letor.lcov
  38.     rm -rf lcov
  39.     genhtml --demangle-cpp --branch-coverage $(GENHTML_ARGS) -q -p "`pwd`" -t "Test Coverage for xapian-letor `git log -n1 --abbrev-commit --format=%h`" -o lcov xapian-letor.lcov
Add Comment
Please, Sign In to add comment