From mboxrd@z Thu Jan 1 00:00:00 1970 From: colin@cvidal.org (Colin Vidal) Date: Mon, 04 Apr 2016 21:43:27 +0200 Subject: build external module splited into several files In-Reply-To: <20160404184740.GC32131@kroah.com> References: <1459792809.2543.80.camel@cvidal.org> <20160404184740.GC32131@kroah.com> Message-ID: <1459799007.2600.11.camel@cvidal.org> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Mon, 2016-04-04 at 11:47 -0700, Greg KH wrote: > On Mon, Apr 04, 2016 at 08:00:09PM +0200, Colin Vidal wrote: > >? > > Hi all, > >? > > I'm currently reading LDD the 3rd edition. Chapter 2 says that if > > we > > need for example to build module "foo.c" which is split in two > > other > > files "sub1.c" and "sub2.c", we just have to define the following > > Kbuild variable in the makefile: > >? > > foo-objs := sub1.o sub2.o > >? > > I suppose that? > >? > > foo-y := sub1.o sub2.o > >? > > has the same semantic ? That's not very clear to me. > Nope, not at all, stick with the "foo-objs" string instead please. Hi Greg, thanks for the clarification! However, I'm sorry but I'm still confused: it's said in Documentation/kbuild/makefiles.txt on section 3.3, that if a module kernel is build from several sources file, we have to use the module_name-y variable. Maybe a misunderstood the context of this doc (the example is from in-tree kernel module) ? > That should resolve your other issues here. >? > hope this helps, Well, I tried again (with X-objs) but I've get the same issue :( No hurry anyways, I have a scull driver to implements... :) Thanks, Colin (PS: sorry for duplication)