Skip to contentSkip to conversation

make kernelrelease

PATCH In review Matt Mackall 2 participants 2 messages Dec 21, 2004 – Dec 28, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make kernelrelease

This patch makes it easy to programmatically get at the kernel makefile's idea of the kernel version from external scripts and makefiles with something like V=make kernelrelease.

Alternatives include parsing Makefile (errorprone and broken by things like localversion) and running the C preprocessor on version.h (which requires a) building version.h somewhere and b) is really ugly).

Makefile +3 -0
Index: l/Makefile
===================================================================
@@ -1187,6 +1187,9 @@
 	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
 	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
+kernelrelease:
+	@echo $(KERNELRELEASE)
+
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
 
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#1 lore raw
Quoted 13 lines · Matt Mackall

This patch makes it easy to programmatically get at the kernel makefile's idea of the kernel version from external scripts and makefiles with something like V=make kernelrelease.

Alternatives include parsing Makefile (errorprone and broken by things like localversion) and running the C preprocessor on version.h (which requires a) building version.h somewhere and b) is really ugly).

Index: l/Makefile
===================================================================

Makefile line 1194

Quoted 8 lines
Makefile +3 -0
@@ -1187,6 +1187,9 @@
 	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
 	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
+kernelrelease:
+	@echo $(KERNELRELEASE)
+
 # FIXME Should go into a make.lib or something 
 # ===========================================================================

Applied - thanks.

Sam