
13 Feb
2011
13 Feb
'11
12:13 a.m.
On Sat, 12 Feb 2011 10:37:11 +0100 Wolfgang Denk wd@denx.de wrote:
@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
'$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp
@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
printf '#define PLAIN_VERSION "%s%s"\n' \
"$(U_BOOT_VERSION)" "$${localvers}" ; \
printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
"$(U_BOOT_VERSION)" "$${localvers}" ; \
) > $@.tmp
IMO, PLAIN_VERSION isn't descriptive enough (should really be called VERSION..?). How about going with something like:
#define U_BOOT_STR "U-Boot" #define U_BOOT_VERSION U_BOOT_STR " %s%s"...
and then
case 'V':
printf("mkimage version %s\n", PLAIN_VERSION);
exit(EXIT_SUCCESS);
&U_BOOT_VERSION[sizeof(U_BOOT_STR)]
(the - 1 is not necessary since we want to include the ' ')
this maintains consistency and the fact that the mkimage version is directly tied to it's parent project, U-Boot's, version number.
Kim