Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlio / repo / third_party / nlbuild-autotools / repo / examples / Makefile-tests.am
1 #
2 #    Copyright (c) 2020 Project nlbuild-autotools Authors. All Rights Reserved.
3 #    Copyright (c) 2016 Nest Labs Inc. All Rights Reserved.
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #    http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16 #
17
18 #
19 #    Description:
20 #      This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
21 #      unit tests.
22 #
23
24 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
25
26 #
27 # Local headers to build against and distribute but not to install
28 # since they are not part of the package.
29 #
30 noinst_HEADERS                                 = \
31     @PACKAGE_SHORT_LOWER@-test.h                 \
32     $(NULL)
33
34 #
35 # Other files we do want to distribute with the package.
36 #
37 EXTRA_DIST                                     = \
38     $(NULL)
39
40 if @PACKAGE_SHORT_UPPER@_BUILD_TESTS
41 # C preprocessor option flags that will apply to all compiled objects in this
42 # makefile.
43
44 AM_CPPFLAGS                                    = \
45     -I$(top_srcdir)/include                      \
46     $(NULL)
47
48 COMMON_LDADD                                   = \
49     -L${top_builddir}/src -l@PACKAGE_SHORT_LOWER@
50     $(NULL)
51
52 # Test applications that should be run when the 'check' target is run.
53
54 check_PROGRAMS                                 = \
55     @PACKAGE_SHORT_LOWER@-test                   \
56     @PACKAGE_SHORT_LOWER@-test-cxx               \
57     $(NULL)
58
59 # Test applications and scripts that should be built and run when the
60 # 'check' target is run.
61
62 TESTS                                          = \
63     $(check_PROGRAMS)                            \
64     $(NULL)
65
66 # The additional environment variables and their values that will be
67 # made available to all programs and scripts in TESTS.
68
69 TESTS_ENVIRONMENT                              = \
70     $(NULL)
71
72 # Source, compiler, and linker options for test programs.
73
74 @PACKAGE_SHORT_LOWER@_test_LDADD               = $(COMMON_LDADD)
75 @PACKAGE_SHORT_LOWER@_test_SOURCES             = @PACKAGE_SHORT_LOWER@-test.c                 
76
77 @PACKAGE_SHORT_LOWER@_test_cxx_LDADD           = $(COMMON_LDADD)
78 @PACKAGE_SHORT_LOWER@_test_cxx_SOURCES         = @PACKAGE_SHORT_LOWER@-test-cxx.cpp
79
80 # Foreign make dependencies
81
82 NLFOREIGN_FILE_DEPENDENCIES                           = \
83    $(NULL)
84
85 NLFOREIGN_SUBDIR_DEPENDENCIES                         = \
86    $(NLUNIT_TEST_FOREIGN_SUBDIR_DEPENDENCY)             \
87    ${top_builddir}/src                                  \
88    $(NULL)
89
90 $(check_PROGRAMS): $(NLFOREIGN_FILE_DEPENDENCIES)
91
92 if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
93 CLEANFILES                                     = $(wildcard *.gcda *.gcno)
94
95 if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS
96 # The bundle should positively be qualified with the absolute build
97 # path. Otherwise, VPATH will get auto-prefixed to it if there is
98 # already such a directory in the non-colocated source tree.
99
100 @PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE                           = ${abs_builddir}/${PACKAGE}${NL_COVERAGE_BUNDLE_SUFFIX}
101 @PACKAGE_SHORT_UPPER@_COVERAGE_INFO                             = ${@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE}/${PACKAGE}${NL_COVERAGE_INFO_SUFFIX}
102
103 $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE):
104         $(call create-directory)
105
106 $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO): check-local | $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
107         $(call generate-coverage-report,${top_builddir})
108
109 coverage-local: $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO)
110
111 clean-local: clean-local-coverage
112
113 .PHONY: clean-local-coverage
114 clean-local-coverage:
115         -$(AM_V_at)rm -rf $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
116 endif # @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS
117 endif # @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
118 endif # @PACKAGE_SHORT_UPPER@_BUILD_TESTS
119
120 include $(abs_top_nlbuild_autotools_dir)/automake/post.am