kbuild.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Output files
  2. modules.order
  3. --------------------------------------------------
  4. This file records the order in which modules appear in Makefiles. This
  5. is used by modprobe to deterministically resolve aliases that match
  6. multiple modules.
  7. modules.builtin
  8. --------------------------------------------------
  9. This file lists all modules that are built into the kernel. This is used
  10. by modprobe to not fail when trying to load something builtin.
  11. Environment variables
  12. KCPPFLAGS
  13. --------------------------------------------------
  14. Additional options to pass when preprocessing. The preprocessing options
  15. will be used in all cases where kbuild does preprocessing including
  16. building C files and assembler files.
  17. KAFLAGS
  18. --------------------------------------------------
  19. Additional options to the assembler.
  20. KCFLAGS
  21. --------------------------------------------------
  22. Additional options to the C compiler.
  23. KBUILD_VERBOSE
  24. --------------------------------------------------
  25. Set the kbuild verbosity. Can be assigned same values as "V=...".
  26. See make help for the full list.
  27. Setting "V=..." takes precedence over KBUILD_VERBOSE.
  28. KBUILD_EXTMOD
  29. --------------------------------------------------
  30. Set the directory to look for the kernel source when building external
  31. modules.
  32. The directory can be specified in several ways:
  33. 1) Use "M=..." on the command line
  34. 2) Environmnet variable KBUILD_EXTMOD
  35. 3) Environmnet variable SUBDIRS
  36. The possibilities are listed in the order they take precedence.
  37. Using "M=..." will always override the others.
  38. KBUILD_OUTPUT
  39. --------------------------------------------------
  40. Specify the output directory when building the kernel.
  41. The output directory can also be specificed using "O=...".
  42. Setting "O=..." takes precedence over KBUILD_OUTPUT.
  43. ARCH
  44. --------------------------------------------------
  45. Set ARCH to the architecture to be built.
  46. In most cases the name of the architecture is the same as the
  47. directory name found in the arch/ directory.
  48. But some architectures such as x86 and sparc have aliases.
  49. x86: i386 for 32 bit, x86_64 for 64 bit
  50. sparc: sparc for 32 bit, sparc64 for 64 bit
  51. CROSS_COMPILE
  52. --------------------------------------------------
  53. Specify an optional fixed part of the binutils filename.
  54. CROSS_COMPILE can be a part of the filename or the full path.
  55. CROSS_COMPILE is also used for ccache in some setups.
  56. CF
  57. --------------------------------------------------
  58. Additional options for sparse.
  59. CF is often used on the command-line like this:
  60. make CF=-Wbitwise C=2
  61. INSTALL_PATH
  62. --------------------------------------------------
  63. INSTALL_PATH specifies where to place the updated kernel and system map
  64. images. Default is /boot, but you can set it to other values.
  65. INSTALLKERNEL
  66. --------------------------------------------------
  67. Install script called when using "make install".
  68. The default name is "installkernel".
  69. The script will be called with the following arguments:
  70. $1 - kernel version
  71. $2 - kernel image file
  72. $3 - kernel map file
  73. $4 - default install path (use root directory if blank)
  74. The implmentation of "make install" is architecture specific
  75. and it may differ from the above.
  76. INSTALLKERNEL is provided to enable the possibility to
  77. specify a custom installer when cross compiling a kernel.
  78. MODLIB
  79. --------------------------------------------------
  80. Specify where to install modules.
  81. The default value is:
  82. $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
  83. The value can be overridden in which case the default value is ignored.
  84. INSTALL_MOD_PATH
  85. --------------------------------------------------
  86. INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
  87. relocations required by build roots. This is not defined in the
  88. makefile but the argument can be passed to make if needed.
  89. INSTALL_MOD_STRIP
  90. --------------------------------------------------
  91. INSTALL_MOD_STRIP, if defined, will cause modules to be
  92. stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
  93. the default option --strip-debug will be used. Otherwise,
  94. INSTALL_MOD_STRIP will used as the options to the strip command.
  95. INSTALL_FW_PATH
  96. --------------------------------------------------
  97. INSTALL_FW_PATH specifies where to install the firmware blobs.
  98. The default value is:
  99. $(INSTALL_MOD_PATH)/lib/firmware
  100. The value can be overridden in which case the default value is ignored.
  101. INSTALL_HDR_PATH
  102. --------------------------------------------------
  103. INSTALL_HDR_PATH specifies where to install user space headers when
  104. executing "make headers_*".
  105. The default value is:
  106. $(objtree)/usr
  107. $(objtree) is the directory where output files are saved.
  108. The output directory is often set using "O=..." on the commandline.
  109. The value can be overridden in which case the default value is ignored.
  110. KBUILD_MODPOST_WARN
  111. --------------------------------------------------
  112. KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
  113. symbols in the final module linking stage. It changes such errors
  114. into warnings.
  115. KBUILD_MODPOST_NOFINAL
  116. --------------------------------------------------
  117. KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
  118. This is solely useful to speed up test compiles.
  119. KBUILD_EXTRA_SYMBOLS
  120. --------------------------------------------------
  121. For modules that use symbols from other modules.
  122. See more details in modules.txt.
  123. ALLSOURCE_ARCHS
  124. --------------------------------------------------
  125. For tags/TAGS/cscope targets, you can specify more than one arch
  126. to be included in the databases, separated by blank space. E.g.:
  127. $ make ALLSOURCE_ARCHS="x86 mips arm" tags
  128. To get all available archs you can also specify all. E.g.:
  129. $ make ALLSOURCE_ARCHS=all tags