defs.mk: Default to 1.0.0-0-dev, if $(TOPDIR)/VERSION is absent

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-06-29 19:06:41 +00:00
commit b3659f75b8

View file

@ -121,12 +121,6 @@ beautify_lib_path = $(SED) 's/:/\n + /g'
find_files = $(wildcard $(addsuffix /$(1),$(patsubst :, ,$(2)))) find_files = $(wildcard $(addsuffix /$(1),$(patsubst :, ,$(2))))
find_file = $(firstword $(call find_files,$(1),$(2)) $(1)-not-found) find_file = $(firstword $(call find_files,$(1),$(2)) $(1)-not-found)
ifeq ($(INCLUDE_REV_IN_VERSIONS),true)
version = $(shell $(CAT) $1/VERSION | $(SED) 's/-dev//; s/[ ]*//g')
else
version = $(shell $(CAT) $1/VERSION | $(SED) 's/-.*//; s/[ ]*//g')
endif
define install_links define install_links
cwd="$(CWD)"; \ cwd="$(CWD)"; \
$(ECHO) "o in $(INSTALL_$(1)DIR):" ;\ $(ECHO) "o in $(INSTALL_$(1)DIR):" ;\
@ -231,8 +225,12 @@ CREATE_DEVEL ?= true
ifeq ($(VERSION),) ifeq ($(VERSION),)
ifneq ($(wildcard $(VERSION_FILE)),) ifneq ($(wildcard $(VERSION_FILE)),)
VERSION := $(shell $(CAT) $(VERSION_FILE)) VERSION := $(shell $(CAT) $(VERSION_FILE))
else
VERSION := $(shell echo 1.0.0.0-dev | tee $(VERSION_FILE))
$(warning Automatically created missing $(VERSION_FILE).)
endif endif
endif endif
DIST_VERSION ?= $(patsubst %-dev,%,$(VERSION)) DIST_VERSION ?= $(patsubst %-dev,%,$(VERSION))
HEX_VERSION := $(shell $(ECHO) $(DIST_VERSION) | \ HEX_VERSION := $(shell $(ECHO) $(DIST_VERSION) | \
$(SED) 's/-dev//; s/pre[^\.]*//; s/F[^\.]//; s/[\.-]/ /g' | $(XARGS) $(PRINTF) "0x%02x%02x%02x%02x") $(SED) 's/-dev//; s/pre[^\.]*//; s/F[^\.]//; s/[\.-]/ /g' | $(XARGS) $(PRINTF) "0x%02x%02x%02x%02x")