diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-01-16 06:12:12 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-01-16 06:12:12 -0500 |
commit | 2244cbd8a9185c197ec5ba5de175aec288697223 (patch) | |
tree | b5319213e8e1b80a2079e45d40aa761c7af39136 /Makefile | |
parent | 296e0855b0f9a4ec9be17106ac541745a55b2ce1 (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-- | Makefile | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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) |
340 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) | 340 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) |
341 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | ||
341 | 342 | ||
342 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE \ | 343 | export 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 | |||
434 | config %config: scripts_basic outputmakefile FORCE | 435 | config %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 | ||
438 | else | 440 | else |
439 | # =========================================================================== | 441 | # =========================================================================== |
@@ -784,12 +786,10 @@ endif | |||
784 | localver-full = $(localver)$(localver-auto) | 786 | localver-full = $(localver)$(localver-auto) |
785 | 787 | ||
786 | # Store (new) KERNELRELASE string in .kernelrelease | 788 | # Store (new) KERNELRELASE string in .kernelrelease |
787 | kernelrelease = \ | 789 | kernelrelease = $(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 | ) |
900 | endef | 900 | endef |
901 | 901 | ||
902 | include/linux/version.h: $(srctree)/Makefile FORCE | 902 | include/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 | ||
1304 | kernelrelease: | 1304 | kernelrelease: |
1305 | @echo $(KERNELRELEASE) | 1305 | $(if $(wildcard .kernelrelease), $(Q)echo $(KERNELRELEASE), \ |
1306 | $(error kernelrelease not valid - run 'make *config' to update it)) | ||
1306 | kernelversion: | 1307 | kernelversion: |
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 | # =========================================================================== |