[U-Boot] [PATCH v4] Update U-Boot's build timestamp on every compile
Trent Piepho
tpiepho at freescale.com
Sat Nov 1 11:26:27 CET 2008
On Fri, 31 Oct 2008, Peter Tyser wrote:
> +$(TIMESTAMP_FILE):
> + @( printf '#define U_BOOT_DATE "%s"\n' '$(shell date +"%b %d %C%y")' \
> + ) > $@
> + @( printf '#define U_BOOT_TIME "%s"\n' '$(shell date +"%T")' \
> + ) >> $@
You could do this:
@date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
@date +'#define U_BOOT_TIME "%T"' >> $@
Somewhat shorter and simpler.
> diff --git a/cpu/mpc8xx/video.c b/cpu/mpc8xx/video.c
> index 2e6a22a..aa47df7 100644
> --- a/cpu/mpc8xx/video.c
> +++ b/cpu/mpc8xx/video.c
> @@ -32,6 +32,7 @@
> #include <stdarg.h>
> #include <common.h>
> #include <config.h>
> +#include <timestamp.h>
> #include <version.h>
> #include <i2c.h>
> #include <linux/types.h>
> @@ -1174,7 +1175,8 @@ static void *video_logo (void)
> easylogo_plot (VIDEO_LOGO_ADDR, screen, width, 0, 0);
>
> #ifdef VIDEO_INFO
> - sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__);
> + sprintf (info, "%s (%s - %s) ",
> + U_BOOT_VERSION, U_BOOT_DATE, U_BOOT_TIME);
> video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info);
If the include of timestamp.h is inside the VIDEO_INFO ifdef, then video.c
won't gain a timestamp.h dependency when VIDEO_INFO isn't on. This would
prevent the file from getting rebuilt on each build if it doesn't need it.
> diff --git a/include/configs/NETPHONE.h b/include/configs/NETPHONE.h
> index a147aff..34de947 100644
> --- a/include/configs/NETPHONE.h
> +++ b/include/configs/NETPHONE.h
> @@ -799,7 +799,7 @@ typedef unsigned int led_id_t;
> #define CONFIG_CDP_DEVICE_ID_PREFIX "NP" /* netphone */
> #define CONFIG_CDP_PORT_ID "eth%d"
> #define CONFIG_CDP_CAPABILITIES 0x00000010
> -#define CONFIG_CDP_VERSION "u-boot" " " __DATE__ " " __TIME__
> +#define CONFIG_CDP_VERSION "u-boot" " " U_BOOT_DATE " " U_BOOT_TIME
This means any file that uses CONFIG_CDP_VERSION will need to include
timestamp.h, which it didn't before. You added the includes where needed?
More information about the U-Boot
mailing list