aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorOleg Verych <olecom@flower.upol.cz>2007-02-05 20:18:22 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-06 17:30:49 -0500
commit76c329563c5b8663ef27eb1bd195885ab826cbd0 (patch)
tree65052ff17cc0462ddab5dfa0bc22c08d33589e07 /Makefile
parent5de043f4bd11a9e0a3e8daec7d1905da575a76b7 (diff)
[PATCH] kbuild: correctly skip tilded backups in localversion files
Tildes as in path as in filenames are handled correctly now: only files, containing tilde '~', are backups, thus are not valid. [KJ]: Definition of `space' was removed, scripts/Kbuild.include has one. That definition was taken right from the GNU make manual, while Kbuild's version is original. Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Bastian Blank <bastian@waldi.eu.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Oleg Verych <olecom@flower.upol.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Makefile')
-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.