kbuild.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. KBUILD_DEBARCH
  44. --------------------------------------------------
  45. For the deb-pkg target, allows overriding the normal heuristics deployed by
  46. deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
  47. the UTS_MACHINE variable, and on some architectures also the kernel config.
  48. The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
  49. architecture.
  50. ARCH
  51. --------------------------------------------------
  52. Set ARCH to the architecture to be built.
  53. In most cases the name of the architecture is the same as the
  54. directory name found in the arch/ directory.
  55. But some architectures such as x86 and sparc have aliases.
  56. x86: i386 for 32 bit, x86_64 for 64 bit
  57. sparc: sparc for 32 bit, sparc64 for 64 bit
  58. CROSS_COMPILE
  59. --------------------------------------------------
  60. Specify an optional fixed part of the binutils filename.
  61. CROSS_COMPILE can be a part of the filename or the full path.
  62. CROSS_COMPILE is also used for ccache in some setups.
  63. CF
  64. --------------------------------------------------
  65. Additional options for sparse.
  66. CF is often used on the command-line like this:
  67. make CF=-Wbitwise C=2
  68. INSTALL_PATH
  69. --------------------------------------------------
  70. INSTALL_PATH specifies where to place the updated kernel and system map
  71. images. Default is /boot, but you can set it to other values.
  72. INSTALLKERNEL
  73. --------------------------------------------------
  74. Install script called when using "make install".
  75. The default name is "installkernel".
  76. The script will be called with the following arguments:
  77. $1 - kernel version
  78. $2 - kernel image file
  79. $3 - kernel map file
  80. $4 - default install path (use root directory if blank)
  81. The implmentation of "make install" is architecture specific
  82. and it may differ from the above.
  83. INSTALLKERNEL is provided to enable the possibility to
  84. specify a custom installer when cross compiling a kernel.
  85. MODLIB
  86. --------------------------------------------------
  87. Specify where to install modules.
  88. The default value is:
  89. $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
  90. The value can be overridden in which case the default value is ignored.
  91. INSTALL_MOD_PATH
  92. --------------------------------------------------
  93. INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
  94. relocations required by build roots. This is not defined in the
  95. makefile but the argument can be passed to make if needed.
  96. INSTALL_MOD_STRIP
  97. --------------------------------------------------
  98. INSTALL_MOD_STRIP, if defined, will cause modules to be
  99. stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
  100. the default option --strip-debug will be used. Otherwise,
  101. INSTALL_MOD_STRIP will used as the options to the strip command.
  102. INSTALL_FW_PATH
  103. --------------------------------------------------
  104. INSTALL_FW_PATH specifies where to install the firmware blobs.
  105. The default value is:
  106. $(INSTALL_MOD_PATH)/lib/firmware
  107. The value can be overridden in which case the default value is ignored.
  108. INSTALL_HDR_PATH
  109. --------------------------------------------------
  110. INSTALL_HDR_PATH specifies where to install user space headers when
  111. executing "make headers_*".
  112. The default value is:
  113. $(objtree)/usr
  114. $(objtree) is the directory where output files are saved.
  115. The output directory is often set using "O=..." on the commandline.
  116. The value can be overridden in which case the default value is ignored.
  117. KBUILD_MODPOST_WARN
  118. --------------------------------------------------
  119. KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
  120. symbols in the final module linking stage. It changes such errors
  121. into warnings.
  122. KBUILD_MODPOST_NOFINAL
  123. --------------------------------------------------
  124. KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
  125. This is solely useful to speed up test compiles.
  126. KBUILD_EXTRA_SYMBOLS
  127. --------------------------------------------------
  128. For modules that use symbols from other modules.
  129. See more details in modules.txt.
  130. ALLSOURCE_ARCHS
  131. --------------------------------------------------
  132. For tags/TAGS/cscope targets, you can specify more than one arch
  133. to be included in the databases, separated by blank space. E.g.:
  134. $ make ALLSOURCE_ARCHS="x86 mips arm" tags
  135. To get all available archs you can also specify all. E.g.:
  136. $ make ALLSOURCE_ARCHS=all tags