@@ -102,21 +102,18 @@ PRETTY_FILES := $(NULL)
102
102
# during makefile execution.
103
103
104
104
VERSION_FILE := $(if $(wildcard $(builddir ) /.local-version) ,$(builddir ) /.local-version,$(if $(wildcard $(srcdir ) /.dist-version) ,$(srcdir ) /.dist-version,$(srcdir ) /.default-version) )
105
-
106
105
#
107
106
# Override autotool's default notion of the package version variables.
108
107
# This ensures that when we create a source distribution the
109
108
# version is always the current version, not the package bootstrap
110
109
# version.
111
110
#
112
- # The two-level variables and the check against MAKELEVEL ensures that
113
- # not only can the package version be overridden from the command line
114
- # but also when the version is NOT overridden that we bind the version
115
- # once and only once across potential sub-makes to prevent the version
116
- # from flapping as VERSION_FILE changes.
111
+ # The two-level variables ensures that not only can the package version
112
+ # be overridden from the command line but also when the version is NOT
113
+ # overridden that we bind the version once and only once across potential
114
+ # sub-makes to prevent the version from flapping as VERSION_FILE changes.
117
115
#
118
-
119
- export MAYBE_CHIP_VERSION := $(if $(filter 0,$(MAKELEVEL ) ) ,$(shell cat $(VERSION_FILE ) 2> /dev/null) ,$(MAYBE_CHIP_VERSION ) )
116
+ export MAYBE_CHIP_VERSION := $(shell cat $(VERSION_FILE ) 2> /dev/null)
120
117
121
118
CHIP_VERSION ?= $(MAYBE_CHIP_VERSION )
122
119
@@ -136,13 +133,11 @@ VERSION = $(PACKAGE_VERSION)
136
133
# This is called from $(call check-file,.local-version).
137
134
#
138
135
define check-file-.local-version
139
- if [ "$(origin CHIP_VERSION ) " != "file" ]; then \
140
- echo "$(CHIP_VERSION ) " > "$(2 ) "; \
141
- else \
136
+ $(if $(filter-out file,$(origin CHIP_VERSION ) ) ,\
137
+ echo "$(CHIP_VERSION ) " > "$(2 ) ",\
142
138
$(abs_top_nlbuild_autotools_dir ) /scripts/mkversion \
143
139
-b "$(CHIP_VERSION ) " "$(top_srcdir ) " \
144
- > "$(2 ) "; \
145
- fi
140
+ > "$(2 ) ")
146
141
endef
147
142
148
143
#
0 commit comments