You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.2 KiB

  1. --- a/Makefile.pre.in
  2. +++ b/Makefile.pre.in
  3. @@ -743,6 +743,16 @@ regen-all: regen-opcode regen-opcode-tar
  4. ############################################################################
  5. # Special rules for object files
  6. +DATE_FMT = %b %d %Y
  7. +TIME_FMT = %H:%M:%S
  8. +ifdef SOURCE_DATE_EPOCH
  9. + BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
  10. + BUILD_TIME ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u "+$(TIME_FMT)")
  11. +else
  12. + BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
  13. + BUILD_TIME ?= $(shell date "+$(TIME_FMT)")
  14. +endif
  15. +
  16. Modules/getbuildinfo.o: $(PARSER_OBJS) \
  17. $(OBJECT_OBJS) \
  18. $(PYTHON_OBJS) \
  19. @@ -750,6 +760,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
  20. $(MODOBJS) \
  21. $(srcdir)/Modules/getbuildinfo.c
  22. $(CC) -c $(PY_CORE_CFLAGS) \
  23. + -DDATE="\"$(BUILD_DATE)\"" \
  24. + -DTIME="\"$(BUILD_TIME)\"" \
  25. -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
  26. -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
  27. -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \