···4040modules.4141The directory can be specified in several ways:42421) Use "M=..." on the command line4343-2) Environmnet variable KBUILD_EXTMOD4444-3) Environmnet variable SUBDIRS4343+2) Environment variable KBUILD_EXTMOD4444+3) Environment variable SUBDIRS4545The possibilities are listed in the order they take precedence.4646Using "M=..." will always override the others.47474848KBUILD_OUTPUT4949--------------------------------------------------5050Specify the output directory when building the kernel.5151-The output directory can also be specificed using "O=...".5151+The output directory can also be specified using "O=...".5252Setting "O=..." takes precedence over KBUILD_OUTPUT.53535454ARCH···9090 $3 - kernel map file9191 $4 - default install path (use root directory if blank)92929393-The implmentation of "make install" is architecture specific9393+The implementation of "make install" is architecture specific9494and it may differ from the above.95959696INSTALLKERNEL is provided to enable the possibility to
+12-12
Documentation/kbuild/makefiles.txt
···285285--- 3.7 Compilation flags286286287287 ccflags-y, asflags-y and ldflags-y288288- The three flags listed above apply only to the kbuild makefile where289289- they are assigned (i.e., per-directory). They are used for all the290290- normal cc, as and ld invocation happening during a recursive build.288288+ These three flags apply only to the kbuild makefile in which they289289+ are assigned. They are used for all the normal cc, as and ld290290+ invocations happening during a recursive build.291291 Note: Flags with the same behaviour were previously named:292292- EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. They are still293293- supported but their use is deprecated.292292+ EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS.293293+ They are still supported but their usage is deprecated.294294295295 ccflags-y specifies options for compiling with $(CC).296296···317317318318 subdir-ccflags-y, subdir-asflags-y319319 The two flags listed above are similar to ccflags-y and asflags-y.320320- The difference is that the subdir- variants affect the kbuild321321- file where they are present and all subdirectories. Options specified322322- using subdir-* are added to the commandline before the options323323- specified using the non-subdir variants.320320+ The difference is that the subdir- variants have effect for the kbuild321321+ file where they are present and all subdirectories.322322+ Options specified using subdir-* are added to the commandline before323323+ the options specified using the non-subdir variants.324324325325 Example:326326 subdir-ccflags-y := -Werror···11741174=== 7 Kbuild syntax for exported headers1175117511761176The kernel include a set of headers that is exported to userspace.11771177-Many headers can be exported as-is but other headers requires a11771177+Many headers can be exported as-is but other headers require a11781178minimal pre-processing before they are ready for user-space.11791179The pre-processing does:11801180- drop kernel specific annotations11811181- drop include of compiler.h11821182-- drop all sections that is kernel internat (guarded by ifdef __KERNEL__)11821182+- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)1183118311841184-Each relevant directory contain a file name "Kbuild" which specify the11841184+Each relevant directory contains a file name "Kbuild" which specifies the11851185headers to be exported.11861186See subsequent chapter for the syntax of the Kbuild file.11871187