kbuild.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. Environment variables
  2. KCPPFLAGS
  3. --------------------------------------------------
  4. Additional options to pass when preprocessing. The preprocessing options
  5. will be used in all cases where kbuild do preprocessing including
  6. building C files and assembler files.
  7. KAFLAGS
  8. --------------------------------------------------
  9. Additional options to the assembler.
  10. KCFLAGS
  11. --------------------------------------------------
  12. Additional options to the C compiler.
  13. KBUILD_VERBOSE
  14. --------------------------------------------------
  15. Set the kbuild verbosity. Can be assinged same values as "V=...".
  16. See make help for the full list.
  17. Setting "V=..." takes precedence over KBUILD_VERBOSE.
  18. KBUILD_EXTMOD
  19. --------------------------------------------------
  20. Set the directory to look for the kernel source when building external
  21. modules.
  22. The directory can be specified in several ways:
  23. 1) Use "M=..." on the command line
  24. 2) Environmnet variable KBUILD_EXTMOD
  25. 3) Environmnet variable SUBDIRS
  26. The possibilities are listed in the order they take precedence.
  27. Using "M=..." will always override the others.
  28. KBUILD_OUTPUT
  29. --------------------------------------------------
  30. Specify the output directory when building the kernel.
  31. The output directory can also be specificed using "O=...".
  32. Setting "O=..." takes precedence over KBUILD_OUTPUT
  33. ARCH
  34. --------------------------------------------------
  35. Set ARCH to the architecture to be built.
  36. In most cases the name of the architecture is the same as the
  37. directory name found in the arch/ directory.
  38. But some architectures suach as x86 and sparc has aliases.
  39. x86: i386 for 32 bit, x86_64 for 64 bit
  40. sparc: sparc for 32 bit, sparc64 for 64 bit
  41. CROSS_COMPILE
  42. --------------------------------------------------
  43. Specify an optional fixed part of the binutils filename.
  44. CROSS_COMPILE can be a part of the filename or the full path.
  45. CROSS_COMPILE is also used for ccache is some setups.
  46. CF
  47. --------------------------------------------------
  48. Additional options for sparse.
  49. CF is often used on the command-line like this:
  50. make CF=-Wbitwise C=2
  51. INSTALL_PATH
  52. --------------------------------------------------
  53. INSTALL_PATH specifies where to place the updated kernel and system map
  54. images. Default is /boot, but you can set it to other values
  55. MODLIB
  56. --------------------------------------------------
  57. Specify where to install modules.
  58. The default value is:
  59. $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
  60. The value can be overridden in which case the default value is ignored.
  61. INSTALL_MOD_PATH
  62. --------------------------------------------------
  63. INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
  64. relocations required by build roots. This is not defined in the
  65. makefile but the argument can be passed to make if needed.
  66. INSTALL_MOD_STRIP
  67. --------------------------------------------------
  68. INSTALL_MOD_STRIP, if defined, will cause modules to be
  69. stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
  70. the default option --strip-debug will be used. Otherwise,
  71. INSTALL_MOD_STRIP will used as the options to the strip command.
  72. INSTALL_FW_PATH
  73. --------------------------------------------------
  74. INSTALL_FW_PATH specify where to install the firmware blobs.
  75. The default value is:
  76. $(INSTALL_MOD_PATH)/lib/firmware
  77. The value can be overridden in which case the default value is ignored.
  78. INSTALL_HDR_PATH
  79. --------------------------------------------------
  80. INSTALL_HDR_PATH specify where to install user space headers when
  81. executing "make headers_*".
  82. The default value is:
  83. $(objtree)/usr
  84. $(objtree) is the directory where output files are saved.
  85. The output directory is often set using "O=..." on the commandline.
  86. The value can be overridden in which case the default value is ignored.
  87. KBUILD_MODPOST_WARN
  88. --------------------------------------------------
  89. KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
  90. symbols in the final module linking stage.
  91. KBUILD_MODPOST_FINAL
  92. --------------------------------------------------
  93. KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
  94. This is solely usefull to speed up test compiles.
  95. KBUILD_EXTRA_SYMBOLS
  96. --------------------------------------------------
  97. For modules use symbols from another modules.
  98. See more details in modules.txt.