Boot 顶层Makefile解析(3)

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


ifeq ($(OBJTREE)/include/config.mk,$(wildcard $(OBJTREE)/include/config.mk))
# $(OBJTREE)/include/config.mk           
# $(wildcard $(OBJTREE)/include/config.mk)
# $(wildcard pattern) 参数pattern是一个文件名格式(可使用通配符)
# 这个函数的结果是一列和格式匹配且真实存在的文件的名称 文件名之间用空格符隔开
# 那  这句的意思是啥 

# load ARCH, BOARD, and CPU configuration #加载这些配置
include $(OBJTREE)/include/config.mk  #把/include/config.mk包含进工程中     
export ARCH CPU BOARD VENDOR SOC  #导出ARCH CPU BOARD VENDOR SOC


ifndef CROSS_COMPILE  #如果没有定义交叉编译工具
ifeq ($(HOSTARCH),ppc)  #如果他俩一样
CROSS_COMPILE =   #交叉编译工具为空
else    #else
ifeq ($(ARCH),ppc)  #
CROSS_COMPILE = powerpc-linux- #
endif    #
ifeq ($(ARCH),arm)  #
CROSS_COMPILE = arm-linux- #我们要用的交叉编译工具arm-linux-是前缀
endif    #
ifeq ($(ARCH),i386)  #
ifeq ($(HOSTARCH),i386)  #为啥这两个要这样
CROSS_COMPILE =   #
else    #
CROSS_COMPILE = i386-linux- #
endif    #
endif    #
ifeq ($(ARCH),mips)  #
CROSS_COMPILE = mips_4KC- #
endif    #
ifeq ($(ARCH),nios)  #
CROSS_COMPILE = nios-elf- #
endif    #
ifeq ($(ARCH),nios2)  #
CROSS_COMPILE = nios2-elf- #
endif    #
ifeq ($(ARCH),m68k)  #
CROSS_COMPILE = m68k-elf- #
endif    #
ifeq ($(ARCH),microblaze) #
CROSS_COMPILE = mb-  #
endif    #
ifeq ($(ARCH),blackfin)  #
CROSS_COMPILE = bfin-elf- #
endif    #
ifeq ($(ARCH),avr32)  #
CROSS_COMPILE = avr32-  #avr32都来了?
endif    #
endif    #
endif    #


export CROSS_COMPILE  #export CROSS_COMPILE


# load other configuration #加载其他配置
include $(TOPDIR)/config.mk #位于$(TOPDIR)/config.mk

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ad00de73f80fc7c227f48d502e9657da.html