No need to change any make file.
Make 1 directory out side the kernel tree,
then
Write you own make file, for compiling
that module.
& Then compile it. You will get ur ko in ur directory.
There is a sample I have used for usb serial
gadget
------
obj-m := $(MOD).o
$(MOD)-objs :=
../../../linux-2.6.17/drivers/usb/gadget/serial.o \
../../../linux-2.6.17/drivers/usb/gadget/epautoconf.o \
../../../linux-2.6.17/drivers/usb/gadget/config.o \
../../../linux-2.6.17/drivers/usb/gadget/usbstring.o
CFLAGS += -I$(PWD/Includes -D
_HOST_DEBUG_
KDIR := ../../../linux-2.6.17
PWD := $(shell pwd)
default:
$(MAKE)
-C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm
*.o *.ko *.mod.c .*.cmd Modules.symvers .tmp_versions/*
rmdir
.tmp_versions
----
-----Original Message-----
From:
kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of pragnesh radadia
Sent: Monday, June 16, 2008 9:25
AM
To: kernelnewbies@xxxxxxxxxxxx
Cc: Veda Tripathi
Subject: Re: Help needed regarding
Makefile os an external loadable module
I think Makefile only
require modification if you add new sourcecode file.
----- Original Message ----
From: Veda Tripathi <veda.trips@xxxxxxxxx>
To: kernelnewbies@xxxxxxxxxxxx
Sent: Monday, 16 June, 2008 8:15:17 AM
Subject: Help needed regarding Makefile os an external loadable module
Hi all,
I have been trying to build ext3 as an external loadable module after adding
some code in inode.c I mistakenly assumed that the Makefile doesn't require any
change. Now I have discovered that Makefiles for external modules are written
differently. I know how to write a simple Makefile for external modules (even
with many source files) without any configuration options. But in above case how
to write or what changes should be done in the Makefile of ext3?
I already have been through Documentation present in the source tree but not
much discussion about config options in case of external modules there.
I would appreciate any help.
Thanx and Regards
Veda
Check out the all-new face of Yahoo! India. Click
here.