lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectmodule buid issue with kbuild
From
Hi,
I have an issue building my kernel modules, generally the makefile
should look like:

obj-m = my_mod.o
my_mod-objs := $(the_obj_file_list)

if I list the obj files explicitly like
the_obj_file_list := a/obj1.o b/obj2.o c/obj3.o, it seems fine

Sometime there are too many obj files to add, so I want make to search
it automatically, so I use:
#find each of the .c files
mods := $(sort $(dir $(shell find . -name '*.c' -print)))
sources := $(wildcard $(addsuffix *.c,$(mods)))
#make the obj file list
objects := $(subst .c,.o,$(sources))
#remove the prefixing ./
myobjects := $(subst ./,,$(objects))

obj-m = my_mod.o
my_mod-objs := $(myobjects)
$(myobjects) should be exactly the same as $(the_obj_file_list) above,
I printed them in the makefile.

Unfortunately this does not work, it gives error messages below:
make[2]: *** No rule to make target
`/home/user/workingdir/scripts/bin2c.s', needed by
`/home/user/workingdir/scripts/bin2c.o'.  Stop.

Obviously bin2c is not in my working dir, it is in the kbuild directory.

I wonder if there is any way at all to avoid to write the full obj
list, it's really annoying.

Thanks a lot.
If you reply this post, please also CC to this address.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-02-25 14:11    [W:0.021 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site