Makefile 中的通配符没有任何作用

Makefile 中的通配符没有任何作用

我正在尝试在 FreePBX (RHEL) 中编译名为 DAHDI 的内核模块。我收到以下 make 输出错误:

You do not appear to have the sources for the 3.10.0-957.21.3.el7.x86_64 kernel installed.

但我不认为这是问题所在,因为我已经检查了我的内核版本、标头、配置文件,它们都匹配。在 Makefile 中,我有这个块:

KCONFIG:=$(KSRC)/.config
ifneq (,$(wildcard $(KCONFIG)))
  HAS_KSRC:=yes
  include $(KCONFIG)
else
  HAS_KSRC:=no
endif

$(KCONFIG)返回“/.config”。$(HAS_KSRC)返回“否”。$(wildcard $(KCONFIG))不返回任何内容。这个错误来自ifeq (no,$(HAS_KSRC)).换句话说,它会查找内核配置文件,直到应用“通配符”。

这个通配符(命令??)有什么作用?

# cat /proc/version
Linux version 3.10.0-957.21.3.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019

答案1

看起来您有源树,但它当前未配置(这就是.config丢失的原因)。

尝试:

  1. 将 /boot/config- 复制到 ${KSRC}/.config

或者

  1. make oldconfig从内核源代码树运行

相关内容