Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlunit-test / repo / Makefile.am
1 #
2 #    Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
3 #
4 #    Licensed under the Apache License, Version 2.0 (the "License");
5 #    you may not use this file except in compliance with the License.
6 #    You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS,
12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    See the License for the specific language governing permissions and
14 #    limitations under the License.
15 #
16
17 #
18 #    Description:
19 #      This file is the GNU automake template for the Nest memory-
20 #      mapped I/O library.
21 #
22
23 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
24
25 AM_MAKEFLAGS                        = --no-print-directory
26
27 SUBDIRS                             = \
28     src                               \
29     doc                               \
30     $(NULL)
31
32 EXTRA_DIST                          = \
33     CHANGES                           \
34     CONTRIBUTING.md                   \
35     LICENSE                           \
36     README.md                         \
37     .default-version                  \
38     bootstrap                         \
39     bootstrap-configure               \
40     $(srcdir)/third_party             \
41     $(NULL)
42
43 BUILT_SOURCES                       = \
44     .local-version                    \
45     $(NULL)
46
47 dist_doc_DATA                       = \
48     $(NULL)
49
50 DISTCLEANFILES                      = \
51     .local-version                    \
52     $(NULL)
53
54 #
55 # Package version files:
56 #
57 # .default-version - The default package version. This file is ALWAYS checked
58 #                    in and should always represent the current baseline
59 #                    version of the package.
60 #
61 # .dist-version    - The distributed package version. This file is NEVER
62 #                    checked in within the upstream repository, is auto-
63 #                    generated, and is only found in the package distribution.
64 #
65 # .local-version   - The current source code controlled package version. This
66 #                    file is NEVER checked in within the upstream repository,
67 #                    is auto-generated, and can always be found in both the
68 #                    build tree and distribution.
69 #
70 # When present, the .local-version file is preferred first, the
71 # .dist-version second, and the .default-version last.
72 #
73
74 VERSION_FILE                      := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))
75
76 #
77 # Override autotool's default notion of the package version variables.
78 # This ensures that when we create a source distribution that the
79 # version is always the current version, not the version when the
80 # package was bootstrapped.
81 #
82
83 NLUNIT_TEST_VERSION               ?= $(shell cat $(VERSION_FILE) 2> /dev/null)
84
85 PACKAGE_VERSION                    = $(NLUNIT_TEST_VERSION)
86 VERSION                            = $(PACKAGE_VERSION)
87
88 #
89 # check-file-.local-version
90 #
91 # Speculatively regenerate .local-version and check to see if it needs
92 # to be updated.
93 #
94 # If NLUNIT_TEST_VERSION has been supplied anywhere other than in this file
95 # (which is implicitly the contents of .local-version), then use that;
96 # otherwise, attempt to generate it from the SCM system.
97 #
98 # This is called from $(call check-file,.local-version).
99 #
100 define check-file-.local-version
101 if [ "$(origin NLUNIT_TEST_VERSION)" != "file" ]; then  \
102     echo "$(NLUNIT_TEST_VERSION)" > "$(2)";             \
103 else                                                    \
104     $(abs_top_nlbuild_autotools_dir)/scripts/mkversion  \
105         -b "$(NLUNIT_TEST_VERSION)" "$(top_srcdir)"     \
106         > "$(2)";                                       \
107 fi
108 endef
109
110 #
111 # check-file-.dist-version
112 #
113 # Speculatively regenerate .dist-version and check to see if it needs
114 # to be updated.
115 #
116 # This is called from $(call check-file,.dist-version).
117 #
118 define check-file-.dist-version
119 cat "$(1)" > "$(2)"
120 endef
121
122 #
123 # A convenience target to allow package users to easily rerun the
124 # package configuration according to the current configuration.
125 #
126 .PHONY: reconfigure
127 reconfigure: $(builddir)/config.status
128         $(AM_V_at)$(<) --recheck
129
130 #
131 # Version file regeneration rules.
132 #
133 .PHONY: force
134
135 $(builddir)/.local-version: $(srcdir)/.default-version force
136
137 $(distdir)/.dist-version: $(builddir)/.local-version force
138
139 $(distdir)/.dist-version $(builddir)/.local-version:
140         $(call check-file,$(@F))
141
142 dist distcheck: $(BUILT_SOURCES)
143
144 dist-hook: $(distdir)/.dist-version
145
146 #
147 # Top-level convenience target for making a documentation-only
148 # distribution whose results appear at the top level of the build tree
149 # in the same fashion that the distribution would be for 'make dist'.
150 #
151
152 .PHONY: docdist
153 docdist: $(BUILT_SOURCES)
154         $(MAKE) -C doc docdistdir=$(abs_builddir) $(@)
155
156 include $(abs_top_nlbuild_autotools_dir)/automake/post.am