VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 4
-EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD)
-U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD)
+ISREPODIRTY = $(shell if git diff-files | read dummy; then echo 1; else echo 0; fi)
VERSION_FILE = include/version_autogenerated.h
+# Show in version string if we are not building from clean repository
+ifeq ($(ISREPODIRTY), 1)
+U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-dirty"
+else
+U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-clean"
+endif
+
HOSTARCH := $(shell uname -m | \
sed -e s/i.86/i386/ \
-e s/sun4u/sparc64/ \
#endif
printf("\n***************************************"
- "\n* %s *"
+ "\n* %s *"
"\n* " __DATE__ ", " __TIME__ " *"
"\n***************************************\n\n",
version_string);