File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ PYTHON ?= /usr/bin/python3
44OS_CODENAME ?= $(shell grep VERSION_CODENAME= /etc/os-release | cut -f2 -d=)
55
66ifneq ("$(wildcard .git) ","")
7- COMMIT ?= $(or $(shell git rev-parse HEAD) , local)
8- VERSION ?= $(or $(shell $(PYTHON ) ./version.py $(shell git show -s --format="% ct" $(shell git rev-parse HEAD) ) $(shell git rev-parse --abbrev-ref HEAD) ) , 0.0.0)
9- SOURCE_DATE_EPOCH ?= $(or $(shell git show -s --format="% ct" $(shell git rev-parse HEAD) ) , $(shell date "+% s") )
7+ RELEASE ?= $(shell git describe --all --match master --match 'release-* ' --abbrev=0 HEAD | sed 's@heads/@@g')
8+ COMMIT ?= $(shell git rev-parse HEAD)
9+ SOURCE_DATE_EPOCH ?= $(or $(shell git show -s --format="% ct" $(COMMIT ) ) , $(shell date "+% s") )
10+ VERSION ?= $(shell $(PYTHON ) ./version.py $(SOURCE_DATE_EPOCH ) $(RELEASE ) )
1011else
11- COMMIT ?= local
12- VERSION ?= 0.0.0
12+ COMMIT ?= release
1313 SOURCE_DATE_EPOCH ?= $(shell date "+% s")
14+ VERSION ?= $(or $(shell basename $(PWD ) | grep -E -o '[0-9]+.[0-9]+(.[0-9]+) ?$$') , 0.0.0)
1415endif
1516
1617ENV ?= $(PWD ) /env
@@ -26,6 +27,9 @@ _CFLAGS := $(CFLAGS) -Wall -O2 -fno-strict-aliasing -DWFB_VERSION='"$(VERSION)-$
2627
2728all : all_bin gs.key test
2829
30+ version :
31+ @echo -e " RELEASE=$( RELEASE) \nCOMMIT=$( COMMIT) \nVERSION=$( VERSION) \nSOURCE_DATE_EPOCH=$( SOURCE_DATE_EPOCH) "
32+
2933$(ENV ) :
3034 $(PYTHON ) -m virtualenv --download $(ENV )
3135 $$(PATH=$(ENV ) /bin:$(ENV ) /local/bin:$(PATH ) which python3 ) -m pip install --upgrade pip setuptools $(STDEB )
You can’t perform that action at this time.
0 commit comments