LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-19-2010, 08:08 PM   #1
rrlangly
Member
 
Registered: Dec 2009
Posts: 47

Rep: Reputation: 0
help w/ kbuild


I'm trying to make a kernel module, but I'm getting stuck on the kbuild system. Can anyone advise of my problem w/ this Makefile? I'm using kernel 2.6.31-r6

Code:
obj-$(CONFIG_ABC) += abc.o

abc-objs := dabc.o

modules:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

all: 
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
And when I try to build, here's the error I get.

Code:
$ make
make -C  M=/home/projects/ABC/ksrc/net/abc modules
make: *** M=/home/projects/ABC/ksrc/net/abc: No such file or directory.  Stop.
make: *** [modules] Error 2
/home/projects/ABC/ksrc/net/abc is the directory where I've placed the Makefile and source files.
 
Old 03-21-2010, 06:05 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
The problem is that '$(KERNELDIR)' is not defined (it should be the path to the kernel source directory), so it expands to nothing.

Quote:
Code:
make -C  M=/home/projects/ABC/ksrc/net/abc modules
Because of that, the '-C' flag is using the following argument 'M=/home/projects...' as the destination directory. This directory does not exist (ie, there is no directory named 'M=...').

Last edited by neonsignal; 03-21-2010 at 06:20 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Some Question about kbuild makefile ao.yuan.young Linux - Kernel 0 05-14-2009 09:54 PM
linux-kbuild-2.6.24 radiodee1 Debian 7 01-30-2008 05:34 AM
Can kbuild execute non-kbuild makefiles? xuanadoo Linux - Newbie 0 10-15-2006 02:41 AM
linux-kbuild-2.6.17 davcefai Debian 3 06-27-2006 03:28 PM
kbuild error Barakanooz Linux - Hardware 0 10-04-2005 06:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration