sdk: predefine SOURCE_DATE_EPOCH
authorJo-Philipp Wich <jo@mein.io>
Fri, 21 Oct 2016 10:21:40 +0000 (12:21 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 21 Oct 2016 10:43:45 +0000 (12:43 +0200)
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@nbd.name>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
include/toplevel.mk
include/version.mk
target/sdk/Makefile

index e13acafe9c7463a82006a165dc3212eedf9d8eb9..81329ac41455c394b7e618c3f5372a1716407aab 100644 (file)
@@ -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
index b54eaab4858d7d5c8a1da7f081c342e64883f25e..4beaca64607c12734c28352def524034beae1659 100644 (file)
@@ -8,6 +8,7 @@
 
 # Substituted by SDK, do not remove
 # REVISION:=x
+# SOURCE_DATE_EPOCH:=x
 
 RELEASE:=Reboot
 
index 77695ee28569047f8053ed76342f4f9fbd1fa7fb..06889044eaad5c032e73da596259eb14551cbe63 100644 (file)
@@ -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