aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-01-16 06:12:12 -0500
committerSam Ravnborg <sam@mars.ravnborg.org>2006-01-16 06:12:12 -0500
commit2244cbd8a9185c197ec5ba5de175aec288697223 (patch)
treeb5319213e8e1b80a2079e45d40aa761c7af39136 /Makefile
parent296e0855b0f9a4ec9be17106ac541745a55b2ce1 (diff)
kbuild: create .kernelrelease at *config step
To enable 'make kernelrelease' earlier now create .kernelrelease when one of the *config targets are used. Also introduce KERNELVERSION - only user is kconfig. KERNELVERSION was needed to display kernel version in menuconfig - KERNELRELEASE is not valid until configuration has completed. kconfig files modified to use KERNELVERSION. Bug reported by: Rene Rebe <rene@exactcode.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 10 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index b3dd9dbdc29e..22e322f1757c 100644
--- a/Makefile
+++ b/Makefile
@@ -338,8 +338,9 @@ AFLAGS := -D__ASSEMBLY__
338 338
339# Read KERNELRELEASE from .kernelrelease (if it exists) 339# Read KERNELRELEASE from .kernelrelease (if it exists)
340KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) 340KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
341KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
341 342
342export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE \ 343export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \
343 ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ 344 ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
344 CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ 345 CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
345 HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS 346 HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
@@ -434,6 +435,7 @@ export KBUILD_DEFCONFIG
434config %config: scripts_basic outputmakefile FORCE 435config %config: scripts_basic outputmakefile FORCE
435 $(Q)mkdir -p include/linux 436 $(Q)mkdir -p include/linux
436 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 437 $(Q)$(MAKE) $(build)=scripts/kconfig $@
438 $(Q)$(MAKE) .kernelrelease
437 439
438else 440else
439# =========================================================================== 441# ===========================================================================
@@ -784,12 +786,10 @@ endif
784localver-full = $(localver)$(localver-auto) 786localver-full = $(localver)$(localver-auto)
785 787
786# Store (new) KERNELRELASE string in .kernelrelease 788# Store (new) KERNELRELASE string in .kernelrelease
787kernelrelease = \ 789kernelrelease = $(KERNELVERSION)$(localver-full)
788 $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(localver-full)
789.kernelrelease: FORCE 790.kernelrelease: FORCE
790 $(Q)rm -f .kernelrelease 791 $(Q)rm -f $@
791 $(Q)echo $(kernelrelease) > .kernelrelease 792 $(Q)echo $(kernelrelease) > $@
792 $(Q)echo " Building kernel $(kernelrelease)"
793 793
794 794
795# Things we need to do before we recursively start building the kernel 795# Things we need to do before we recursively start building the kernel
@@ -899,7 +899,7 @@ define filechk_version.h
899 ) 899 )
900endef 900endef
901 901
902include/linux/version.h: $(srctree)/Makefile FORCE 902include/linux/version.h: $(srctree)/Makefile .config FORCE
903 $(call filechk,version.h) 903 $(call filechk,version.h)
904 904
905# --------------------------------------------------------------------------- 905# ---------------------------------------------------------------------------
@@ -1302,9 +1302,10 @@ checkstack:
1302 $(PERL) $(src)/scripts/checkstack.pl $(ARCH) 1302 $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
1303 1303
1304kernelrelease: 1304kernelrelease:
1305 @echo $(KERNELRELEASE) 1305 $(if $(wildcard .kernelrelease), $(Q)echo $(KERNELRELEASE), \
1306 $(error kernelrelease not valid - run 'make *config' to update it))
1306kernelversion: 1307kernelversion:
1307 @echo $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 1308 @echo $(KERNELVERSION)
1308 1309
1309# FIXME Should go into a make.lib or something 1310# FIXME Should go into a make.lib or something
1310# =========================================================================== 1311# ===========================================================================