aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2004-12-29 00:59:46 +0100
committerSam Ravnborg <sam@mars.ravnborg.org>2004-12-29 00:59:46 +0100
commit5249fb74d46827e5522f7eed5b888227ae34f79b (patch)
tree07a908b863bdcd189f950376eaecfd8c143c50a6 /Makefile
parent2249c21bc140cd69da48c15c5b31f8d19f67df91 (diff)
downloadhistory-5249fb74d46827e5522f7eed5b888227ae34f79b.tar.gz
kbuild: skip localversion files with '~' anywhere in their name
Idea from: Blaisorblade <blaisorblade_spam@yahoo.it> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 5 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 322bf1fc63d804..961ef035b6da92 100644
--- a/Makefile
+++ b/Makefile
@@ -149,14 +149,13 @@ space := $(nullstring) # end of line
# careful not to include files twice if building in the source
# directory. LOCALVERSION from the command line override all of this
-ifeq ($(objtree),$(srctree))
-localversion-files := $(wildcard $(srctree)/localversion*)
-else
-localversion-files := $(wildcard $(objtree)/localversion* $(srctree)/localversion*)
-endif
+localver := $(objtree)/localversion* $(srctree)/localversion*
+localver := $(sort $(wildcard $(localver)))
+# skip backup files (containing '~')
+localver := $(foreach f, $(localver), $(if $(findstring ~, $(f)),,$(f)))
LOCALVERSION = $(subst $(space),, \
- $(shell cat /dev/null $(localversion-files:%~=)) \
+ $(shell cat /dev/null $(localver)) \
$(patsubst "%",%,$(CONFIG_LOCALVERSION)))
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)