2 # Copyright (c) 2020 Project nlbuild-autotools Authors. All Rights Reserved.
3 # Copyright (c) 2016 Nest Labs Inc. All Rights Reserved.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
20 # This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
24 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
27 # Local headers to build against and distribute but not to install
28 # since they are not part of the package.
31 @PACKAGE_SHORT_LOWER@-test.h \
35 # Other files we do want to distribute with the package.
40 if @PACKAGE_SHORT_UPPER@_BUILD_TESTS
41 # C preprocessor option flags that will apply to all compiled objects in this
45 -I$(top_srcdir)/include \
49 -L${top_builddir}/src -l@PACKAGE_SHORT_LOWER@
52 # Test applications that should be run when the 'check' target is run.
55 @PACKAGE_SHORT_LOWER@-test \
56 @PACKAGE_SHORT_LOWER@-test-cxx \
59 # Test applications and scripts that should be built and run when the
60 # 'check' target is run.
66 # The additional environment variables and their values that will be
67 # made available to all programs and scripts in TESTS.
72 # Source, compiler, and linker options for test programs.
74 @PACKAGE_SHORT_LOWER@_test_LDADD = $(COMMON_LDADD)
75 @PACKAGE_SHORT_LOWER@_test_SOURCES = @PACKAGE_SHORT_LOWER@-test.c
77 @PACKAGE_SHORT_LOWER@_test_cxx_LDADD = $(COMMON_LDADD)
78 @PACKAGE_SHORT_LOWER@_test_cxx_SOURCES = @PACKAGE_SHORT_LOWER@-test-cxx.cpp
80 # Foreign make dependencies
82 NLFOREIGN_FILE_DEPENDENCIES = \
85 NLFOREIGN_SUBDIR_DEPENDENCIES = \
86 $(NLUNIT_TEST_FOREIGN_SUBDIR_DEPENDENCY) \
90 $(check_PROGRAMS): $(NLFOREIGN_FILE_DEPENDENCIES)
92 if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
93 CLEANFILES = $(wildcard *.gcda *.gcno)
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.
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}
103 $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE):
104 $(call create-directory)
106 $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO): check-local | $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
107 $(call generate-coverage-report,${top_builddir})
109 coverage-local: $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO)
111 clean-local: clean-local-coverage
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
120 include $(abs_top_nlbuild_autotools_dir)/automake/post.am