1#
2# Automated Testing Framework (atf)
3#
4# Copyright (c) 2007, 2008, 2009, 2010 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
30lib_LTLIBRARIES += libatf-c.la
31libatf_c_la_SOURCES = atf-c/build.c \
32                      atf-c/build.h \
33                      atf-c/check.c \
34                      atf-c/check.h \
35                      atf-c/config.c \
36                      atf-c/config.h \
37                      atf-c/error.c \
38                      atf-c/error.h \
39                      atf-c/error_fwd.h \
40                      atf-c/macros.h \
41                      atf-c/tc.c \
42                      atf-c/tc.h \
43                      atf-c/tp.c \
44                      atf-c/tp.h \
45                      atf-c/utils.c \
46                      atf-c/utils.h
47nodist_libatf_c_la_SOURCES = atf-c/defs.h
48libatf_c_la_CPPFLAGS = "-DATF_ARCH=\"$(atf_arch)\"" \
49                       "-DATF_BUILD_CC=\"$(ATF_BUILD_CC)\"" \
50                       "-DATF_BUILD_CFLAGS=\"$(ATF_BUILD_CFLAGS)\"" \
51                       "-DATF_BUILD_CPP=\"$(ATF_BUILD_CPP)\"" \
52                       "-DATF_BUILD_CPPFLAGS=\"$(ATF_BUILD_CPPFLAGS)\"" \
53                       "-DATF_BUILD_CXX=\"$(ATF_BUILD_CXX)\"" \
54                       "-DATF_BUILD_CXXFLAGS=\"$(ATF_BUILD_CXXFLAGS)\"" \
55                       "-DATF_CONFDIR=\"$(atf_confdir)\"" \
56                       "-DATF_INCLUDEDIR=\"$(includedir)\"" \
57                       "-DATF_LIBDIR=\"$(libdir)\"" \
58                       "-DATF_LIBEXECDIR=\"$(libexecdir)\"" \
59                       "-DATF_MACHINE=\"$(atf_machine)\"" \
60                       "-DATF_M4=\"$(ATF_M4)\"" \
61                       "-DATF_PKGDATADIR=\"$(pkgdatadir)\"" \
62                       "-DATF_SHELL=\"$(ATF_SHELL)\"" \
63                       "-DATF_WORKDIR=\"$(ATF_WORKDIR)\"" \
64                       -I$(srcdir)/atf-c
65
66# XXX For some reason, the nodist line above does not work as expected.
67# Work this problem around.
68dist-hook: kill-defs-h
69kill-defs-h:
70	rm -f $(distdir)/atf-c/defs.h
71
72include_HEADERS += atf-c.h
73atf_c_HEADERS = atf-c/build.h \
74                atf-c/check.h \
75                atf-c/config.h \
76                atf-c/defs.h \
77                atf-c/error.h \
78                atf-c/error_fwd.h \
79                atf-c/macros.h \
80                atf-c/tc.h \
81                atf-c/tp.h \
82                atf-c/utils.h
83atf_cdir = $(includedir)/atf-c
84
85dist_man_MANS += atf-c/atf-c-api.3
86
87atf_cpkgconfigdir = $(atf_pkgconfigdir)
88atf_cpkgconfig_DATA = atf-c/atf-c.pc
89CLEANFILES += atf-c/atf-c.pc
90EXTRA_DIST += atf-c/atf-c.pc.in
91atf-c/atf-c.pc: $(srcdir)/atf-c/atf-c.pc.in
92	test -d atf-c || mkdir -p atf-c
93	sed -e 's,__ATF_VERSION__,@PACKAGE_VERSION@,g' \
94	    -e 's,__CC__,$(CC),g' \
95	    -e 's,__INCLUDEDIR__,$(includedir),g' \
96	    -e 's,__LIBDIR__,$(libdir),g' \
97	    <$(srcdir)/atf-c/atf-c.pc.in >atf-c/atf-c.pc.tmp
98	mv atf-c/atf-c.pc.tmp atf-c/atf-c.pc
99
100tests_atf_c_DATA = atf-c/Atffile \
101                   atf-c/macros_h_test.c
102tests_atf_cdir = $(pkgtestsdir)/atf-c
103EXTRA_DIST += $(tests_atf_c_DATA)
104
105tests_atf_c_PROGRAMS = atf-c/atf_c_test
106atf_c_atf_c_test_SOURCES = atf-c/atf_c_test.c
107atf_c_atf_c_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
108
109tests_atf_c_PROGRAMS += atf-c/build_test
110atf_c_build_test_SOURCES = atf-c/build_test.c atf-c/h_build.h
111atf_c_build_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
112
113tests_atf_c_PROGRAMS += atf-c/check_test
114atf_c_check_test_SOURCES = atf-c/check_test.c
115atf_c_check_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
116
117tests_atf_c_PROGRAMS += atf-c/config_test
118atf_c_config_test_SOURCES = atf-c/config_test.c
119atf_c_config_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
120
121tests_atf_c_PROGRAMS += atf-c/error_test
122atf_c_error_test_SOURCES = atf-c/error_test.c
123atf_c_error_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
124
125tests_atf_c_PROGRAMS += atf-c/macros_test
126atf_c_macros_test_SOURCES = atf-c/macros_test.c
127atf_c_macros_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
128
129tests_atf_c_SCRIPTS = atf-c/pkg_config_test
130CLEANFILES += atf-c/pkg_config_test
131EXTRA_DIST += atf-c/pkg_config_test.sh
132atf-c/pkg_config_test: $(srcdir)/atf-c/pkg_config_test.sh
133	test -d atf-c || mkdir -p atf-c
134	@src="$(srcdir)/atf-c/pkg_config_test.sh"; \
135	dst="atf-c/pkg_config_test"; $(BUILD_SH_TP)
136
137tests_atf_c_PROGRAMS += atf-c/tc_test
138atf_c_tc_test_SOURCES = atf-c/tc_test.c
139atf_c_tc_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
140
141tests_atf_c_PROGRAMS += atf-c/tp_test
142atf_c_tp_test_SOURCES = atf-c/tp_test.c
143atf_c_tp_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
144
145tests_atf_c_PROGRAMS += atf-c/utils_test
146atf_c_utils_test_SOURCES = atf-c/utils_test.c atf-c/h_build.h
147atf_c_utils_test_LDADD = atf-c/detail/libtest_helpers.la libatf-c.la
148
149include atf-c/detail/Makefile.am.inc
150
151# vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8
152