1 ## Process this file with automake to create Makefile.in.
2 AUTOMAKE_OPTIONS = 1.14
4 SUBDIRS = po lib src doc contrib misc
12 dist_noinst_SCRIPTS = \
16 dist_noinst_HEADERS = $(top_srcdir)/mc-version.h
18 ACLOCAL_AMFLAGS = -I m4
20 CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/mc-version.h
22 .PHONY: update-version \
25 cppcheck-information \
26 cppcheck-performance \
27 cppcheck-portability \
34 @if test -x $(top_srcdir)/version.sh; then \
35 $(top_srcdir)/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \
37 if test ! -e $(top_srcdir)/mc-version.h; then \
38 echo "File not found: $(top_srcdir)/version.sh"; \
43 $(top_srcdir)/mc-version.h: update-version
45 CPPCHECK_CMD = cppcheck \
50 -I $(top_srcdir)/lib \
58 CPPCHECK_OUT_PREFIX = $(top_builddir)/cppcheck-
60 CPPCHECK_OUT_EXT = log.txt
62 CPPCHECK_SED_FILTER = \
63 -e '/is reassigned a value before the old one has been used./d' \
64 -e '/ Unmatched suppression: /d' \
65 -e "/Skipping configuration '.*' since the value of '.*' is unknown./d"
68 $(CPPCHECK_CMD) --enable=all $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT).tmp;
69 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT)
70 rm -f $(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT).tmp
72 cppcheck-all: cppcheck
75 $(CPPCHECK_CMD) --enable=information $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)information.$(CPPCHECK_OUT_EXT).tmp;
76 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)information.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)information.$(CPPCHECK_OUT_EXT)
77 rm -f $(CPPCHECK_OUT_PREFIX)all.$(CPPCHECK_OUT_EXT).tmp
80 $(CPPCHECK_CMD) --enable=performance $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT).tmp;
81 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT)
82 rm -f $(CPPCHECK_OUT_PREFIX)performance.$(CPPCHECK_OUT_EXT).tmp
85 $(CPPCHECK_CMD) --enable=portability $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT).tmp;
86 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT)
87 rm -f $(CPPCHECK_OUT_PREFIX)portability.$(CPPCHECK_OUT_EXT).tmp
90 $(CPPCHECK_CMD) --enable=style $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT).tmp;
91 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT)
92 rm -f $(CPPCHECK_OUT_PREFIX)style.$(CPPCHECK_OUT_EXT).tmp
95 $(CPPCHECK_CMD) --enable=warning $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT).tmp;
96 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT)
97 rm -f $(CPPCHECK_OUT_PREFIX)warning.$(CPPCHECK_OUT_EXT).tmp
99 cppcheck-unusedFunction:
100 $(CPPCHECK_CMD) --enable=unusedFunction $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT).tmp;
101 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT)
102 rm -f $(CPPCHECK_OUT_PREFIX)unusedFunction.$(CPPCHECK_OUT_EXT).tmp
104 cppcheck-missingInclude:
105 $(CPPCHECK_CMD) --enable=missingInclude $(CPPCHECK_DIRS) 2>$(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT).tmp;
106 $(SED) $(CPPCHECK_SED_FILTER) $(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT).tmp > $(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT)
107 rm -f $(CPPCHECK_OUT_PREFIX)missingInclude.$(CPPCHECK_OUT_EXT).tmp
109 cppcheck-split-all: \
110 cppcheck-information \
111 cppcheck-performance \
112 cppcheck-portability \
115 cppcheck-unusedFunction \
116 cppcheck-missingInclude
118 INDENT_CMD = $(INDENT) \
120 --format-first-column-comments \
125 --blank-lines-after-procedures
128 "$(top_srcdir)/lib" \
129 "$(top_srcdir)/src" \
130 "$(top_srcdir)/tests"
133 for directory in $(INDENT_DIRS); do \
134 find "$${directory}" -name '*.[ch]' -print0 | \
135 xargs -0 $(INDENT_CMD); \