重构Makefile中的KPROBES钩子逻辑,简化条件编译信息输出

This commit is contained in:
ShirkNeko
2025-04-17 19:53:21 +08:00
parent b72ab79e06
commit be8d6ca052

View File

@@ -22,16 +22,6 @@ obj-$(CONFIG_KSU) += kernelsu.o
obj-$(CONFIG_KPM) += kpm/
ifeq ($(strip $(CONFIG_KSU_HOOK_KPROBES)),y)
$(info -- SukiSU: KPROBES hooking enabled!)
else
$(info -- SukiSU: Manual hooking enabled!)
ifeq ($(strip $(CONFIG_KSU)),m)
$(error CONFIG_KSU_MANUAL_HOOK cannot be enabled when compiling SukiSU as LKM!)
endif
endif
# .git is a text file while the module is imported by 'git submodule add'.
ifeq ($(shell test -e $(srctree)/$(src)/../.git; echo $$?),0)
$(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin [ -f ../.git/shallow ] && git fetch --unshallow)
@@ -64,6 +54,15 @@ $(info -- Supported Unofficial Manager: 5ec1cff (GKI) rsuntk (Non-GKI) ShirkNeko
KERNEL_VERSION := $(VERSION).$(PATCHLEVEL)
$(info -- KERNEL_VERSION: $(KERNEL_VERSION))
ifeq ($(strip $(CONFIG_KSU_HOOK_KPROBES)),y)
$(info -- SukiSU: KPROBES hooking enabled!)
else
$(info -- SukiSU: Manual hooking enabled!)
ifeq ($(strip $(CONFIG_KSU)),m)
$(error CONFIG_KSU_MANUAL_HOOK cannot be enabled when compiling SukiSU as LKM!)
endif
endif
# Check if KPM is enabled
ifeq ($(CONFIG_KPM),y)
$(info -- KPM is enabled)