diff mbox series

[v2] Makefile: rules for printing kernel architecture and localversion

Message ID 1564432235-31100-1-git-send-email-info@metux.net (mailing list archive)
State New, archived
Headers show
Series [v2] Makefile: rules for printing kernel architecture and localversion | expand

Commit Message

Enrico Weigelt, metux IT consult July 29, 2019, 8:30 p.m. UTC
trivial rule to print out the kernel arch and localversion, so
external tools, like distro packagers, can easily get it.

v2: add help text

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index fa0fbe7..32c8f2a 100644
--- a/Makefile
+++ b/Makefile
@@ -1517,6 +1517,10 @@  help:
 	@echo  'Kernel packaging:'
 	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''
+	@echo  'Build configuration retrieval:'
+	@echo  '  kernellocalversion  - Print kernel local version (CONFIG_LOCALVERSION)'
+	@echo  '  kernelarch          - Print kernel architecture'
+	@echo  ''
 	@echo  'Documentation targets:'
 	@$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
 	@echo  ''
@@ -1728,6 +1732,12 @@  kernelrelease:
 kernelversion:
 	@echo $(KERNELVERSION)
 
+kernellocalversion:
+	@$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree) | sed -e 's~^\-~~'
+
+kernelarch:
+	@echo $(ARCH)
+
 image_name:
 	@echo $(KBUILD_IMAGE)