diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-15 12:05:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-15 15:18:17 +0200 |
commit | 55c81081e577922a8d7d0a1d633efb7feb3560d4 (patch) | |
tree | eaac0c4b37400bc74363a00326d306b9d7f664d9 /common | |
parent | ff879a2d4cc73046460e1fc88e5d1251bdc6dd1d (diff) | |
download | barebox-55c81081e577922a8d7d0a1d633efb7feb3560d4.tar.gz barebox-55c81081e577922a8d7d0a1d633efb7feb3560d4.tar.xz |
Makefile: fix build timestamps
This patch adds the scripts/mkcompile_h from the Kernel. This gives
us additional information about the build like who built this binary
and with which compiler. Currently the only information used is the
build timestamp and the generation number.
This also fixes the build timestamp in the banner which is now correct
even with consecutive builds without making clean in between.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/Makefile | 17 | ||||
-rw-r--r-- | common/version.c | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/common/Makefile b/common/Makefile index 76fe407398..bfde73cd44 100644 --- a/common/Makefile +++ b/common/Makefile @@ -81,3 +81,20 @@ include/generated/barebox_default_env.h: barebox_default_env$(barebox_default_en CLEAN_FILES += include/generated/barebox_default_env.h barebox_default_env CLEAN_FILES += barebox_default_env.gz barebox_default_env.bz2 CLEAN_FILES += barebox_default_env.lzo + +# dependencies on generated files need to be listed explicitly +$(obj)/version.o: include/generated/compile.h + +# compile.h changes depending on hostname, generation number, etc, +# so we regenerate it always. +# mkcompile_h will make sure to only update the +# actual file if its content has changed. + + chk_compile.h = : + quiet_chk_compile.h = echo ' CHK $@' +silent_chk_compile.h = : +include/generated/compile.h: FORCE + @$($(quiet)chk_compile.h) + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ + "$(UTS_MACHINE)" "$(CC) $(KBUILD_CFLAGS)" + diff --git a/common/version.c b/common/version.c index 0af8ec160a..51a8e7c47d 100644 --- a/common/version.c +++ b/common/version.c @@ -1,8 +1,10 @@ #include <common.h> +#include <generated/compile.h> #include <generated/utsrelease.h> const char version_string[] = - "barebox " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")"; + "barebox " UTS_RELEASE " " UTS_VERSION "\n"; + void barebox_banner (void) { |