2006-01-10 20:00:29

by René Scharfe

[permalink] [raw]
Subject: [PATCH] Fix running 'make kernelrelease' before builing

Hi Sam,

after your latest Makefile changes 'make kernelrelease' displays an
empty line when it is run before building. I think it's more useful
to let it build the kernel version and display it.

The patch makes kernelrelease dependant on .kernelrelease. It also
moves one echo call to the single other place that depends on
.kernelrelease. Otherwise it would display its message there _and_
when called through 'make kernelrelease'.

Signed-off-by: Rene Scharfe <[email protected]>

diff --git a/Makefile b/Makefile
index deedaf7..403eee0 100644
--- a/Makefile
+++ b/Makefile
@@ -788,7 +788,6 @@ kernelrelease = \
.kernelrelease: FORCE
$(Q)rm -f .kernelrelease
$(Q)echo $(kernelrelease) > .kernelrelease
- $(Q)echo " Building kernel $(kernelrelease)"


# Things we need to do before we recursively start building the kernel
@@ -808,6 +807,7 @@ kernelrelease = \
# 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink
prepare3: .kernelrelease
+ $(Q)echo " Building kernel $(KERNELRELEASE)"
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config ]; then \
@@ -1300,7 +1300,7 @@ checkstack:
$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
$(PERL) $(src)/scripts/checkstack.pl $(ARCH)

-kernelrelease:
+kernelrelease: .kernelrelease
@echo $(KERNELRELEASE)
kernelversion:
@echo $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)