On Fri, 13 Jan 2012 16:05:29 -0500 Bryan Schumaker <bjschuma@xxxxxxxxxx> wrote: > > > > It seems like an enormous amount of code movement. Isn't there a way to accomplish modularization without moving things into separate directories? > > Not that I know of. I found examples for compiling directories as > modules, but not specific files or parts of files. > You can definitely compile specific files or small collections of files into modules. See for example drivers/md/ In Makefile obj-$(CONFIG_FOO) += foo.o will make a "foo.ko" if CONFIG_FOO == m If you want two .c files to make a modules, then foo-y :- foo-top.o foo-bot.o obj-$(CONFIG_FOO) += foo.o will do the trick. Compiling parts of a file into one module and parts into another - while possible - would certainly be frowned upon. Definitely split such files up. NeilBrown
Attachment:
signature.asc
Description: PGP signature