Building multiple .ko files from a single module

Sankar P sankar.curiosity at gmail.com
Tue Apr 9 07:33:14 EDT 2013


Hi,

I have some source files: a.c b.c c.c etc. Now I need to generate a
few .ko files such as, 1.ko, 2.ko, 3.ko etc.

I know the correspondence between the source files and the .ko file.

Is there a way I could achieve this with a single Makefile ? All the
tutorials and the help pages seem to focus on creating a single .ko
file from a Makefile, as that is the usual case. However, I need to
have different modules generated from my sources. For some
shareability reasons, I cannot move the sources to different folders
either.

Can someone please show me how it should be done ?

For example, consider the following association between source files
and the .ko files.

a.c a.h common.c common.h => 1.ko
b.c b.h common.c common.h => 2.ko

Thank you.

--
Sankar P
http://psankar.blogspot.com



More information about the Kernelnewbies mailing list