2.7. Modules Spanning Multiple Files

Sometimes it makes sense to divide a kernel module between several source files.

Here's an example of such a kernel module.

Example 2-8. start.c

>

The next file:

Example 2-9. stop.c

>

And finally, the makefile:

Example 2-10. Makefile

>

This is the complete makefile for all the examples we've seen so far. The first five lines are nothing special, but for the last example we'll need two lines. First we invent an object name for our combined module, second we tell make what object files are part of that module.