Re: Trouble making module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/12/2010 12:30 PM, shivanth m p wrote:
> 
> 
> On Tue, Oct 12, 2010 at 12:43 PM, Wouter Simons <lkml@xxxxxxxxxxxxxxxx
> <mailto:lkml@xxxxxxxxxxxxxxxx>> wrote:
> 
>     On 10/11/2010 05:20 PM, shivanth m p 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
>     Don't you mean ../kerndev instead of ..kerndev ;-)
> 
>     Wouter
> 
> I'm pretty sure its not the typo thing .
> Checked it a thousand times .
> 
> when does make give nothing to be done for "directory" warning ? This
> answer will help a lot
I think the makefile you need should probably have something along these
lines:

all:
	obj-m 		+= modname.o
	modname-y	:= mydriver.o
	make -C ../kerndev/linux-2.6/  M=$(PWD) modules
clean:
	make -C ../kerndev/linux-2.6/  M=$(PWD) clean

Make is not giving the error, I think it is the Kbuild system
determining that there is nothing to be done for your files because
there are no objects to be placed in your module. The documentation on
making makefiles for your projects is in Documentation/kbuild

HTH,

Wouter

PS: My makefiles are a bit different, because I check if I am in the
kernel build system first. If so, the modules are specified, if not I
invoke the make command with the right options. Have a look here for a
more detailed explanation of setting up such a makefile:
http://lwn.net/images/pdf/LDD3/ch02.pdf

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux