uboot源代码学习-Makefile中的config.mk

111到112行 

# Load generated board configuration
sinclude $(OBJTREE)/include/autoconf.mk

autoconf.mk是配置时生成的,里面有很多宏和变量。其来源于/include/configs/*.h。

142到149行

ifndef LDSCRIPT
#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
ifeq ($(CONFIG_NAND_U_BOOT),y)
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
else
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
endif
endif

这几行代码确定了链接脚本。

239到256行

ifndef REMOTE_BUILD

%.s:	%.S
	$(CPP) $(AFLAGS) -o $@ $<
%.o:	%.S
	$(CC) $(AFLAGS) -c -o $@ $<
%.o:	%.c
	$(CC) $(CFLAGS) -c -o $@ $<

else

$(obj)%.s:	%.S
	$(CPP) $(AFLAGS) -o $@ $<
$(obj)%.o:	%.S
	$(CC) $(AFLAGS) -c -o $@ $<
$(obj)%.o:	%.c
	$(CC) $(CFLAGS) -c -o $@ $<
endif

$@代表目标,$<代表依赖。这是自动推导规则。

猜你喜欢

转载自blog.csdn.net/weixin_42741158/article/details/82114615