1
0

0002-upstream-Makefile-Reproducible-U-Boot-build-support.patch 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. --- a/Makefile
  2. +++ b/Makefile
  3. @@ -389,8 +389,26 @@ $(VERSION_FILE):
  4. @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
  5. $(TIMESTAMP_FILE):
  6. - @date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
  7. - @date +'#define U_BOOT_TIME "%T"' >> $@
  8. + (if test -n "$${SOURCE_DATE_EPOCH}"; then \
  9. + SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
  10. + DATE=""; \
  11. + for date in gdate date.gnu date; do \
  12. + $${date} -u -d "$${SOURCE_DATE}" >/dev/null 2>&1 && DATE="$${date}"; \
  13. + done; \
  14. + if test -n "$${DATE}"; then \
  15. + LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"' > $@; \
  16. + LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"' >> $@; \
  17. + LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"' >> $@; \
  18. + LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"' >> $@; \
  19. + else \
  20. + return 42; \
  21. + fi; \
  22. + else \
  23. + LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
  24. + LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
  25. + LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
  26. + LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
  27. + fi)
  28. gdbtools:
  29. $(MAKE) -C tools/gdb all || exit 1