kbuild: Fix KERNELVERSION for empty SUBLEVEL or PATCHLEVEL
authorMichal Marek <mmarek@suse.cz>
Mon, 30 May 2011 11:36:07 +0000 (13:36 +0200)
committerMichal Marek <mmarek@suse.cz>
Thu, 9 Jun 2011 21:05:54 +0000 (23:05 +0200)
Omit the second dot for releases without SUBLEVEL. If PATCHLEVEL is also
empty, only display VERSION.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Makefile

index afb8e0d26f2c6134828d5d63e557799e8ef6e199..4fe907510d796af36953828705875db8825bdd87 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -378,7 +378,7 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
 KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
-KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC