defs.mk: Add support for optional VERSION file in working directory

This commit is contained in:
Jan Lindemann 2010-07-08 11:51:10 +00:00 committed by Jan Lindemann
commit 341ca6c96d

View file

@ -36,8 +36,9 @@ PROJECT_CAPNAME = $(shell echo $(PROJECT) | tr [a-z] [A-Z] | sed 's/-/_/g
PROJECT_DESCR ?= No description
CUSTOMER ?= jannet
VERSION ?= $(shell cat $(TOPDIR)/VERSION)
DIST_VERSION ?= $(shell sed -e "s/-dev//" $(TOPDIR)/VERSION)
VERSION_FILE ?= $(firstword $(wildcard VERSION $(TOPDIR)/VERSION))
VERSION ?= $(shell cat $(VERSION_FILE))
DIST_VERSION ?= $(shell sed -e "s/-dev//" $(VERSION_FILE))
HEX_VERSION = $(shell echo $(DIST_VERSION) | \
sed 's/-dev//; s/pre[^\.]*//; s/F[^\.]//; s/[\.-]/ /g' | xargs printf "0x%02x%02x%02x%02x")
BINARY_VERSION = $(shell echo $(PROJECT)_$(DIST_VERSION) | tr [a-z] [A-Z] | sed 's/-[^-]*$$//; s/-/_/g')