1 # Copyright 2010 The Kyua Authors.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the name of Google Inc. nor the names of its contributors
14 # may be used to endorse or promote products derived from this software
15 # without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 ACLOCAL_AMFLAGS = -I m4
31 CHECK_BOOTSTRAP_DEPS =
44 doc_DATA = AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE NEWS.md
45 noinst_DATA += INSTALL.md README.md
46 EXTRA_DIST += $(doc_DATA) INSTALL.md README.md
49 tests_topdir = $(pkgtestsdir)
51 tests_top_DATA = Kyuafile
52 EXTRA_DIST += $(tests_top_DATA)
55 include admin/Makefile.am.inc
56 include bootstrap/Makefile.am.inc
57 include cli/Makefile.am.inc
58 include doc/Makefile.am.inc
59 include drivers/Makefile.am.inc
60 include engine/Makefile.am.inc
61 include examples/Makefile.am.inc
62 include integration/Makefile.am.inc
63 include misc/Makefile.am.inc
64 include model/Makefile.am.inc
65 include store/Makefile.am.inc
66 include utils/Makefile.am.inc
69 kyua_SOURCES = main.cpp
70 kyua_CXXFLAGS = $(CLI_CFLAGS) $(ENGINE_CFLAGS) $(UTILS_CFLAGS)
71 kyua_LDADD = $(CLI_LIBS) $(ENGINE_LIBS) $(UTILS_LIBS)
73 CHECK_ENVIRONMENT = KYUA_CONFDIR="/non-existent" \
74 KYUA_DOCDIR="$(abs_top_srcdir)" \
75 KYUA_EXAMPLESDIR="$(abs_top_srcdir)/examples" \
76 KYUA_MISCDIR="$(abs_top_srcdir)/misc" \
77 KYUA_STOREDIR="$(abs_top_srcdir)/store" \
78 KYUA_STORETESTDATADIR="$(abs_top_srcdir)/store" \
79 PATH="$(abs_top_builddir):$${PATH}"
80 INSTALLCHECK_ENVIRONMENT = KYUA_CONFDIR="/non-existent" \
81 PATH="$(prefix)/bin:$${PATH}"
83 # Generate local-kyua, a wrapper shell script to run the just-built 'kyua'
84 # binary by pointing it to the possibly not-yet-installed data files in the
86 noinst_SCRIPTS += local-kyua
87 CLEANFILES += local-kyua local-kyua.tmp
89 $(AM_V_GEN)echo '#!/bin/sh' >local-kyua.tmp; \
90 echo 'env $(CHECK_ENVIRONMENT) $(TESTS_ENVIRONMENT)' \
91 '"$(abs_top_builddir)/kyua" \
92 --config='$(KYUA_CONFIG_FILE_FOR_CHECK)' \
93 "$${@}"' >>local-kyua.tmp; \
94 chmod +x local-kyua.tmp; \
95 mv -f local-kyua.tmp local-kyua
98 CHECK_LOCAL += dump-ulimits check-kyua
99 PHONY_TARGETS += check-kyua
100 check-kyua: $(CHECK_KYUA_DEPS)
103 --kyuafile='$(top_srcdir)/Kyuafile' --build-root='$(top_builddir)' \
105 if [ "$${failed}" = yes ]; then \
106 ./local-kyua report --results-file='$(abs_top_srcdir)' \
107 --verbose --results-filter=broken,failed; \
111 installcheck-local: dump-ulimits installcheck-kyua
112 PHONY_TARGETS += installcheck-kyua
115 cd $(pkgtestsdir) && $(INSTALLCHECK_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
116 kyua --config='$(KYUA_CONFIG_FILE_FOR_CHECK)' test \
118 if [ "$${failed}" = yes ]; then \
119 cd $(pkgtestsdir) && $(INSTALLCHECK_ENVIRONMENT) \
120 $(TESTS_ENVIRONMENT) \
121 kyua --config='$(KYUA_CONFIG_FILE_FOR_CHECK)' report \
122 --verbose --results-filter=broken,failed; \
126 # TODO(jmmv): kyua should probably be recording this information itself as part
127 # of the execution context, just as we record environment variables.
128 PHONY_TARGETS += dump-ulimits
130 @echo "Resource limits:"
132 ulimit -a | sed -e 's,$$, (soft),'; \
133 ulimit -a -H | sed -e 's,$$, (hard),'; \
134 } | sort | sed -e 's,^, ,'
137 DIST_HOOKS += forbid-dist
138 PHONY_TARGETS += forbid-dist
140 @echo "Sorry; cannot make dist without atf."
143 check-local: $(CHECK_LOCAL)
146 # Runs doxygen on the source tree and validates the contents of the docstrings.
147 # We do not do this by default, even if doxygen has been enabled, because this
148 # step takes a long time. Instead, we just rely on a Travis CI build to catch
150 PHONY_TARGETS += check-api-docs
151 check-api-docs: api-docs/api-docs.tag
152 @$(AWK) -f $(srcdir)/admin/check-api-docs.awk api-docs/doxygen.out
154 api-docs/api-docs.tag: $(builddir)/Doxyfile $(SOURCES)
156 @rm -f api-docs/doxygen.out api-docs/doxygen.out.tmp
157 $(AM_V_GEN)$(DOXYGEN) $(builddir)/Doxyfile \
158 >api-docs/doxygen.out.tmp 2>&1 && \
159 mv api-docs/doxygen.out.tmp api-docs/doxygen.out
161 CLEAN_TARGETS += clean-api-docs
166 # Replace Automake's builtin check-news functionality so that we can validate
167 # the NEWS.md file instead of NEWS.
168 DIST_HOOKS += check-news
169 PHONY_TARGETS += check-news
171 @case "$$(sed 15q "$(srcdir)/NEWS.md")" in \
172 *"$(VERSION)"*) : ;; \
174 echo "NEWS.md not updated; not releasing" 1>&2; \
179 clean-local: $(CLEAN_TARGETS)
180 dist-hook: $(DIST_HOOKS)
182 PHONY_TARGETS += clean-all
184 GIT="$(GIT)" $(SH) $(srcdir)/admin/clean-all.sh
186 .PHONY: $(PHONY_TARGETS)