LinuxQuestions.org
Help answer threads with 0 replies.
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-25-2010, 10:52 AM   #1
rrlangly
Member
 
Registered: Dec 2009
Posts: 47

Rep: Reputation: 0
Makefile not building *.ko


Below is my modules Makefile. When I build it, it does build the stand-alone program kabcd in the directory below, but it doesn't build an abc.ko file which I'm expecting.

I'm thinking the var CONFIG_ABC is defined wrong. I'm building this outside of the kernel tree in my own directory, yet trying to have something that will eventually work like I'm running 'make menuconfig', but ... not sure how to set CONFIG_ABC properly, if that is my problem.

---
EXTRA_CFLAGS += -I(src)/../../include/linux/abc

obj-$(CONFIG_ABC) += abc.o
obj-$(CONFIG_ABC) += kabcd/

abc-objs := abc1.o

KERNELDIR := /lib/modules/`uname -r`/build

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


---
$ make
make -C /lib/modules/`uname -r`/build M=/home/me/projects/ABC/ksrc/net/abc modules
make[1]: Entering directory `/usr/src/linux-2.6.31-gentoo-r6'
Building modules, stage 2.
MODPOST 0 modules
make[1]: Leaving directory `/usr/src/linux-2.6.31-gentoo-r6'


My abc.c and abc1.c files aren't building a *.ko.
 
Old 03-25-2010, 03:04 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Try to set CONFIG_ABC to m in kernel configuration file.
 
Old 03-30-2010, 10:04 AM   #3
rrlangly
Member
 
Registered: Dec 2009
Posts: 47

Original Poster
Rep: Reputation: 0
Seems the error is in my EXTRA_CFLAGS line, if I comment it out, it builds. I'll have to work on that.

Last edited by rrlangly; 03-30-2010 at 10:12 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
Is it mandatory to have the name of the makefile as 'Makefile' for kernal module comp narender.d Linux - Kernel 3 05-29-2009 06:26 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
How can I use "Makefile.in" for building an executable program? wuzhong Linux - Networking 1 10-06-2004 10:00 AM
building mingetty, Makefile troble. e1000 Linux - Software 1 12-31-2003 06:00 PM

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

All times are GMT -5. The time now is 05:40 PM.

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