[问题].config文件在ubuntu的什么文件夹下
发表于 : 2007-10-18 16:23
1. 我的Makefile文件如下
# set to your kernel tree
KERNEL = /home/linux
# get the Linux architecture. Needed to find proper include file for CFLAGS
ARCH=$(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# set default flags to compile module
CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNEL)/include
CFLAGS+= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
all: sharelist.o
# get configuration of kernel
include $(KERNEL)/.config
# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile
# enable the module versions, if configured in kernel source tree
ifdef CONFIG_MODVERSIONS
CFLAGS+= -DMODVERSIONS -include $(KERNEL)/include/linux/modversions.h
endif
# enable SMP, if configured in kernel source tree
ifdef CONFIG_SMP
CFLAGS+= -D__SMP__
endif
# note: we are compiling the driver object file and then linking
# we link it into the module. With just one object file as in
# this example this is not needed. We can just load the object
# file produced by gcc
# link the thread driver module
sharelist.o: sharelist.c
gcc $(CFLAGS) -c sharelist.c
clean:
rm -f *.o
# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile
2. sharelist.c文件已编写好
3.
我的本来理解是:把arch/${ARCH}/Makefile文件和.config文件存储到/home/linux下,而linux文件夹只是个用户文件夹,可以随着自己定义的不同而变化,比如我的电脑上是/home/chen,就是把arch/${ARCH}/Makefile文件和.config文件存储到chen文件夹下,然后把Makefile中开始部分的代码改为KERNEL = /home/chen,不知道我的理解对不对
问题:每次以输入make就显示arch/${ARCH}/Makefile和.config找不到,但是我在LINUX中搜索.config根本找不到,找到的只是*.config形式的文件,至于arch/${ARCH}/Makefile,因为前面ARCH的复杂定义,我就更摸不着头脑了,我刚刚接触LINUX不久,希望有高手能帮我解决一下上述问题
邮箱:[email protected]
QQ: 416508484
# set to your kernel tree
KERNEL = /home/linux
# get the Linux architecture. Needed to find proper include file for CFLAGS
ARCH=$(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# set default flags to compile module
CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNEL)/include
CFLAGS+= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
all: sharelist.o
# get configuration of kernel
include $(KERNEL)/.config
# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile
# enable the module versions, if configured in kernel source tree
ifdef CONFIG_MODVERSIONS
CFLAGS+= -DMODVERSIONS -include $(KERNEL)/include/linux/modversions.h
endif
# enable SMP, if configured in kernel source tree
ifdef CONFIG_SMP
CFLAGS+= -D__SMP__
endif
# note: we are compiling the driver object file and then linking
# we link it into the module. With just one object file as in
# this example this is not needed. We can just load the object
# file produced by gcc
# link the thread driver module
sharelist.o: sharelist.c
gcc $(CFLAGS) -c sharelist.c
clean:
rm -f *.o
# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile
2. sharelist.c文件已编写好
3.
我的本来理解是:把arch/${ARCH}/Makefile文件和.config文件存储到/home/linux下,而linux文件夹只是个用户文件夹,可以随着自己定义的不同而变化,比如我的电脑上是/home/chen,就是把arch/${ARCH}/Makefile文件和.config文件存储到chen文件夹下,然后把Makefile中开始部分的代码改为KERNEL = /home/chen,不知道我的理解对不对
问题:每次以输入make就显示arch/${ARCH}/Makefile和.config找不到,但是我在LINUX中搜索.config根本找不到,找到的只是*.config形式的文件,至于arch/${ARCH}/Makefile,因为前面ARCH的复杂定义,我就更摸不着头脑了,我刚刚接触LINUX不久,希望有高手能帮我解决一下上述问题
邮箱:[email protected]
QQ: 416508484