u-boot 3、编译

转载 2015年07月07日 16:30:52

u-boot的编译,实际上就是看u-boot下的Makefile文件,以下是i.mx6的u-bootMakefile文件:


#####################################

#定义U_BOOT_VERSION为2012.07
#####################################
VERSION = 2009
PATCHLEVEL = 08
SUBLEVEL =
EXTRAVERSION =
ifneq "$(SUBLEVEL)" ""
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
endif
TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
VERSION_FILE = $(obj)include/version_autogenerated.h


######################################
#HOSTARCH为i686,HOSTOS为linux,SHELL为/bin/sh
######################################
HOSTARCH := $(shell uname -m | \
sed -e s/i.86/i386/ \
   -e s/sun4u/sparc64/ \
   -e s/arm.*/arm/ \
   -e s/sa110/arm/ \
   -e s/powerpc/ppc/ \
   -e s/ppc64/ppc/ \
   -e s/macppc/ppc/)


HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
   sed -e 's/\(cygwin\).*/cygwin/')


# Set shell to bash if possible, otherwise fall back to sh
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)


export HOSTARCH HOSTOS SHELL


# Deal with colliding definitions from tcsh etc.
VENDOR=


#########################################################################
# Allow for silent builds
ifeq (,$(findstring s,$(MAKEFLAGS)))
XECHO = echo
else
XECHO = :
endif


#########################################################################
#
# U-boot build supports producing a object files to the separate external
# directory. Two use cases are supported:
#
# 1) Add O= to the make command line
# 'make O=/tmp/build all'
#
# 2) Set environement variable BUILD_DIR to point to the desired location
# 'export BUILD_DIR=/tmp/build'
# 'make'
#
# The second approach can also be used with a MAKEALL script
# 'export BUILD_DIR=/tmp/build'
# './MAKEALL'
#
# Command line 'O=' setting overrides BUILD_DIR environent variable.
#
# When none of the above methods is used the local build is performed and
# the object files are placed in the source directory.
#
######################################
#如果在编译时,加上了O=选项,则编译的时候会创建一个新目录(目录名为O=后面的内容),编译出来的文件都会放到这个目录下
######################################

ifdef O
ifeq ("$(origin O)", "command line")
BUILD_DIR := $(O)
endif
endif


ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)


# Attempt to create a output directory.
$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})


# Verify if it was successful.
BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
endif # ifneq ($(BUILD_DIR),)

######################################
#在我所使用的u-boot中,OBJTREE=SRCTREE
######################################
OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SRCTREE := $(CURDIR)
TOPDIR := $(SRCTREE)
LNDIR := $(OBJTREE)
export TOPDIR SRCTREE OBJTREE


MKCONFIG := $(SRCTREE)/mkconfig
export MKCONFIG


ifneq ($(OBJTREE),$(SRCTREE))
REMOTE_BUILD := 1
export REMOTE_BUILD
endif


# $(obj) and (src) are defined in config.mk but here in main Makefile
# we also need them before config.mk is included which is the case for
# some targets like unconfig, clean, clobber, distclean, etc.
ifneq ($(OBJTREE),$(SRCTREE))
obj := $(OBJTREE)/
src := $(SRCTREE)/
else
obj :=
src :=
endif
export obj src


# Make sure CDPATH settings don't interfere
unexport CDPATH


#########################################################################


ifeq ($(ARCH),powerpc)
ARCH = ppc
endif


# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
SUBDIRS = tools \
 examples/standalone \
 examples/api


.PHONY : $(SUBDIRS)


ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))


# Include autoconf.mk before config.mk so that the config options are available
# to all top level build files.  We need the dummy all: target to prevent the
# dependency target in autoconf.mk.dep from being the default.
all:
sinclude $(obj)include/autoconf.mk.dep
sinclude $(obj)include/autoconf.mk

######################################
#include/config.mk就是u-boot配置时产生的其中一个文件
######################################
# load ARCH, BOARD, and CPU configuration
include $(obj)include/config.mk
export ARCH CPU BOARD VENDOR SOC


# set default to nothing for native builds
ifeq ($(HOSTARCH),$(ARCH))
CROSS_COMPILE ?=
endif

######################################
#顶层目录的config.mk,作用:1、定义交叉编译器 2、定义AR、调试、优化、预处理、C编译器、链接选项 3、指定编译规则
######################################
# load other configuration
include $(TOPDIR)/config.mk


#########################################################################
# U-Boot objects....order is important (i.e. start must be first)

######################################
#这里就是组成u-boot.bin的源材料,主要有OBJ和LIBS,顺序非常重要
######################################
OBJS  = cpu/$(CPU)/start.o  #$(CPU)=arm_cortexa8
ifeq ($(CPU),i386)
OBJS += cpu/$(CPU)/start16.o
OBJS += cpu/$(CPU)/resetvec.o
endif
ifeq ($(CPU),ppc4xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o
endif


OBJS := $(addprefix $(obj),$(OBJS))

######################################
#这里就是把u-boot下每一个目录的文件都编译成一个.a文件
######################################
LIBS  = lib_generic/libgeneric.a
LIBS += lib_generic/lzma/liblzma.a
LIBS += lib_generic/lzo/liblzo.a

LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
"board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
LIBS += cpu/$(CPU)/lib$(CPU).a
ifdef SOC
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
endif
ifeq ($(CPU),ixp)
LIBS += cpu/ixp/npe/libnpe.a
endif
LIBS += lib_$(ARCH)/lib$(ARCH).a
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a \
fs/ubifs/libubifs.a
LIBS += net/libnet.a
LIBS += disk/libdisk.a
LIBS += drivers/bios_emulator/libatibiosemu.a
LIBS += drivers/block/libblock.a
LIBS += drivers/dma/libdma.a
LIBS += drivers/fpga/libfpga.a
LIBS += drivers/gpio/libgpio.a
LIBS += drivers/hwmon/libhwmon.a
LIBS += drivers/i2c/libi2c.a
LIBS += drivers/input/libinput.a
LIBS += drivers/misc/libmisc.a
LIBS += drivers/mmc/libmmc.a
LIBS += drivers/mtd/libmtd.a
LIBS += drivers/mtd/nand/libnand.a
LIBS += drivers/mtd/onenand/libonenand.a
LIBS += drivers/mtd/ubi/libubi.a
LIBS += drivers/mtd/spi/libspi_flash.a
LIBS += drivers/net/libnet.a
LIBS += drivers/net/phy/libphy.a
LIBS += drivers/net/sk98lin/libsk98lin.a
LIBS += drivers/pci/libpci.a
LIBS += drivers/pcmcia/libpcmcia.a
LIBS += drivers/power/libpower.a
LIBS += drivers/spi/libspi.a
LIBS += drivers/fastboot/libfastboot.a
ifeq ($(CPU),mpc83xx)
LIBS += drivers/qe/qe.a
endif
ifeq ($(CPU),mpc85xx)
LIBS += drivers/qe/qe.a
LIBS += cpu/mpc8xxx/ddr/libddr.a
TAG_SUBDIRS += cpu/mpc8xxx
endif
ifeq ($(CPU),mpc86xx)
LIBS += cpu/mpc8xxx/ddr/libddr.a
TAG_SUBDIRS += cpu/mpc8xxx
endif
LIBS += drivers/rtc/librtc.a
LIBS += drivers/serial/libserial.a
LIBS += drivers/twserial/libtws.a
LIBS += drivers/usb/gadget/libusb_gadget.a
LIBS += drivers/usb/host/libusb_host.a
LIBS += drivers/usb/musb/libusb_musb.a
LIBS += drivers/video/libvideo.a
LIBS += drivers/watchdog/libwatchdog.a
LIBS += common/libcommon.a
LIBS += libfdt/libfdt.a
LIBS += api/libapi.a
LIBS += post/libpost.a


LIBS := $(addprefix $(obj),$(LIBS))
.PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)


LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
LIBBOARD := $(addprefix $(obj),$(LIBBOARD))


# Add GCC lib
ifdef USE_PRIVATE_LIBGCC
ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
PLATFORM_LIBGCC = -L $(OBJTREE)/lib_$(ARCH) -lgcc
else
PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
endif
else
PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
endif
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
export PLATFORM_LIBS


# Special flags for CPP when processing the linker script.
# Pass the version down so we can handle backwards compatibility
# on the fly.
LDPPFLAGS += \
-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
$(shell $(LD) --version | \
 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')


ifeq ($(CONFIG_NAND_U_BOOT),y)
NAND_SPL = nand_spl
U_BOOT_NAND = $(obj)u-boot-nand.bin
endif


ifeq ($(CONFIG_ONENAND_U_BOOT),y)
ONENAND_IPL = onenand_ipl
U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
endif


__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))


#########################################################################
#########################################################################


# Always append ALL so that arch config.mk's can add custom ones
ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND)


all: $(ALL)


$(obj)u-boot.hex: $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@


$(obj)u-boot.srec: $(obj)u-boot
$(OBJCOPY) -O srec $< $@

######################################
#u-boot.bin就是所需的文件,它是依赖与u-boot
######################################
$(obj)u-boot.bin:$(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@



$(obj)u-boot.ldr: $(obj)u-boot
$(obj)tools/envcrc --binary > $(obj)env-ldr.o
$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)


$(obj)u-boot.ldr.hex: $(obj)u-boot.ldr
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary


$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary


$(obj)u-boot.img: $(obj)u-boot.bin
./tools/mkimage -A $(ARCH) -T firmware -C none \
-a $(TEXT_BASE) -e 0 \
-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
-d $< $@


$(obj)u-boot.sha1: $(obj)u-boot.bin
$(obj)tools/ubsha1 $(obj)u-boot.bin


$(obj)u-boot.dis: $(obj)u-boot
$(OBJDUMP) -d $< > $@

######################################
#产生u-boot的依赖和命令,在这里,LDFLAGS非常重要
######################################
GEN_UBOOT = \
UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
sed  -n -e 's/.*\($(SYM_PREFIX)__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
$(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
$(GEN_UBOOT)

ifeq ($(CONFIG_KALLSYMS),y)
smap=`$(call SYSTEM_MAP,u-boot) | \
awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
$(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
-c common/system_map.c -o $(obj)common/system_map.o
$(GEN_UBOOT) $(obj)common/system_map.o
endif


$(OBJS): depend
$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))


$(LIBS): depend $(SUBDIRS)
$(MAKE) -C $(dir $(subst $(obj),,$@))


$(LIBBOARD): depend $(LIBS)
$(MAKE) -C $(dir $(subst $(obj),,$@))


$(SUBDIRS): depend
$(MAKE) -C $@ all


$(LDSCRIPT): depend
$(MAKE) -C $(dir $@) $(notdir $@)


$(obj)u-boot.lds: $(LDSCRIPT)
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@


$(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C nand_spl/board/$(BOARDDIR) all


$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin


$(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all


$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin
cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin


$(VERSION_FILE):
@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
'$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp
@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@


$(TIMESTAMP_FILE):
@date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
@date +'#define U_BOOT_TIME "%T"' >> $@


gdbtools:
$(MAKE) -C tools/gdb all || exit 1


updater:
$(MAKE) -C tools/updater all || exit 1


env:
$(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1


depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done


TAG_SUBDIRS += include
TAG_SUBDIRS += lib_generic board/$(BOARDDIR)
TAG_SUBDIRS += cpu/$(CPU)
TAG_SUBDIRS += lib_$(ARCH)
TAG_SUBDIRS += fs/cramfs
TAG_SUBDIRS += fs/fat
TAG_SUBDIRS += fs/fdos
TAG_SUBDIRS += fs/jffs2
TAG_SUBDIRS += fs/yaffs2
TAG_SUBDIRS += net
TAG_SUBDIRS += disk
TAG_SUBDIRS += common
TAG_SUBDIRS += drivers/bios_emulator
TAG_SUBDIRS += drivers/block
TAG_SUBDIRS += drivers/gpio
TAG_SUBDIRS += drivers/hwmon
TAG_SUBDIRS += drivers/i2c
TAG_SUBDIRS += drivers/input
TAG_SUBDIRS += drivers/misc
TAG_SUBDIRS += drivers/mmc
TAG_SUBDIRS += drivers/mtd
TAG_SUBDIRS += drivers/mtd/nand
TAG_SUBDIRS += drivers/mtd/onenand
TAG_SUBDIRS += drivers/mtd/spi
TAG_SUBDIRS += drivers/net
TAG_SUBDIRS += drivers/net/sk98lin
TAG_SUBDIRS += drivers/pci
TAG_SUBDIRS += drivers/pcmcia
TAG_SUBDIRS += drivers/qe
TAG_SUBDIRS += drivers/rtc
TAG_SUBDIRS += drivers/serial
TAG_SUBDIRS += drivers/spi
TAG_SUBDIRS += drivers/usb
TAG_SUBDIRS += drivers/video


tags ctags:
ctags -w -o $(obj)ctags `find $(SUBDIRS) $(TAG_SUBDIRS) \
-name '*.[ch]' -print`


etags:
etags -a -o $(obj)etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
-name '*.[ch]' -print`
cscope:
find $(SUBDIRS) $(TAG_SUBDIRS) -name '*.[ch]' -print \
> cscope.files
cscope -b -q -k


SYSTEM_MAP = \
$(NM) $1 | \
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
LC_ALL=C sort
$(obj)System.map: $(obj)u-boot
@$(call SYSTEM_MAP,$<) > $(obj)System.map


#
# Auto-generate the autoconf.mk file (which is included by all makefiles)
#
# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
# the dep file is only include in this top level makefile to determine when
# to regenerate the autoconf.mk file.
$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
@$(XECHO) Generating $@ ; \
set -e ; \
: Generate the dependancies ; \
$(CC) -x c -DDO_DEPS_ONLY -M $(HOSTCFLAGS) $(CPPFLAGS) \
-MQ $(obj)include/autoconf.mk include/common.h > $@


$(obj)include/autoconf.mk: $(obj)include/config.h
@$(XECHO) Generating $@ ; \
set -e ; \
: Extract the config macros ; \
$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
mv $@.tmp $@


#########################################################################
else # !config.mk
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
$(SUBDIRS) $(TIMESTAMP_FILE) $(VERSION_FILE) gdbtools updater env depend \
dep tags ctags etags cscope $(obj)System.map:
@echo "System not configured - see README" >&2
@ exit 1
endif # config.mk


.PHONY : CHANGELOG
CHANGELOG:
git log --no-merges U-Boot-1_1_5.. | \
unexpand -a | sed -e 's/\s\s*$$//' > $@


include/license.h: tools/bin2header COPYING
cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
#########################################################################


unconfig:
@rm -f $(obj)include/config.h $(obj)include/config.mk \
$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \

$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep

######################################
#Makefile再往后,就类似于下面的配置方式,确定硬件平台信息
######################################

mx6q_hdmidongle_nand_mfg_config   : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_hdmidongle freescale mx6

######################################
#make clean清除处理
######################################

clean:
@rm -f $(obj)examples/standalone/82559_eeprom \
      $(obj)examples/standalone/eepro100_eeprom \
      $(obj)examples/standalone/hello_world \
      $(obj)examples/standalone/interrupt \
      $(obj)examples/standalone/mem_to_mem_idma2intr \
      $(obj)examples/standalone/sched \
      $(obj)examples/standalone/smc91111_eeprom \
      $(obj)examples/standalone/test_burst \
      $(obj)examples/standalone/timer
@rm -f $(obj)examples/api/demo{,.bin}
@rm -f $(obj)tools/bmp_logo  $(obj)tools/easylogo/easylogo  \
      $(obj)tools/env/{fw_printenv,fw_setenv} \
      $(obj)tools/envcrc \
      $(obj)tools/gdb/{astest,gdbcont,gdbsend} \
      $(obj)tools/gen_eth_addr    $(obj)tools/img2srec \
      $(obj)tools/mkimage  $(obj)tools/mpc86x_clk  \
      $(obj)tools/ncb  $(obj)tools/ubsha1
@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \
      $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin} \
      $(obj)board/trab/trab_fkt   $(obj)board/voiceblue/eeprom   \
      $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds  \
      $(obj)lib_blackfin/u-boot.lds \
      $(obj)u-boot.lds \
      $(obj)cpu/blackfin/bootrom-asm-offsets.[chs]
@rm -f $(obj)include/bmp_logo.h
@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
@rm -f $(obj)onenand_ipl/u-boot.lds
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@find $(OBJTREE) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o'-o -name '*.a' -o -name '*.exe' \) -print \
| xargs rm -f

########################################################################




我并没有一步步把产生u-boot的命令展开,而且直接编译u-boot,根据编译的打印信息,查看编译u-boot的命令:

 cd /home/lijiejia/test/u-boot-2009.08 && arm-linux-ld -Bstatic -T u-boot.lds  -Ttext 0x27800000 $UNDEF_SYM cpu/arm_cortexa8/start.o --start-group lib_generic/libgeneric.a lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a board/freescale/common/libfreescale.a cpu/arm_cortexa8/libarm_cortexa8.a cpu/arm_cortexa8/mx6/libmx6.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a fs/ubifs/libubifs.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/power/libpower.a drivers/spi/libspi.a drivers/fastboot/libfastboot.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a drivers/video/libvideo.a drivers/watchdog/libwatchdog.a common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a board/freescale/mx6q_hd300/libmx6q_hd300.a --end-group /home/lijiejia/test/u-boot-2009.08/lib_arm/eabi_compat.o -L /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/default -lgcc -Map u-boot.map -o u-boot

u-boot编译总结:

1、首先编译cpu/$(CPU)/start.S

2、然后对于平台相关的每个目录,每个通用目录,都使用他们各自的Makefile生成对应的库

3、将1、2步骤生成.o、.a文件按照board/$(BOARDDIR)/config.mk文件中指定的代码段起始地址、u-boot.lds链接脚本进行连接


u-boot配置和编译过程详解

备注:分析的是OK210开发板自带的uboot_smdkv210,可能有些部分和其他版本不太一样,但是原理都类似。编译u-boot的步骤make forlinx_linux_config make首先...
  • Kevin_Mr
  • Kevin_Mr
  • 2016年05月16日 21:43
  • 10846

ZYNQ平台学习--(3)u-boot编译

1.BOOT.bin介绍 映像文件BOOT.BIN一般包括:FSBL,Bitstream和SSBL这三个文件,其中Bitstream是配置PL端程序,是可选项,在制作Linaro系统的时候并不需要。...
  • ryuuei_1984
  • ryuuei_1984
  • 2016年08月26日 15:44
  • 1523

u-boot-2016.09 make编译过程分析(一)

上一篇文章《》详尽分析了u-boot执行配置命令make xxx_defconfig的整个流程,本文着眼于编译流程,即配置完成后执行make命令生成二进制文件的过程。由于涉及的依赖和命令很多,也将ma...
  • guyongqiangx
  • guyongqiangx
  • 2016年09月17日 21:18
  • 2114

S3C6410移植u-boot-2010.3(1)成功编译的开始

u-boot-2010.03的移植 【实验目的】 了解U-boot-2010.03的代码结构及移植方法。 【实验环境】 1、 Ubuntu 10.10发行版 2、 u-boot-2010.03 3、 ...
  • xiangnengji
  • xiangnengji
  • 2014年02月20日 20:04
  • 323

基于三星S3C2410的开发板的u-boot编译过程理解

原文出处:http://www.cnblogs.com/heaad/archive/2010/07/17/1779806.html U-Boot编译过程完全分析 Posted on 201...
  • Melody_lu123
  • Melody_lu123
  • 2012年04月25日 21:49
  • 1333

移植u-boot-2011.03到S3C2440(utu2440)方法与步骤###1. 配置和初步编译

作者:reille本博客网址:http://blog.csdn.net/reille/开发环境:主机:Window XP SP2;linux:VMware7.01+ubuntu9.10;目标板:扬创u...
  • reille
  • reille
  • 2011年06月12日 16:22
  • 14805

玩转S3C6410之二 s3c-u-boot-1.1.6配置、编译、链接分析(一)

tiny6410上采用的处理器是S3C6410,我们首先要做的是从网上下载三星公司针对s3c6410修改过的s3c-u-boot-1.1.6的源码,然后对这个源码进行分析,最后再将源码移植到tiny6...
  • xiaomeiqing
  • xiaomeiqing
  • 2011年11月28日 22:59
  • 4277

玩转S3C6410之二 s3c-u-boot-1.1.6配置、编译、链接分析(二)

3、uboot的编译、链接过程     分析完了配置的命令make smdk6410_config,接下来分析下make all是如何进行编译和链接的。     首先对整个Makefile进行分析...
  • xiaomeiqing
  • xiaomeiqing
  • 2011年12月11日 11:06
  • 3207

u-boot在S3C2410移植

  • 2009年07月18日 13:58
  • 61KB
  • 下载

Eclipse+Jlink调试u-boot 2013-3-13

  • 2013年11月01日 23:04
  • 1.21MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:u-boot 3、编译
举报原因:
原因补充:

(最多只允许输入30个字)