mk: Expand shell commands once only

* mk/targets.mk (GITVERSION):
(GITSTATUS):
(DATE):
(YEAR): Only expand the variables once, not in every make sub-process.
Previous code ran pwd/date/git in every make sub-process, slowing
things down significantly and unnecessarily.
main
Ihor Radchenko 1 year ago
parent 42e95938ed
commit eb6cabdee5
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

@ -14,15 +14,15 @@ ifneq ($(wildcard .git),)
# Use the org.el header.
ORGVERSION := $(patsubst %-dev,%,$(shell $(BATCH) --eval "(require 'lisp-mnt)" \
--visit lisp/org.el --eval '(princ (lm-header "version"))'))
GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD 2>/dev/null || echo "release_N/A-N/A-$(shell git describe --match release\* --abbrev=6 --always HEAD)")
GITSTATUS ?= $(shell git status -uno --porcelain)
GITVERSION := $(shell git describe --match release\* --abbrev=6 HEAD 2>/dev/null || echo "release_N/A-N/A-$(shell git describe --match release\* --abbrev=6 --always HEAD)")
GITSTATUS := $(shell git status -uno --porcelain)
else
-include mk/version.mk
GITVERSION ?= N/A
ORGVERSION ?= N/A
endif
DATE = $(shell date +%Y-%m-%d)
YEAR = $(shell date +%Y)
DATE := $(shell date +%Y-%m-%d)
YEAR := $(shell date +%Y)
ifneq ($(GITSTATUS),)
GITVERSION := $(GITVERSION:.dirty=).dirty
endif

Loading…
Cancel
Save