mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* module buid issue with kbuild
       [not found] <87397bdf0902250503v2c9ac230od5c807f0b7d2e5f6@mail.gmail.com>
@ 2009-02-25 13:08 ` des
  0 siblings, 0 replies; only message in thread
From: des @ 2009-02-25 13:08 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-25 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87397bdf0902250503v2c9ac230od5c807f0b7d2e5f6@mail.gmail.com>
2009-02-25 13:08 ` module buid issue with kbuild des

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®