HI Shivanth,

On Mon, Oct 11, 2010 at 8:20 AM, shivanth m p <[email protected]> wrote:
> I created a kernel module for the 2.6.33 kernel outside the kernel source
> directory . When i give the make command it says
> Nothing to be done for /root/mydrivers
>
> Here's my makefile
>
>  obj-m +=mydiver.o
> modules :
>              make -C ..kerndev/linux-2.6/  M=$(PWD) modules
> clean :
>              make -C ../kerndev/linux-2.6/  M=$(PWD) clean
>
> my module source is in /root/mydrivers and the kernel source in
> /root/kerndev/linux-2.6

When you invoke make by default with no arguments, it assume you typed
make all. Since your makefile has no all target, it thinks that there
is nothing to be done.

Your makefile needs some more stuff in it. What the kernel build
system wants to see is just the

obj-m += mydriver.o

line. So you need to use some make conditionals:

ifneq ($(KERNELRELEASE),)
obj-m += mydriver.o
else

all : modules

modules :
             make -C ..kerndev/linux-2.6/  M=$(PWD) modules
clean :
             make -C ../kerndev/linux-2.6/  M=$(PWD) clean

endif

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to