]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/atf/Makefile.am
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / contrib / atf / Makefile.am
1 #
2 # Automated Testing Framework (atf)
3 #
4 # Copyright (c) 2007 The NetBSD Foundation, Inc.
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
9 # are met:
10 # 1. Redistributions of source code must retain the above copyright
11 #    notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 #    notice, this list of conditions and the following disclaimer in the
14 #    documentation and/or other materials provided with the distribution.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #
29
30 atf_aclocal_DATA =
31 BUILT_SOURCES =
32 CLEANFILES =
33 EXTRA_DIST =
34 bin_PROGRAMS =
35 dist_man_MANS =
36 include_HEADERS =
37 lib_LTLIBRARIES =
38 libexec_PROGRAMS =
39 man_MANS =
40 noinst_DATA =
41 noinst_LTLIBRARIES =
42 INSTALLCHECK_TARGETS =
43 PHONY_TARGETS =
44
45 ACLOCAL_AMFLAGS = -I m4
46 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-tools
47
48 include admin/Makefile.am.inc
49 include atf-c/Makefile.am.inc
50 include atf-c++/Makefile.am.inc
51 include atf-sh/Makefile.am.inc
52 include bootstrap/Makefile.am.inc
53 include doc/Makefile.am.inc
54 include test-programs/Makefile.am.inc
55
56 if ENABLE_TOOLS
57 include atf-report/Makefile.am.inc
58 include atf-config/Makefile.am.inc
59 include atf-run/Makefile.am.inc
60 include atf-version/Makefile.am.inc
61 endif
62
63 #
64 # Top-level distfile documents.
65 #
66
67 doc_DATA = AUTHORS COPYING NEWS README
68 noinst_DATA += INSTALL README
69 EXTRA_DIST += $(doc_DATA) INSTALL README
70
71 #
72 # Supporting logic to run our custom testsuite.
73 #
74
75 TESTS_ENVIRONMENT = PATH=$(prefix)/bin:$${PATH} \
76                     PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig
77
78 testsdir = $(exec_prefix)/tests
79 pkgtestsdir = $(testsdir)/$(PACKAGE)
80
81 if ENABLE_TOOLS
82 INSTALLCHECK_TARGETS += installcheck-atf
83 PHONY_TARGETS += installcheck-atf
84 installcheck-atf:
85         logfile=$$(pwd)/installcheck.log; \
86         fifofile=$$(pwd)/installcheck.fifo; \
87         cd $(pkgtestsdir); \
88         rm -f $${fifofile}; \
89         mkfifo $${fifofile}; \
90         cat $${fifofile} | tee $${logfile} | $(TESTS_ENVIRONMENT) atf-report & \
91         $(TESTS_ENVIRONMENT) atf-run >>$${fifofile}; \
92         res=$${?}; \
93         wait; \
94         rm $${fifofile}; \
95         echo; \
96         echo "The verbatim output of atf-run has been saved to" \
97              "installcheck.log; exit was $${res}"; \
98         test $${res} -eq 0
99 CLEANFILES += installcheck.fifo installcheck.log
100 endif
101
102 PHONY_TARGETS += installcheck-kyua
103 if HAVE_KYUA
104 installcheck-kyua:
105         cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test
106 endif
107
108 installcheck-targets: $(INSTALLCHECK_TARGETS)
109
110 pkgtests_DATA = Kyuafile
111 if ENABLE_TOOLS
112 pkgtests_DATA += Atffile
113 endif
114 EXTRA_DIST += $(pkgtests_DATA)
115
116 BUILD_SH_TP = \
117         echo "Creating $${dst}"; \
118         echo "\#! $(bindir)/atf-sh" >$${dst}; \
119         cat $${src} >>$${dst}; \
120         chmod +x $${dst}
121
122 #
123 # Custom targets.
124 #
125
126 dist-hook: forbid-dist
127 if ENABLE_TOOLS
128 forbid-dist:
129         @true
130 else
131 forbid-dist:
132         @echo "Sorry; cannot make dist without the tools enabled."
133         @echo "Please reconfigure with --enable-tools."
134         @false
135 endif
136
137 PHONY_TARGETS += clean-all
138 clean-all:
139         GIT="$(GIT)" $(SH) $(srcdir)/admin/clean-all.sh
140
141 PHONY_TARGETS += release
142 release:
143         $(SH) $(srcdir)/admin/release.sh $(PACKAGE_VERSION) $(DIST_ARCHIVES)
144
145 PHONY_TARGETS += release-test
146 release-test:
147         $(SH) $(srcdir)/admin/release-test.sh $(DIST_ARCHIVES)
148
149 .PHONY: $(PHONY_TARGETS)
150
151 # vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8