[source] sdk: predefine SOURCE_DATE_EPOCH
LEDE Commits
lede-commits at lists.infradead.org
Fri Oct 21 03:43:50 PDT 2016
jow pushed a commit to source.git, branch master:
https://git.lede-project.org/8cc922411561dfa6f65fbb492a7bdb6fb9bbb6d5
commit 8cc922411561dfa6f65fbb492a7bdb6fb9bbb6d5
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Oct 21 12:21:40 2016 +0200
sdk: predefine SOURCE_DATE_EPOCH
When building packages within the SDK, there is no Git revision history
available so prepopulate SOURCE_DATE_EPOCH in version.mk, similar to
how we handle REVISION already.
Acked-by: Felix Fietkau <nbd at nbd.name>
Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
include/toplevel.mk | 3 ++-
include/version.mk | 1 +
target/sdk/Makefile | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/toplevel.mk b/include/toplevel.mk
index e13acaf..81329ac 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -16,13 +16,14 @@ ifeq ($(SDK),1)
include $(TOPDIR)/include/version.mk
else
REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
+ SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
endif
HOSTCC ?= $(CC)
export REVISION
+export SOURCE_DATE_EPOCH
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
-export SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
# prevent perforce from messing with the patch utility
unexport P4PORT P4USER P4CONFIG P4CLIENT
diff --git a/include/version.mk b/include/version.mk
index b54eaab..4beaca6 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -8,6 +8,7 @@
# Substituted by SDK, do not remove
# REVISION:=x
+# SOURCE_DATE_EPOCH:=x
RELEASE:=Reboot
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 77695ee..0688904 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -118,6 +118,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
cat $(TOPDIR)/feeds.conf.default >> $(SDK_BUILD_DIR)/feeds.conf.default; \
fi
$(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' $(SDK_BUILD_DIR)/include/version.mk
+ $(SED) 's,^# SOURCE_DATE_EPOCH:=.*,SOURCE_DATE_EPOCH:=$(SOURCE_DATE_EPOCH),g' $(SDK_BUILD_DIR)/include/version.mk
$(SED) '/LINUX_VERMAGIC:=/ { s,unknown,$(LINUX_VERMAGIC),g }' $(SDK_BUILD_DIR)/include/kernel.mk
find $(SDK_BUILD_DIR) -name .git | $(XARGS) rm -rf
find $(SDK_BUILD_DIR) -name .svn | $(XARGS) rm -rf
More information about the lede-commits
mailing list