Tina-linux 4.9
然后把出错的老sdk删了,新的放在D:\Embedded\Tutorial\100ASK_V853-PRO_V1.0_2023-03-31\07_Tina_SDK,并且把100ASK的patch打包成了tgz文件,这下以后就不用每次git clone了。
[u-boot解读之基于全志V3s]01顶层Makefile解析
1.xxx_defconf的解析
在573行
config: scripts_basic outputmakefile FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
%config: scripts_basic outputmakefile FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
可以看到,当我们执行 make LicheePi_Zero_defconfig时,会触发该规则.
可以看到后面有两个prerequisites:scripts_basic
,outputmakefile
,以及一个FORCE
,
这个FORCE是为了每次触发该规则都能执行这条命令,可以参考www.gnu.org:Force-Targets
1.1FORCE目标
在2483行:
PHONY += FORCE
FORCE:
# Declare the contents of the PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY)
可知FORCE是一个伪目标
1.2$(Q)是个什么?
在100行可以看到
ifeq ($(KBUILD_VERBOSE),1)
quiet =
Q =
else
quiet=quiet_
Q = @
endif
如果未设置KBUILD_VERBOSE环境变量为1,就会隐藏执行的指令
因此我们可以在分析脚本时,设置该环境变量来看具体执行了什么
在67行也有相应的原理分析:
# Beautify output
# ---------------------------------------------------------------------------
#
# Normally, we echo the whole command before executing it. By making
# that echo $($(quiet)$(cmd)), we now have the possibility to set
# $(quiet) to choose other forms of output instead, e.g.
#
# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
#
# If $(quiet) is empty, the whole command will be printed.
# If it is set to "quiet_", only the short version will be printed.
# If it is set to "silent_", nothing will be printed at all, since
# the variable $(silent_cmd_cc_o_c) doesn't exist.
#
# A simple variant is to prefix commands with $(Q) - that's useful
# for commands that shall be hidden in non-verbose mode.
#
# $(Q)ln $@ :<
#
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
# If KBUILD_VERBOSE equals 1 then the above command is displayed.
#
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
1.3scripts_basic目标
PHONY += scripts_basic
scripts_basic:
$(Q)$(MAKE) $(build)=scripts/basic
$(Q)rm -f .tmp_quiet_recordmcount
生成scripts/basic下的工具fixdep
1.4outputmakefile目标
PHONY += outputmakefile
# outputmakefile generates a Makefile in the output directory, if using a
# separate output directory. This allows convenient use of make in the
# output directory.
outputmakefile:
ifneq ($(KBUILD_SRC),)
$(Q)ln -fsn $(srctree) source
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
endif
如果KBUILD_SRC不为空,在该路径自动生成Makefile(这个规则用不到)
综上所述,%config规则将传入的LicheePi_Zero_defconfig传给scripts/kconfig的Makefile并执行
1.5 kconfig下的Menuconfig
来到第95行
%_defconfig: $(obj)/conf
$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
这调用了刚才在Kconfig下由conf.c生成的工具conf,来生成
完整命令如下:
scripts/kconfig/conf --defconfig=arch/../configs/LicheePi_Zero_defconfig Kconfig
至于$SRCARCH又是什么
位于第九行
# Added for U-Boot
# Linux has defconfig files in arch/$(SRCARCH)/configs/,
# on the other hand, U-Boot does in configs/.
# Set SRCARCH to .. fake this Makefile.
SRCARCH := ..
原来u-boot项目是仿照linux仓库的结构的,但是u-boot不需要把defconfig放在每个arch目录下
conf.c中生成defconfig
第664行
case defconfig:
conf_set_all_new_symbols(def_default);
然后conf_set_all_new_symbols在scripts/kconfig/confdata
文件中定义,感兴趣的读者可以继续深入,但由于篇幅限制,仅用知道整个过程是往u-boot顶级目录里写入.config文件
2.直接运行make命令
2.1第一个目标
第147行
# That's our default target when none is given on the command line
PHONY := _all
_all:
然后221行
# If building an external module we do not care about the all: rule
# but instead _all depend on modules
PHONY += all
ifeq ($(KBUILD_EXTMOD),)
_all: all
else
_all: modules
endif
默认依赖all目标
之后是1112行
# Timestamp file to make sure that binman always runs
.binman_stamp: $(INPUTS-y) FORCE
ifeq ($(CONFIG_BINMAN),y)
$(call if_changed,binman)
endif
@touch $@
all: .binman_stamp
all依赖.binman_stamp,又间接依赖了$(INPUTS-y)
INPUTS-y是什么呢
2.2 INPUTS-y目标
未完待续
[MasterSpark魔炮]代办清单
- 记得MT2492分压电阻30k 和910k 或许不能匹配FB的输入阻抗。
所以BOM记得配好3K 电阻之类的