summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2021-02-12 11:29:24 -0500
committerMasahiro Yamada <masahiroy@kernel.org>2021-02-16 12:01:45 +0900
commit88a686728b3739d3598851e729c0e81f194e5c53 (patch)
tree4de7baef4769c087f14d7aef4f0b4803cd290706 /Makefile
parent9b82f13e7ef316cdc0a8858f1349f4defce3f9e0 (diff)
kbuild: simplify access to the kernel's version
Instead of storing the version in a single integer and having various kernel (and userspace) code how it's constructed, export individual (major, patchlevel, sublevel) components and simplify kernel code that uses it. This should also make it easier on userspace. Signed-off-by: Sasha Levin <sashal@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 12607d389148..1fdd44fe1659 100644
--- a/Makefile
+++ b/Makefile
@@ -1255,7 +1255,10 @@ define filechk_version.h
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
fi; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + \
- ((c) > 255 ? 255 : (c)))'
+ ((c) > 255 ? 255 : (c)))'; \
+ echo \#define LINUX_VERSION_MAJOR $(VERSION); \
+ echo \#define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL); \
+ echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
endef
$(version_h): FORCE