From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- Documentation/smart-config.txt | 102 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Documentation/smart-config.txt (limited to 'Documentation/smart-config.txt') diff --git a/Documentation/smart-config.txt b/Documentation/smart-config.txt new file mode 100644 index 00000000000..c9bed4cf877 --- /dev/null +++ b/Documentation/smart-config.txt @@ -0,0 +1,102 @@ +Smart CONFIG_* Dependencies +1 August 1999 + +Michael Chastain +Werner Almesberger +Martin von Loewis + +Here is the problem: + + Suppose that drivers/net/foo.c has the following lines: + + #include + + ... + + #ifdef CONFIG_FOO_AUTOFROB + /* Code for auto-frobbing */ + #else + /* Manual frobbing only */ + #endif + + ... + + #ifdef CONFIG_FOO_MODEL_TWO + /* Code for model two */ + #endif + + Now suppose the user (the person building kernels) reconfigures the + kernel to change some unrelated setting. This will regenerate the + file include/linux/autoconf.h, which will cause include/linux/config.h + to be out of date, which will cause drivers/net/foo.c to be recompiled. + + Most kernel sources, perhaps 80% of them, have at least one CONFIG_* + dependency somewhere. So changing _any_ CONFIG_* setting requires + almost _all_ of the kernel to be recompiled. + +Here is the solution: + + We've made the dependency generator, mkdep.c, smarter. Instead of + generating this dependency: + + drivers/net/foo.c: include/linux/config.h + + It now generates these dependencies: + + drivers/net/foo.c: \ + include/config/foo/autofrob.h \ + include/config/foo/model/two.h + + So drivers/net/foo.c depends only on the CONFIG_* lines that + it actually uses. + + A new program, split-include.c, runs at the beginning of + compilation (make bzImage or make zImage). split-include reads + include/linux/autoconf.h and updates the include/config/ tree, + writing one file per option. It updates only the files for options + that have changed. + + mkdep.c no longer generates warning messages for missing or unneeded + lines. The new top-level target 'make checkconfig' + checks for these problems. + +Flag Dependencies + + Martin Von Loewis contributed another feature to this patch: + 'flag dependencies'. The idea is that a .o file depends on + the compilation flags used to build it. The file foo.o has + its flags stored in .flags.foo.o. + + Suppose the user changes the foo driver from resident to modular. + 'make' will notice that the current foo.o was not compiled with + -DMODULE and will recompile foo.c. + + All .o files made from C source have flag dependencies. So do .o + files made with ld, and .a files made with ar. However, .o files + made from assembly source do not have flag dependencies (nobody + needs this yet, but it would be good to fix). + +Per-source-file Flags + + Flag dependencies also work with per-source-file flags. + You can specify compilation flags for individual source files + like this: + + CFLAGS_foo.o = -DSPECIAL_FOO_DEFINE + + This helps clean up drivers/net/Makefile, drivers/scsi/Makefile, + and several other Makefiles. + +Credit + + Werner Almesberger had the original idea and wrote the first + version of this patch. + + Michael Chastain picked it up and continued development. He is + now the principal author and maintainer. Please report any bugs + to him. + + Martin von Loewis wrote flag dependencies, with some modifications + by Michael Chastain. + + Thanks to all of the beta testers. -- cgit v1.2.3