[linux-dvb] Problems with building own module

Ben Backx ben at bbackx.com
Thu Dec 20 10:14:04 CET 2007


The second CFLAGS-rule of the modified makefile looks like this off-course:

EXTRA_CFLAGS += -I/usr/src/linux-source-2.6.22/drivers/media/dvb/dvb-core

 

Apparently, something went wrong during copy-paste :-s

 

From: linux-dvb-bounces at linuxtv.org [mailto:linux-dvb-bounces at linuxtv.org]
On Behalf Of Ben Backx
Sent: 20 December 2007 10:09
To: linux-dvb at linuxtv.org
Subject: [linux-dvb] Problems with building own module

 

Hi,

 

I'm almost finished with the beta of a new driver, but the final part is
giving me a headache.

I created my own Makefile, and as long as I compile with that Makefile,
everything goes fine (except insmodding, but perhaps this goes better when I
build the module together with the rest of the v4l-tree).

First, my system specs:

It's an AMD Athlon XP 2500+ with Ubuntu 7.10 and standard kernel of Ubuntu
(version 2.6.22-14).

 

The makefile I created looks something like this:

 

obj-m += dvb-driver.o

 

dvb-driver-objs := driver.o otherfile.o another.o

 

EXTRA_CFLAGS := -I/usr/src/linux-source-2.6.22/drivers/ieee1394

EXTRA_CFLAGS += -I/usr/src/linux-source-2.6.22/drivers/media/dvb/dvb-core 

EXTRA_CFLAGS += -I/usr/src/linux-headers-$(shell uname -r)

EXTRA_CFLAGS += -I/usr/src/linux-headers-$(shell uname -r)/include

 

all:

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

 

clean:

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

 

Compilation using this file goes fine.
So, I modified this file as is stated in README.patches and created
something like this:

 

obj-$(CONFIG_DVB_DRIVER)     := dvb-driver.o

 

dvb-driver-objs := driver.o otherfile.o another.o

 

EXTRA_CFLAGS := -I/usr/src/linux-source-2.6.22/drivers/ieee1394

EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core

 

driver.c: driver.h otherfile.h another.h

otherfile.c: otherfile.h driver.h

another.c: another.h otherfile.h

 

I added all the source-files to the directory dvb-driver in the folder
linux/drivers/media/dvb off the v4l-dvb-tree.

Then, I modified linux/drivers/media/dvb/Makefile so it contains the folder
of my driver. Finally, I added "source
"drivers/media/dvb/dvb-driver/Kconfig" to linux/drvers/media/dvb/Kconfig.

 

Now, when I try to build the complete library, there's no dvb-driver.o (or
any other off the .o-files) created. Some source-files are copied to the
v4l-directory, but no object is created.

Can anyone help me out with this? Because I'm rather stuck for the moment L

 

 

Greetings,

Ben

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20071220/0afa9f98/attachment.htm 


More information about the linux-dvb mailing list