$(MAKE) -f scripts/Makefile.build obj=$(build-dir) [para] Make进入由参数-f指定的Make文件scripts/Makefile.build,并传入参数 obj=$(build-dir)和para。 在scripts/Makefile.build的处理过程中,$(obj)代表此次Make命令要处理(编译、链接、和生成)文件所在的目录,该目录下的Makefile文件通常情况下都会被Ma...
$(MAKE) $(build)=$(build-dir) [para] 其中[para] 可选。使用scripts/Kbuild.include中的$(build)变量定义,进行变量替换,上述命令被展开为: $(MAKE) -f scripts/Makefile.build obj=$(build-dir) [para] Make进入由参数-f指定的Make文件scripts/Makefile.build,并传入参数 obj=$(build-dir)和para。
指定输出目录有两种方法,分别为make O=dir或者export BUILD_DIR=dir。两种方式指定如果没有指定,则设定为源码的根目录。 By default the build is performed locally and the objects are savedinthe source directory. One of the two methods can be used to change this behavior and build U-Boot to some ...
generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_builddir)/src/include/utils/probes.h $(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h # fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on # the timestamps of the individual output...
SRCS_DIR = src # 头文件目录 INCS_DIR = inc # 编译输出目录 BUILD_DIR = build # 源文件 SRCS = $(wildcard $(SRCS_DIR)/*.c) # 头文件 INCS = $(wildcard $(INCS_DIR)/*.h) # 目标文件 OBJS = $(patsubst %.c, $(BUILD_DIR)/%.o, $(notdir $(SRCS))) ...
当我们执行make或make all时,就开始生成all目标,其依赖于BUILD_DIR(GCC/build)目录中的TARGET(Huawei_LiteOS).elf文件,BUILD_DIR和TARGET为两个变量,一开始就被赋值,如下图所示,实际使用时$(变量)会被替换为变量的值,例如$(TARGET).elf最终会被替换为Huawei_LiteOS.elf。 可是Huawei_LiteOS.elf还不存在,make...
Makefile中内置了一些常用的命令,有字符串处理函数subst、patsubst、strip、findstring、filter、filter-out、sort、word、wordlist、words、firstword、lastword;文件名处理函数dir、notdir、suffix、basename、addsuffix、addprefix、join、wildcard、realpath、abspath;条件处理函数if;循环处理函数foreach等。下面介绍一些常用的...
make-f Makefile.build 我们可以使用“-C”选项指定目录,切换到其他目录里去,比如: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 make-Ca/-f Makefile.build 我们可以指定目标,不再默认生成第一个目标: 代码语言:javascript 代码运行次数:0
“Makefile”文件总是被“Makefile.build”包含的。 在Makefile.build 中设置编译规则,有 3 条编译规则: 怎么编译子目录? 进入子目录编译: $(subdir-y):make -C $@ -f $(TOPDIR)/Makefile.build 怎么编译当前目录中的文件? %.o : %.c$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -Wp,-MD...
INCS := $(CUR_DIR)/include CFLAGS := -Wall –I$(INCS)EXEF := foo bar .PHONY : all clean all : $(EXEF)foo : foo.c foo : CFLAGS+=-O2 bar : bar.c bar : CFLAGS+=-g ………..………..(EXEF) : debug.h (CC) $(CFLAGS) $(addsuffix .c,$@) –o clean :(...