Makefile: Make builds reproducible
Make builds reproducible by honoring SOURCE_DATE_EPOCH and USER environment variables in the respective Makefiles. Just follow the recommendations at https://reproducible-builds.org/ Build tools (e.g. Debian packaging, Yocto) use this to ensure reproducibility of packages. Tracked-On: #6035 Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
This commit is contained in:
parent
3db4491e1c
commit
596f27bad3
|
@ -224,8 +224,8 @@ $(VERSION_H):
|
|||
PATCH=$(DM_BUILD_VERSION);\
|
||||
DAILY_TAG=$(DM_BUILD_TAG);\
|
||||
fi;\
|
||||
TIME=`date "+%Y-%m-%d %H:%M:%S"`;\
|
||||
USER=`id -u -n`; \
|
||||
TIME=$$(date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" "+%Y-%m-%d %H:%M:%S"); \
|
||||
USER="$${USER:-$$(id -u -n)}"; \
|
||||
echo "/*" > $(VERSION_H); \
|
||||
sed 's/^/ * /' ../LICENSE >> $(VERSION_H);\
|
||||
echo " */" >> $(VERSION_H);\
|
||||
|
|
|
@ -476,8 +476,8 @@ $(VERSION): $(HV_CONFIG_H)
|
|||
DIRTY=`git diff-index --name-only HEAD`;\
|
||||
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
|
||||
DAILY_TAG=`git tag --merged HEAD|grep "acrn"|tail -n 1`;\
|
||||
TIME=`date "+%F %T"`;\
|
||||
USER=`id -u -n`; \
|
||||
TIME=$$(date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" "+%F %T"); \
|
||||
USER="$${USER:-$$(id -u -n)}"; \
|
||||
if [ x$(CONFIG_RELEASE) = "xy" ];then BUILD_TYPE="REL";else BUILD_TYPE="DBG";fi;\
|
||||
echo "/*" > $(VERSION); \
|
||||
sed 's/^/ * /' ../LICENSE >> $(VERSION); \
|
||||
|
|
|
@ -66,8 +66,8 @@ $(VERSION_H):
|
|||
@COMMIT=`git log -1 --pretty=format:%h . 2>/dev/null`;\
|
||||
DIRTY=`git diff --name-only $(CURDIR)`;\
|
||||
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
|
||||
TIME=`date "+%Y-%m-%d %H:%M:%S"`;\
|
||||
USER=`id -u -n`; \
|
||||
TIME=$$(date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" "+%Y-%m-%d %H:%M:%S"); \
|
||||
USER="$${USER:-$$(id -u -n)}"; \
|
||||
cat $(CURDIR)/../license_header > $(VERSION_H);\
|
||||
echo "#define AP_MAJOR_VERSION $(MAJOR_VERSION)" >> $(VERSION_H);\
|
||||
echo "#define AP_MINOR_VERSION $(MINOR_VERSION)" >> $(VERSION_H);\
|
||||
|
|
|
@ -45,8 +45,8 @@ $(VERSION_H):
|
|||
@COMMIT=`git log -1 --pretty=format:%h . 2>/dev/null`;\
|
||||
DIRTY=`git diff --name-only $(CURDIR)`;\
|
||||
if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
|
||||
TIME=`date "+%Y-%m-%d %H:%M:%S"`;\
|
||||
USER=`id -u -n`; \
|
||||
TIME=$$(date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" "+%Y-%m-%d %H:%M:%S"); \
|
||||
USER="$${USER:-$$(id -u -n)}"; \
|
||||
cat $(CURDIR)/../license_header > $(VERSION_H);\
|
||||
echo "#define UC_MAJOR_VERSION $(MAJOR_VERSION)" >> $(VERSION_H);\
|
||||
echo "#define UC_MINOR_VERSION $(MINOR_VERSION)" >> $(VERSION_H);\
|
||||
|
|
Loading…
Reference in New Issue