You will have noticed that we tend to follow a one-kernel-module-per-directory rule of sorts. Yes, that definitely helps keep things organized. So, let's take our second kernel module, the ch4/printk_loglvl one. To build it, we just cd to its folder, type make, and (fingers crossed!) voilà, it's done. We have the printk_loglevel.ko kernel module object freshly generated (which we can then insmod(8)/rmmod(8)). But how exactly did it get built when we typed make? Ah, explaining this is the purpose of this section.
As this is our very first chapter that deals with the LKM framework and its corresponding Makefile, we will keep things nice and simple, especially with regard to the Makefile here. However, early in the following chapter, we shall introduce a more sophisticated, simply better Makefile (that is still quite simple to understand). We shall then use this better Makefile in...