mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-15 22:09:06 +00:00
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:
committed by
wenlingz
parent
3db4491e1c
commit
596f27bad3
@@ -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);\
|
||||
|
Reference in New Issue
Block a user