mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: des <desperatephilosopher@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: module buid issue with kbuild
Date: Wed, 25 Feb 2009 21:08:11 +0800	[thread overview]
Message-ID: <87397bdf0902250508u70fc4b55g323479840a0ea1bf@mail.gmail.com> (raw)
In-Reply-To: <87397bdf0902250503v2c9ac230od5c807f0b7d2e5f6@mail.gmail.com>

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.

           reply	other threads:[~2009-02-25 13:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <87397bdf0902250503v2c9ac230od5c807f0b7d2e5f6@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87397bdf0902250508u70fc4b55g323479840a0ea1bf@mail.gmail.com \
    --to=desperatephilosopher@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®