Environment variable $SOURCE_DATE_EPOCH: No digits were found:

一、报错信息

  Environment variable $SOURCE_DATE_EPOCH: No digits were found:

 

二、解决方法

1、修改build/main.mk

  核心操作如下:

  ① makefile增加【fix】项,为了执行【date +%s > version.date】

  ② makefile的【world】后面增加依赖【fix】

 

2、成型后的makefile

  注:我是在16.04的Ubuntu上适配的这个错误,所以做了一定的判断

world: fix

include $(TOPDIR)/build/host.mk

ifneq ($(OPENWRT_BUILD),1)
  _SINGLE=export MAKEFLAGS=$(space);

  override OPENWRT_BUILD=1
  export OPENWRT_BUILD
  GREP_OPTIONS=
  export GREP_OPTIONS
  include $(TOPDIR)/build/debug.mk
  include $(TOPDIR)/build/depends.mk
  include $(TOPDIR)/build/toplevel.mk
else
  include rules.mk
  include $(BUILD_DIR)/depends.mk
  include $(BUILD_DIR)/subdir.mk
  include target/Makefile
  include package/Makefile
  include tools/Makefile
  include toolchain/Makefile

$(toolchain/stamp-install): $(tools/stamp-install)
$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(COMPILE_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
$(package/stamp-install): $(package/stamp-compile)
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)

printdb:
        @true

prepare: $(target/stamp-compile)

fix:
        @if [ "`lsb_release -rs`" = "16.04" -a ! -f ".mark_fix" ]; then \
                echo " "; \
                echo " "; \
                echo " "; \
                echo "Ubuntu version is [ `lsb_release -rs` ], perform fix operations."; \
                echo " "; \
                echo " "; \
                echo " "; \
                date +%s > version.date && touch .mark_fix; \
        fi

fixclean:
        [ -f ".mark_fix" ] && rm .mark_fix

clean: FORCE

 

3、修改makefile后

  执行make distclean,然后重新make,不distclean的话还是会报相同的错。

 

posted @ 2024-04-22 16:15  J&YANG  阅读(2)  评论(0编辑  收藏  举报