[ELDK] [PATCH v2] Make build timestamp configurable

Wolfgang Denk wd at denx.de
Thu Oct 28 15:24:21 CEST 2010


Make both the file name and the format string for the build timestamp
configurable; by providing an empty file name this feature can also be
switched off.

Signed-off-by: Wolfgang Denk <wd at denx.de>
---
v2: use standard time format (same as "--rfc-3339=seconds")
    as default

 Config.in |   14 ++++++++++++++
 Makefile  |    4 +++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/Config.in b/Config.in
index 074a7e8..7934544 100644
--- a/Config.in
+++ b/Config.in
@@ -211,6 +211,20 @@ config IMAGE_SQUASHFS
          Create a SquashFS image
 endmenu
 
+config DATE_FILE
+       string "Name of date file"
+       default "/etc/build-date"
+       help
+         File where the build date will be appended to.
+	 Leave empty if no build timestamp is wanted.
+
+config DATE_FORMAT
+       string "Date format string"
+       default "+Build date: %F %T%:z"
+       help
+         date(1) fomat string to be used when adding the
+	 build timestamp.
+
 endmenu
 
 menu "ELDK Package selection"
diff --git a/Makefile b/Makefile
index 0e426d3..53b9bf1 100644
--- a/Makefile
+++ b/Makefile
@@ -231,7 +231,9 @@ $(STAMP_ROOTFS):	$(STAMP_ELDK_PKGS) $(STAMP_CUSTOM_PKGS) $(STAMP_CUSTOM_COPY) $(
 	@echo "Adding dependency libraries"
 	@scripts/list-deps -l "$(shell echo $(extra_libs) | sed 's/ /,/g')"  $(BUILD_RFS) | sed -e "s!$(ELDK_ROOTFS)\/!!" | \
 	    ( cd $(ELDK_ROOTFS) ; cpio -Bpdum $(BUILD_RFS) )
-	date > $(BUILD_RFS)/etc/build-date
+	if [ $(DATE_FILE) ] ; then \
+		date $(DATE_FORMAT) >> $(BUILD_RFS)$(DATE_FILE) ; \
+	fi
 	@touch $(STAMP_ROOTFS)
 
 $(STAMP_CHROOT):	$(STAMP_ROOTFS)
-- 
1.7.2.3



More information about the eldk mailing list