diff options
-rw-r--r-- | Makefile | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -776,7 +776,7 @@ $(vmlinux-dirs): prepare scripts | |||
776 | # $(EXTRAVERSION) eg, -rc6 | 776 | # $(EXTRAVERSION) eg, -rc6 |
777 | # $(localver-full) | 777 | # $(localver-full) |
778 | # $(localver) | 778 | # $(localver) |
779 | # localversion* (all localversion* files) | 779 | # localversion* (files without backups, containing '~') |
780 | # $(CONFIG_LOCALVERSION) (from kernel config setting) | 780 | # $(CONFIG_LOCALVERSION) (from kernel config setting) |
781 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) | 781 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) |
782 | # ./scripts/setlocalversion (SCM tag, if one exists) | 782 | # ./scripts/setlocalversion (SCM tag, if one exists) |
@@ -787,17 +787,12 @@ $(vmlinux-dirs): prepare scripts | |||
787 | # moment, only git is supported but other SCMs can edit the script | 787 | # moment, only git is supported but other SCMs can edit the script |
788 | # scripts/setlocalversion and add the appropriate checks as needed. | 788 | # scripts/setlocalversion and add the appropriate checks as needed. |
789 | 789 | ||
790 | nullstring := | 790 | pattern = ".*/localversion[^~]*" |
791 | space := $(nullstring) # end of line | 791 | string = $(shell cat /dev/null \ |
792 | `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`) | ||
792 | 793 | ||
793 | ___localver = $(objtree)/localversion* $(srctree)/localversion* | 794 | localver = $(subst $(space),, $(string) \ |
794 | __localver = $(sort $(wildcard $(___localver))) | 795 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) |
795 | # skip backup files (containing '~') | ||
796 | _localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f))) | ||
797 | |||
798 | localver = $(subst $(space),, \ | ||
799 | $(shell cat /dev/null $(_localver)) \ | ||
800 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) | ||
801 | 796 | ||
802 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called | 797 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called |
803 | # and if the SCM is know a tag from the SCM is appended. | 798 | # and if the SCM is know a tag from the SCM is appended. |