aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile17
1 files changed, 6 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 7e2750f4ca70..cdeda68cf2aa 100644
--- a/Makefile
+++ b/Makefile
@@ -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
790nullstring := 790pattern = ".*/localversion[^~]*"
791space := $(nullstring) # end of line 791string = $(shell cat /dev/null \
792 `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
792 793
793___localver = $(objtree)/localversion* $(srctree)/localversion* 794localver = $(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
798localver = $(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.