我上次的内核开发是在2.6版~现在我尝试编译一个模块,在内核树之外编译时出现以下错误。
/bin/sh: 1: /home/blabla/workspace/kernel35/linux-3.5/scripts/recordmcount: not found
目标文件已正确创建,但问题出在内核 Makefile 本身,有些东西已经改变,我没有更新?
我正在使用来自 kernel.org 的 vanilla 内核源代码,而且我已经这样做了
make oldconfig && make prepare
我发布了我正在使用的 Makefile,它是内核模块的标准 makefile
# Comment/uncomment the following line to disable/enable debugging
#DEBUG = y
# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
DEBFLAGS = -O -g -DBLABLA_DEBUG # "-O" is needed to expand inlines
else
DEBFLAGS = -O2
endif
ccflags-y += $(DEBFLAGS)
ccflags-y += -I..
ifneq ($(KERNELRELEASE),)
# call from kernel build system
obj-m := blabla.o
else
KERNELDIR ?= /home/blabla/workspace/kernel35/linux-3.5
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
depend .depend dep:
$(CC) $(CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif