ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2013年8月27日 星期二

linux Makefile..

linux 的 Makefile 同時包含說明在裡面..

像..
# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
# 1) O=
# Use "make O=dir/to/store/output/files/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.
說明,可以在 build 的時候用 O= 指定輸出位置,
不然就可以宣告環境變數 KBUILD_OUTOUT


cross compiling
設定 ARCH 和 CROSS_COMPILE, Makefile 就會知道..
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.

# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# A third alternative is to store a setting in .config so that plain
# "make" in the configured kernel build directory always uses that.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile


然後下面是 help 的內容..
make help 的輸出..
Cleaning targets:
  clean    - Remove most generated files but keep the config and
                    enough build support to build external modules
  mrproper   - Remove all generated files + config + various backup files
  distclean   - mrproper + remove editor backup and patch files

Configuration targets:
  config   - Update current config utilising a line-oriented program
  nconfig         - Update current config utilising a ncurses menu based program
  menuconfig   - Update current config utilising a menu based program
  xconfig   - Update current config utilising a QT based front-end
  gconfig   - Update current config utilising a GTK based front-end
  oldconfig   - Update current config utilising a provided .config as base
  localmodconfig  - Update current config disabling modules not loaded
  localyesconfig  - Update current config converting local mods to core
  silentoldconfig - Same as oldconfig, but quietly, additionally update deps
  randconfig   - New config with random answer to all options
  defconfig   - New config with default answer to all options
  allmodconfig   - New config selecting modules when possible
  allyesconfig   - New config where all options are accepted with yes
  allnoconfig   - New config where all options are answered with no

Other generic targets:
  all    - Build all targets marked with [*]
* vmlinux   - Build the bare kernel
* modules   - Build all modules
  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
  firmware_install- Install all firmware to INSTALL_FW_PATH
                    (default: $(INSTALL_MOD_PATH)/lib/firmware)
  dir/            - Build all files in dir and below
  dir/file.[oisS] - Build specified target only
  dir/file.lst    - Build specified mixed source/assembly target only
                    (requires a recent binutils and recent build (System.map))
  dir/file.ko     - Build module including final link
  modules_prepare - Set up for building external modules
  tags/TAGS   - Generate tags file for editors
  cscope   - Generate cscope index
  kernelrelease   - Output the release version string
  kernelversion   - Output the version stored in Makefile
  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
                    (default: /home/charles-chang/cv3k10.3/kernel_imx/usr)

Static analysers
  checkstack      - Generate a list of stack hogs
  namespacecheck  - Name space analysis on compiled kernel
  versioncheck    - Sanity check on version.h usage
  includecheck    - Check for duplicate included header files
  export_report   - List the usages of all exported symbols
  headers_check   - Sanity check on exported headers
  headerdep       - Detect inclusion cycles in headers

Kernel packaging:
  rpm-pkg         - Build both source and binary RPM kernel packages
  binrpm-pkg      - Build only the binary kernel package
  deb-pkg         - Build the kernel as an deb package
  tar-pkg         - Build the kernel as an uncompressed tarball
  targz-pkg       - Build the kernel as a gzip compressed tarball
  tarbz2-pkg      - Build the kernel as a bzip2 compressed tarball

Documentation targets:
 Linux kernel internal documentation in different formats:
  htmldocs        - HTML
  pdfdocs         - PDF
  psdocs          - Postscript
  xmldocs         - XML DocBook
  mandocs         - man pages
  installmandocs  - install man pages generated by mandocs
  cleandocs       - clean all generated DocBook files

Architecture specific targets (arm):
* zImage        - Compressed kernel image (arch/arm/boot/zImage)
  Image         - Uncompressed kernel image (arch/arm/boot/Image)
* xipImage      - XIP kernel image, if configured (arch/arm/boot/xipImage)
  uImage        - U-Boot wrapped zImage
  bootpImage    - Combined zImage and initial RAM disk
                  (supply initrd image via make variable INITRD=)
  install       - Install uncompressed kernel
  zinstall      - Install compressed kernel
                  Install using (your) ~/bin/installkernel or
                  (distribution) /sbin/installkernel or
                  install to $(INSTALL_PATH) and run lilo

  acs5k_defconfig          - Build for acs5k
  acs5k_tiny_defconfig     - Build for acs5k_tiny
  afeb9260_defconfig       - Build for afeb9260
  am200epdkit_defconfig    - Build for am200epdkit
  am3517_evm_defconfig     - Build for am3517_evm
  ams_delta_defconfig      - Build for ams_delta
  ap4evb_defconfig         - Build for ap4evb
  assabet_defconfig        - Build for assabet
  at572d940hfek_defconfig  - Build for at572d940hfek
  at91cap9adk_defconfig    - Build for at91cap9adk
  at91rm9200dk_defconfig   - Build for at91rm9200dk
....
....
  spitz_defconfig          - Build for spitz
  stamp9g20_defconfig      - Build for stamp9g20
  stmp378x_defconfig       - Build for stmp378x
  stmp37xx_defconfig       - Build for stmp37xx
  sx1_defconfig            - Build for sx1
  tct_hammer_defconfig     - Build for tct_hammer
  trizeps4_defconfig       - Build for trizeps4
  u300_defconfig           - Build for u300
  u8500_defconfig          - Build for u8500
  usb-a9260_defconfig      - Build for usb-a9260
  usb-a9263_defconfig      - Build for usb-a9263
  versatile_defconfig      - Build for versatile
  viper_defconfig          - Build for viper
  xcep_defconfig           - Build for xcep
  yl9200_defconfig         - Build for yl9200
  zeus_defconfig           - Build for zeus

  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
  make V=2   [targets] 2 => give reason for rebuild of target
  make O=dir [targets] Locate all output files in "dir", including .config
  make C=1   [targets] Check all c source with $CHECK (sparse by default)
  make C=2   [targets] Force check of all c source with $CHECK

Execute "make" or "make all" to build all targets marked with [*] 
For further info see the ./README file

沒有留言:

標籤

網誌存檔