make kernelrelease
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
@@ -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.
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 onversion.h(which requires a) buildingversion.hsomewhere 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