Building drivers with make

Hello all!

When trying to build serialmonkeys rt61 drivers (I have a card not working with ndiswrapper you see) I get the following error after typing make in a terminal window:

make[1]: Entering directory `/usr/src/linux-2.6.25.5-1.1-obj/i386/default'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.25.5-1.1-obj/i386/default'
rt61.ko failed to build!
make: *** [module] Error 1

I have make, gcc and linux-kernel-headers installed. What is going wrong?

Thanks for all help!

try this:

cd /usr/src/linux-2.6.25.5-1.1
make prepare
make modules_prepare

I would get a similar error:

make: *** No rule to make target `prepare'.  Stop.

I get the feeling something is off with the config of either make or gcc, but I don’t have much experience with these things…
Thanks for the quick reply!

try this:

cd /usr/src/linux
make oldconfig
make prepare
make modules_prepare

see if that works first, if not, then there’s something wrong with your kernel source

I should perhaps have already mentioned that I’m doing this in openSUSE 11.0 GM, GNOME edition (not that it should matter much I suppose)

The only folders in my /usr/src folder are called
linux-2.6.25.5-1.1-obj and packages, and in the first we have a folder named i386 and a link to another named i586. They both have a folder each named default, and inside of them again are two files: makedumpfile.config and Module.symvers.
Running “make oldconfig” in any of these folders yield the same result:

make: *** No rule to make target `oldconfig'.  Stop.

Just made the clean install from an md5-checked ISO today. Weird.

Make sure your kernel-source package exactly matches the version of your kernel-default package.

sounds like you haven’t installed the kernel source package. Look in Yast for it

Oh man… Saw just now that I had the header files but not the kernel sources installed. Thanks for pointing that out!

UPDATE:
Now everything worked straight away :o thank you guys!