LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Makefile not building *.ko (https://www.linuxquestions.org/questions/linux-kernel-70/makefile-not-building-%2A-ko-797815/)

rrlangly 03-25-2010 10:52 AM

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.

nini09 03-25-2010 03:04 PM

Try to set CONFIG_ABC to m in kernel configuration file.

rrlangly 03-30-2010 10:04 AM

Seems the error is in my EXTRA_CFLAGS line, if I comment it out, it builds. I'll have to work on that.


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