Makefile.am 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ## Process this file with automake to create Makefile.in.
  2. AUTOMAKE_OPTIONS = 1.12
  3. SUBDIRS = po lib src doc contrib misc
  4. if HAVE_TESTS
  5. SUBDIRS += tests
  6. endif
  7. EXTRA_DIST =
  8. dist_noinst_SCRIPTS = \
  9. build-glib2.sh \
  10. version.sh
  11. dist_noinst_HEADERS = $(top_srcdir)/mc-version.h
  12. ACLOCAL_AMFLAGS = -I m4
  13. CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/mc-version.h
  14. .PHONY: update-version \
  15. cppcheck \
  16. cppcheck-error \
  17. cppcheck-information \
  18. cppcheck-performance \
  19. cppcheck-portability \
  20. cppcheck-style \
  21. cppcheck-warning \
  22. cppcheck-all
  23. update-version:
  24. @if test -x $(top_srcdir)/version.sh; then \
  25. $(top_srcdir)/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \
  26. else \
  27. if test ! -e $(top_srcdir)/mc-version.h; then \
  28. echo "File not found: $(top_srcdir)/version.sh"; \
  29. exit 1; \
  30. fi; \
  31. fi
  32. $(top_srcdir)/mc-version.h: update-version
  33. CPPCHECK_CMD = cppcheck \
  34. --inline-suppr \
  35. --error-exitcode=0 \
  36. -j 4 \
  37. --force \
  38. -I $(top_srcdir)/lib \
  39. --language=c \
  40. --std=c99
  41. CPPCHECK_DIRS = \
  42. "$(top_srcdir)/lib" \
  43. "$(top_srcdir)/src"
  44. CPPCHECK_OUT_PREFIX = $(top_builddir)/cppcheck-
  45. CPPCHECK_OUT_EXT = log.txt
  46. CPPCHECK_SED_FILTER = \
  47. -e '/\/src\/vfs\/smbfs\//d' \
  48. -e '/is reassigned a value before the old one has been used./d' \
  49. -e '/ Unmatched suppression: /d' \
  50. -e "/Skipping configuration '.*' since the value of '.*' is unknown./d"
  51. cppcheck:
  52. $(CPPCHECK_CMD) --enable=all $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT);
  53. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT)
  54. cppcheck-all: cppcheck
  55. cppcheck-information:
  56. $(CPPCHECK_CMD) --enable=information $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)information.$(CPPCHECK_OUT_EXT);
  57. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)information.$(CPPCHECK_OUT_EXT)
  58. cppcheck-performance:
  59. $(CPPCHECK_CMD) --enable=performance $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT);
  60. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT)
  61. cppcheck-portability:
  62. $(CPPCHECK_CMD) --enable=portability $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT);
  63. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT)
  64. cppcheck-style:
  65. $(CPPCHECK_CMD) --enable=style $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT);
  66. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT)
  67. cppcheck-warning:
  68. $(CPPCHECK_CMD) --enable=warning $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT);
  69. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT)
  70. cppcheck-unusedFunction:
  71. $(CPPCHECK_CMD) --enable=unusedFunction $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT);
  72. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT)
  73. cppcheck-missingInclude:
  74. $(CPPCHECK_CMD) --enable=missingInclude $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT);
  75. $(SED) -i $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT)
  76. cppcheck-split-all: \
  77. cppcheck-information \
  78. cppcheck-performance \
  79. cppcheck-portability \
  80. cppcheck-style \
  81. cppcheck-warning \
  82. cppcheck-unusedFunction \
  83. cppcheck-missingInclude
  84. INDENT_CMD = indent \
  85. --gnu-style \
  86. --format-first-column-comments \
  87. --indent-level4 \
  88. --brace-indent0 \
  89. --line-length100 \
  90. --no-tabs \
  91. --blank-lines-after-procedures
  92. INDENT_DIRS = \
  93. "$(top_srcdir)/lib" \
  94. "$(top_srcdir)/src" \
  95. "$(top_srcdir)/tests"
  96. indent:
  97. for directory in $(INDENT_DIRS); do \
  98. find "$${directory}" -name '*.[ch]' -print0 | \
  99. xargs -0 $(INDENT_CMD); \
  100. done