Driver source file name:/work/driver/test. c
Driver target file name: Test. Ko
Kernel source code Directory:/work/linux2.6.30This directory is the root directory of the board source code.
Step 1: Enter make oldconfig & make prepare & make scripts in the kernel source code (/work/linux2.6.30 ).
Part 2: There are two compilation methods
(1) In the/work/driver/directory # Make-C/work/linux2.6.30 M = $ PWD modules
(2) Write a makefile file in the/work/driver/directory and enter the make command
obj-m :=test.oKDIR :=/work/linux2.6.30all : make -C $(KDIR) M=$(shell pwd) modulesclean: make -C $(KDIR) M=$(shell pwd) clean
[Statement] due to my limited level, if the description of the article is incorrect, please correct me. E-mail: embed001@gmail.com QQ technology exchange group: 179012822 reprint please indicate the source of http://blog.csdn.net/embedded_hunter