[Scons-users] Building Linux Kernel Loadable Modules

Dirk Bächle tshortik at gmx.de
Wed Jan 14 16:46:06 EST 2015


Hi Enrique,

On 14.01.2015 21:42, Enrique Herrera wrote:
>
> I have a legacy Linux embedded application, that uses Scons has its build tool. The project only consists of an SConstruct file. I
> do not have the luxury of having SConfig.py and Sconscript files within this project. I have been trying to add a new
> env.Environment() that will build an external loadable module of a Linux Kernel 2.4.x driver.
>
> Basically, this is what I need to do this to build the driver:
>
> [...]
>
> ld -r foo.o bar.o -o foobar.o
>
> [...]
>
> That's not what I really want to do. I just need to link the two object files together. I really do not know how.
>

you can use the Command() method (see http://www.scons.org/doc/production/HTML/scons-user.html#chap-builders-commands ) to run 
single commands like this one. However, if you need this functionality more often you should consider to write a proper Builder for 
creating loadable Kernel modules (see http://www.scons.org/wiki/ToolsForFools ).
The Command() should look something like this:

   env.Command('foobar.o', ['foo.o', 'bar.o'], '$LD -r $SOURCES $TARGET')

Best regards,

Dirk



More information about the Scons-users mailing list