Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 1 | # |
Jonathan Hui | 4435017 | 2016-09-13 15:57:11 -0700 | [diff] [blame] | 2 | # Copyright (c) 2016, The OpenThread Authors. |
Marcin K Szczodrak | 99870fa | 2016-05-12 22:39:11 -0700 | [diff] [blame] | 3 | # All rights reserved. |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 4 | # |
Marcin K Szczodrak | 99870fa | 2016-05-12 22:39:11 -0700 | [diff] [blame] | 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are met: |
| 7 | # 1. Redistributions of source code must retain the above copyright |
| 8 | # notice, this list of conditions and the following disclaimer. |
| 9 | # 2. Redistributions in binary form must reproduce the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer in the |
| 11 | # documentation and/or other materials provided with the distribution. |
| 12 | # 3. Neither the name of the copyright holder nor the |
| 13 | # names of its contributors may be used to endorse or promote products |
| 14 | # derived from this software without specific prior written permission. |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 15 | # |
Marcin K Szczodrak | 99870fa | 2016-05-12 22:39:11 -0700 | [diff] [blame] | 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 26 | # POSSIBILITY OF SUCH DAMAGE. |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 27 | # |
| 28 | |
| 29 | include $(abs_top_nlbuild_autotools_dir)/automake/pre.am |
| 30 | |
| 31 | AM_MAKEFLAGS = --no-print-directory |
| 32 | |
Jonathan Hui | e033962 | 2016-06-11 10:32:05 -0700 | [diff] [blame] | 33 | AM_DISTCHECK_CONFIGURE_FLAGS = \ |
Jonathan Hui | 3e6546c | 2017-01-06 13:54:32 -0800 | [diff] [blame] | 34 | --enable-address-sanitizer \ |
Michael Morscher | 6a520dd | 2017-04-11 18:02:42 +0200 | [diff] [blame] | 35 | --enable-application-coap \ |
Shu Chen | 473b83b | 2017-06-03 12:49:07 +0800 | [diff] [blame] | 36 | --enable-border-router \ |
Kamil Burzynski | 005781d | 2017-10-26 21:27:19 +0200 | [diff] [blame] | 37 | --enable-cli-app=all \ |
| 38 | --enable-commissioner \ |
| 39 | --enable-dhcp6-client \ |
| 40 | --enable-dhcp6-server \ |
| 41 | --enable-diag \ |
| 42 | --enable-dns-client \ |
| 43 | --enable-joiner \ |
rongli | 502c6ca | 2017-07-12 13:38:49 +0800 | [diff] [blame] | 44 | --enable-mac-filter \ |
Kamil Burzynski | 005781d | 2017-10-26 21:27:19 +0200 | [diff] [blame] | 45 | --enable-ncp-app=all \ |
| 46 | --enable-service \ |
| 47 | --with-examples=posix \ |
| 48 | --with-ncp-bus=uart \ |
Jonathan Hui | e033962 | 2016-06-11 10:32:05 -0700 | [diff] [blame] | 49 | $(NULL) |
Robert Quattlebaum | 059763b | 2016-05-19 13:34:40 -0700 | [diff] [blame] | 50 | |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 51 | SUBDIRS = \ |
Jonathan Hui | c8908cf | 2016-05-16 21:41:38 -0700 | [diff] [blame] | 52 | include \ |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 53 | third_party \ |
Yakun Xu | 1b14a36 | 2018-06-26 07:32:32 +0800 | [diff] [blame^] | 54 | src \ |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 55 | examples \ |
| 56 | tests \ |
Robert Quattlebaum | 862edfb | 2016-07-06 18:53:33 -0700 | [diff] [blame] | 57 | tools \ |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 58 | doc \ |
| 59 | $(NULL) |
| 60 | |
| 61 | EXTRA_DIST = \ |
| 62 | .default-version \ |
| 63 | bootstrap \ |
Nick Banks | f600840 | 2016-10-25 13:38:29 -0700 | [diff] [blame] | 64 | etc \ |
Robert Quattlebaum | c5063e4 | 2016-06-09 17:54:14 -0700 | [diff] [blame] | 65 | README.md \ |
| 66 | NOTICE \ |
| 67 | CONTRIBUTING.md \ |
| 68 | LICENSE \ |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 69 | $(NULL) |
| 70 | |
| 71 | BUILT_SOURCES = \ |
| 72 | .local-version \ |
| 73 | $(NULL) |
| 74 | |
| 75 | dist_doc_DATA = \ |
| 76 | $(NULL) |
| 77 | |
| 78 | DISTCLEANFILES = \ |
| 79 | .local-version \ |
| 80 | $(NULL) |
| 81 | |
Jonathan Hui | d1b0fed | 2016-05-19 15:46:29 -0700 | [diff] [blame] | 82 | PRETTY_SUBDIRS = \ |
| 83 | examples \ |
| 84 | include \ |
| 85 | src \ |
| 86 | tests \ |
Robert Quattlebaum | 862edfb | 2016-07-06 18:53:33 -0700 | [diff] [blame] | 87 | tools \ |
Jonathan Hui | d1b0fed | 2016-05-19 15:46:29 -0700 | [diff] [blame] | 88 | $(NULL) |
| 89 | |
Shu Chen | 46f920c | 2016-10-25 13:13:23 +0800 | [diff] [blame] | 90 | # Ignore the pseudo flash files on Posix platform during diskcheck |
| 91 | distcleancheck_listfiles = \ |
| 92 | $(AM_V_at)find . -type f -name "*flash" |
| 93 | |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 94 | # |
| 95 | # Package version files: |
| 96 | # |
| 97 | # .default-version - The default package version. This file is ALWAYS checked |
| 98 | # in and should always represent the current baseline |
| 99 | # version of the package. |
| 100 | # |
| 101 | # .dist-version - The distributed package version. This file is NEVER |
| 102 | # checked in within the upstream repository, is auto- |
| 103 | # generated, and is only found in the package distribution. |
| 104 | # |
| 105 | # .local-version - The current source code controlled package version. This |
| 106 | # file is NEVER checked in within the upstream repository, |
| 107 | # is auto-generated, and can always be found in both the |
| 108 | # build tree and distribution. |
| 109 | # |
| 110 | # When present, the .local-version file is preferred first, the |
| 111 | # .dist-version second, and the .default-version last. |
| 112 | # |
| 113 | |
| 114 | VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version)) |
| 115 | |
| 116 | # |
| 117 | # Override autotool's default notion of the package version variables. |
| 118 | # This ensures that when we create a source distribution that the |
| 119 | # version is always the current version, not the version when the |
| 120 | # package was bootstrapped. |
| 121 | # |
| 122 | |
| 123 | OPENTHREAD_VERSION ?= $(shell cat $(VERSION_FILE) 2> /dev/null) |
| 124 | |
| 125 | PACKAGE_VERSION = $(OPENTHREAD_VERSION) |
| 126 | VERSION = $(PACKAGE_VERSION) |
| 127 | |
Robert Quattlebaum | 059763b | 2016-05-19 13:34:40 -0700 | [diff] [blame] | 128 | distdir = $(PACKAGE)-$(shell \ |
| 129 | if [ "$(origin OPENTHREAD_VERSION)" != "file" ]; then \ |
| 130 | echo "$(OPENTHREAD_VERSION)" ; \ |
| 131 | else \ |
| 132 | $(abs_top_nlbuild_autotools_dir)/scripts/mkversion \ |
| 133 | -b "$(OPENTHREAD_VERSION)" "$(top_srcdir)"; \ |
| 134 | fi ) |
| 135 | |
Jonathan Hui | 4f9945c | 2016-05-10 20:48:47 -0700 | [diff] [blame] | 136 | # |
| 137 | # check-file-.local-version |
| 138 | # |
| 139 | # Speculatively regenerate .local-version and check to see if it needs |
| 140 | # to be updated. |
| 141 | # |
| 142 | # If OPENTHREAD_VERSION has been supplied anywhere other than in this file |
| 143 | # (which is implicitly the contents of .local-version), then use that; |
| 144 | # otherwise, attempt to generate it from the SCM system. |
| 145 | # |
| 146 | # This is called from $(call check-file,.local-version). |
| 147 | # |
| 148 | define check-file-.local-version |
| 149 | if [ "$(origin OPENTHREAD_VERSION)" != "file" ]; then \ |
| 150 | echo "$(OPENTHREAD_VERSION)" > "$(2)"; \ |
| 151 | else \ |
| 152 | $(abs_top_nlbuild_autotools_dir)/scripts/mkversion \ |
| 153 | -b "$(OPENTHREAD_VERSION)" "$(top_srcdir)" \ |
| 154 | > "$(2)"; \ |
| 155 | fi |
| 156 | endef |
| 157 | |
| 158 | # |
| 159 | # check-file-.dist-version |
| 160 | # |
| 161 | # Speculatively regenerate .dist-version and check to see if it needs |
| 162 | # to be updated. |
| 163 | # |
| 164 | # This is called from $(call check-file,.dist-version). |
| 165 | # |
| 166 | define check-file-.dist-version |
| 167 | cat "$(1)" > "$(2)" |
| 168 | endef |
| 169 | |
| 170 | # |
| 171 | # A convenience target to allow package users to easily rerun the |
| 172 | # package configuration according to the current configuration. |
| 173 | # |
| 174 | .PHONY: reconfigure |
| 175 | reconfigure: $(builddir)/config.status |
| 176 | $(AM_V_at)$(<) --recheck |
| 177 | |
| 178 | # |
| 179 | # Version file regeneration rules. |
| 180 | # |
| 181 | .PHONY: force |
| 182 | |
| 183 | $(builddir)/.local-version: $(srcdir)/.default-version force |
| 184 | |
| 185 | $(distdir)/.dist-version: $(builddir)/.local-version force |
| 186 | |
| 187 | $(distdir)/.dist-version $(builddir)/.local-version: |
| 188 | $(call check-file,$(@F)) |
| 189 | |
| 190 | dist distcheck: $(BUILT_SOURCES) |
| 191 | |
| 192 | dist-hook: $(distdir)/.dist-version |
| 193 | |
| 194 | # |
| 195 | # Top-level convenience target for making a documentation-only |
| 196 | # distribution whose results appear at the top level of the build tree |
| 197 | # in the same fashion that the distribution would be for 'make dist'. |
| 198 | # |
| 199 | |
| 200 | .PHONY: docdist |
| 201 | docdist: $(BUILT_SOURCES) |
| 202 | $(MAKE) -C doc docdistdir=$(abs_builddir) $(@) |
| 203 | |
| 204 | include $(abs_top_nlbuild_autotools_dir)/automake/post.am |