Uboot Makefile Study Record

Source: Internet
Author: User

  1. U-boot Top-level makefile Unlike Linux's top-level mkefile, each board has a configuration definition, such that it needs to be configured before make
    Forlinx_nand_ram256_config:unconfig
    @$ (mkconfig) smdk6410 arm s3c64xx smdk6410 Samsung s3c6410 NAND ram256

    It uses the./mkconfig script to generate include/config.mk files, include/config.h and/board/samsung/smdk6410/config.mk, as well as some linked files
    The contents of the Include/config.mk file are as follows:
    ARCH = Arm
    CPU = s3c64xx
    BOARD = smdk6410
    VENDOR = Samsung
    SOC = s3c6410

    Include/config.h content is as follows:
    #define Forlinx_boot_nand
    #define FORLINX_BOOT_RAM256
    #include <configs/smdk6410.h>

    The/board/samsung/smdk6410/config.mk contents are as follows---occupy up to 2MB space in 256MB
    Ifndef text_base
    Text_base = 0xcfe00000
    Endi

    After configuration make, the top-level makefile file contains
    Include/include/config.mk
    Include/config.mk, and further includes the following
    Sinclude $ (Topdir)/$ (ARCH) _config.mk
    Sinclude $ (Topdir)/cpu/$ (CPU)/config.mk
    Sinclude $ (Topdir)/cpu/$ (CPU)/$ (SOC)/config.mk
    Sinclude $ (Topdir)/board/$ (boarddir)/config.mk

    Makefile also defines the target file $ (OBJS), library file $ (LIBS)
    U-boot:depend version $ (subdirs) $ (OBJS) $ (LIBS) $ (ldscript)
    Undef_sym= ' $ (OBJDUMP)-X $ (LIBS) |sed-n-E ' s/.*\ (__u_boot_cmd_.*\)/-u\1/p ' |sort|uniq '; \
    CD $ (LNDIR) && $ (LD) $ (ldflags) $ $UNDEF _sym $ (__OBJS) \
    --start-group $ (__libs)--end-group $ (platform_libs) \
    -map U-boot.map-o U-boot


  2. U-boot compiled makefile file also has an important file/include/configs/<boardname.h>, which set a variety of parameters config_xxx and cfg_xxx
  3. The porting work also includes (1) Adding a new board configuration item at the top level, (2) Adding a configuration file under Include/configs/, and (3) creating a new directory under board/to place the Configure.mk file and the board-related initialization code for the new board.

reference [1]. Huaqingyuan See "Embedded Linux system development technology-based on arm"

Uboot Makefile Study Record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.