- 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
- 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
- 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