> One thing is not clear from your question: are you trying to > build out-of-tree drivers or drivers inside the kernel tree ? > Out of tree drivers ought to just work; they need to provide > their own dependency info if that is really required. In tree > you have to start with a full new build unfortionatly. In fact I'm bothering with the two opposite questions: first how to build my own (out of tree, yet ;) module, and why it forces to start with make mrproper(or distclean) when someone wants to add some functionality for running (out-of-box) kernel by building absent (in tree) module (ntfs.o for example). For the first one, I wrote my Makefile: --- Makefile --- # Rules for making the EDF scheduling discipline obj-m := sch_edf.o include $(TOPDIR)/Rules.make --- end (Makefile) --- try to build my own module against fresh installed kernel-source rpm gives this output: --- output --- [root@amarie sch_edf-0.1]# make -C /usr/src/linux-2.4 SUBDIRS=`pwd` modules make: Entering directory `/usr/src/linux-2.4.18-14' gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/split-include scripts/split-include.c scripts/split-include include/linux/autoconf.h include/config make -r -f tmp_include_depends all make[1]: Entering directory `/usr/src/linux-2.4.18-14' make[1]: tmp_include_depends: No such file or directory make[1]: *** No rule to make target `tmp_include_depends'. Stop. make[1]: Leaving directory `/usr/src/linux-2.4.18-14' make: *** [tmp_include_depends] Error 2 make: Leaving directory `/usr/src/linux-2.4.18-14' --- end (output) --- Same behaviour I observed some time ago, when was seeking a way to build ntfs module that I really need: --- ntfs build output --- [root@amarie linux-2.4]# make SUBDIRS=fs/ntfs modules make -r -f tmp_include_depends all make[1]: Entering directory `/usr/src/linux-2.4.18-14' make[1]: tmp_include_depends: No such file or directory make[1]: *** No rule to make target `tmp_include_depends'. Stop. make[1]: Leaving directory `/usr/src/linux-2.4.18-14' make: *** [tmp_include_depends] Error 2 --- end (ntfs build output) --- As I remember RedHat 7.0 came with the rhconfig.h tricks (possibly due to 2.2 smp) and since that I was unable to simply build add-onn modules for running (out-of-box) kernels. My solution was hack EXTRAVERSION in Makefile to match out-of-box kernel, make distclean dep && make SUBDIRS=fs/ntfs modules. But later I started to learn kernel (and kernel-build system) internals to implement packet scheduling discipline and found another rather _ugly_ solution: _first_ make dep on the fresh (out-of-box) kernel - due to lack of the .config (CONFIG_MODVERSIONS actualy) it doesn't destroy any of autoconf.h version.h modversions.h files, then create stub .config by copying /boot/config to .config and, at the end make SUBDIRS=/path/to/some/module modules. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/