Originally Posted by slzckboy
well,I'm not too familiar with make.
I think you are skipping some steps. You should learn a bit on make with not-kernel code.
Anyway, you can help yourself by inserting your module in the kernel source tree, so you don't have to bother with makefile and the options passed to GCC for creating a module example:
put your source file in /home/me/ldd3
call it hello.c then
ln -s /home/me/ldd3
Tell the makefile that there is a module directory in ldd3 that has to be added to the list:
echo "obj-m += ldd3" >> Makefile
Create a dummy makefile in this directory.
You add hello2.o to the list (+=) of modules the top makefile has to compile.
echo "obj-m += hello.o" > Makefile
now go back to the kernel root, it is where you can issue make modules and the Makefile will descent into the whole directories and compiles the list of modules (obj-m).