KERN_DIR = /work/sys/linux-2.6.22.6
all :
make -C $(KERN_DIR) M='pwd' modules
clean:
make -C $(KERN_DIR) M='pwd' modules clean
rm -rf modules.order
obj-m +=first_diver.o
以上是我写的Makefile
但是我make之后:
book@book-desktop:/work/project/first_drv$ ls
first_diver.c Makefile
book@book-desktop:/work/project/first_drv$ make
make -C /work/sys/linux-2.6.22.6 M='pwd' modules
make[1]: Entering directory `/work/sys/linux-2.6.22.6'
scripts/Makefile.build:17: /work/sys/linux-2.6.22.6/pwd/Makefile: No such file or directory
make[2]: *** No rule to make target `/work/sys/linux-2.6.22.6/pwd/Makefile'. Stop.
make[1]: *** [_module_pwd] Error 2
make[1]: Leaving directory `/work/sys/linux-2.6.22.6'
make: *** [all] Error 2
book@book-desktop:/work/project/first_drv$
我检查了C文件的文件名,和makefile内是对的上的,而且我已经配置、编译了内核,也已经生成了uImage,但还是出错,请各位大神帮帮忙
以上是make和make uImage之后的提示信息,都是成功的
WARNING: arch/
ARM/mach-s3c2443/built-in.o(.text+0x1020): Sec
tion mismatch: reference to .init.data: (after 's3c2443_dma_add')
WARNING: arch/arm/plat-s3c24xx/built-in.o(.text+0x2a8c): Section mismatch: reference to .init.text:s3c24xx_dma_init (between 's3c2410_dma_init' and 's3c2410_dma_request')
WARNING: arch/arm/plat-s3c24xx/built-in.o(.data+0x23cc): Section mismatch: reference to .init.text: (between 's3c24xx_timer' and 's3c2410_timer_irq')
WARNING: sound/built-in.o(.text+0x18c3c): Section mismatch: reference to .init.text: (between 's3c2410iis_probe' and 's3c2410iis_remove')
WARNING: sound/built-in.o(.text+0x18c64): Section mismatch: reference to .init.text: (between 's3c2410iis_probe' and 's3c2410iis_remove')
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 22 modules
、
3c2443_irq_init')
WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x1020): Section mismatch: reference to .init.data: (after 's3c2443_dma_add')
WARNING: arch/arm/plat-s3c24xx/built-in.o(.text+0x2a8c): Section mismatch: reference to .init.text:s3c24xx_dma_init (between 's3c2410_dma_init' and 's3c2410_dma_request')
WARNING: arch/arm/plat-s3c24xx/built-in.o(.data+0x23cc): Section mismatch: reference to .init.text: (between 's3c24xx_timer' and 's3c2410_timer_irq')
WARNING: sound/built-in.o(.text+0x18c3c): Section mismatch: reference to .init.text: (between 's3c2410iis_probe' and 's3c2410iis_remove')
WARNING: sound/built-in.o(.text+0x18c64): Section mismatch: reference to .init.text: (between 's3c2410iis_probe' and 's3c2410iis_remove')
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Image arch/arm/boot/uImage is ready