mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 06:57:57 +04:00
build: compute REVISION and SOURCE_DATE_EPOCH once per build
The top-level Makefile calls itself for prereq and for the build, and every call runs getver.sh and get_source_date_epoch.sh again, although the values are already exported by the first call. Take them from the environment in recursive calls. The first call still computes them, so a value in the environment of the user is ignored as before. Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
1 parent
d29ffc6f39
commit
177325ba1a
1 file changed
+2
@@ -10,6 +10,8 @@ include $(TOPDIR)/include/verbose.mk
|
||||
|
||||
ifeq ($(SDK),1)
|
||||
include $(TOPDIR)/include/version.mk
|
||||
else ifeq ($(filter-out 0,$(MAKELEVEL))$(origin REVISION)$(origin SOURCE_DATE_EPOCH),$(MAKELEVEL)environmentenvironment)
|
||||
# Recursive calls of the top-level Makefile get both from its environment.
|
||||
else
|
||||
REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
|
||||
SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
|
||||
|
||||
Reference in new issue
Block a user