uboot顶层 Makefile,就是 uboot源码工程的根目录下的 Makefile文件。
注意:是对编译后的 uboot 源码进行分析。
使用 vscode软件打开 uboot源码工程。打开 uboot 源码的顶层 Makefile文件。接下来大体了解一下 顶层 Makefile的内容。
- 5 VERSION = 2016
- 6 PATCHLEVEL = 03
- 7 SUBLEVEL =
- 8 EXTRAVERSION =
- 9 NAME =
涉及 MAKEFLAGS变量的内容如下:
20 MAKEFLAGS += -rR --include-dir=$(CURDIR)
- wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/uboot/alientek_uboot/uboot-imx-rel_imx_4.1.15_2.1.0_ga_alientek$ make
- CLEAN examples/standalone
- CLEAN tools
- CLEAN tools/lib tools/common
- CLEAN include/bmp_logo.h include/bmp_logo_data.h u-boot-nodtb.bin u-boot.lds u-boot.map u-boot.bin u-boot.cfg u-boot.srec u-boot u-boot.imx u-boot.sym System.map
wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/uboot/alientek_uboot/uboot-imx-rel_imx_4.1.15_2.1.0_ga_alientek$ make V=1
make -f ./Makefile silentoldconfig
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
- 73 ifeq ("$(origin V)", "command line")
- 74 KBUILD_VERBOSE = $(V)
- 75 endif
- 76 ifndef KBUILD_VERBOSE
- 77 KBUILD_VERBOSE = 0
- 78 endif
- 79
- 80 ifeq ($(KBUILD_VERBOSE),1)
- 81 quiet =
- 82 Q =
- 83 else
- 84 quiet=quiet_
- 85 Q = @
- 86 endif
- 88 # If the user is running make -s (silent mode), suppress echoing of
- 89 # commands
- 90
- 91 ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
- 92 ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
- 93 quiet=silent_
- 94 endif
- 95 else # make-3.8x
- 96 ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
- 97 quiet=silent_
- 98 endif
- 99 endif
- 100
- 101 export quiet Q KBUILD_VERBOSE
- 120 ifeq ($(KBUILD_SRC),)
- 121
- 122 # OK, Make called in directory where kernel src resides
- 123 # Do we want to locate output files in a separate directory?
- 124 ifeq ("$(origin O)", "command line")
- 125 KBUILD_OUTPUT := $(O)
- 126 endif
- 127
- 128 # That's our default target when none is given on the command line
- 129 PHONY := _all
- 130 _all:
- 131
- 132 # Cancel implicit rules on top Makefile
- 133 $(CURDIR)/Makefile Makefile: ;
- 134
- 135 ifneq ($(KBUILD_OUTPUT),)
- 136 # Invoke a second make in the output directory, passing relevant
- variables
- 137 # check that the output directory actually exists
- 138 saved-output := $(KBUILD_OUTPUT)
- 139 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd
- $(KBUILD_OUTPUT) \
- 140 && /bin/pwd)
- ......
- 155 endif # ifneq ($(KBUILD_OUTPUT),)
- 156 endif # ifeq ($(KBUILD_SRC),)