./Kbuild 分析

# make -f ./scripts/Makefile.build obj=.
# ./Kbuild 
1 	# SPDX-License-Identifier: GPL-2.0
2 	#
3 	# Kbuild for top-level directory of U-Boot
4 
5 	#####
6 	# Generate generic-asm-offsets.h
7 
8 	generic-offsets-file := include/generated/generic-asm-offsets.h
9 
10	always  := $(generic-offsets-file)
11	targets := lib/asm-offsets.s
12
13	CFLAGS_REMOVE_asm-offsets.o := $(LTO_CFLAGS)
14
15	$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
16		$(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
17
18	#####
19	# Generate asm-offsets.h
20
21	ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
22	offsets-file := include/generated/asm-offsets.h
23	endif
24
25	always  += $(offsets-file)
26	targets += arch/$(ARCH)/lib/asm-offsets.s
27
28	CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
29
30	$(obj)/$(offsets-file): $(obj)/arch/$(ARCH)/lib/asm-offsets.s FORCE
31		$(call filechk,offsets,__ASM_OFFSETS_H__)
32
  1. 13行:在顶层Makefile中定义:$(LTO_CFLAGS):=
  2. 21行:在顶层Makefile中定义:$(srctree)=.,在输入命令行中定义:$(ARCH)=arm
    $(srctree)/arch/$(ARCH)/lib/asm-offsets.c文件在源码中存在,所以这里条件成立


最终展开后为:

# make -f ./scripts/Makefile.build obj=.
# ./Kbuild 
CFLAGS_REMOVE_asm-offsets.o := 
CFLAGS_asm-offsets.o        := -DDO_DEPS_ONLY
targets = lib/asm-offsets.s  arch/arm/lib/asm-offsets.s

generic-offsets-file := include/generated/generic-asm-offsets.h
offsets-file         := include/generated/asm-offsets.h
always  = $(generic-offsets-file) $(offsets-file)

15	$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
16		$(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
17
30	$(obj)/$(offsets-file): $(obj)/arch/arm/lib/asm-offsets.s FORCE
31		$(call filechk,offsets,__ASM_OFFSETS_H__)

由上可知,创建目标前要先创建其依赖,所以:

  1. 创建$(obj)/$(generic-offsets-file),见下面《2.创建 $(obj)/$(generic-offsets-file)》, 回显 34
    1.1 创建$(obj)/lib/asm-offsets.s,见下面《1.创建 $(obj)/lib/asm-offsets.s》, 回显 33
  2. 创建$(obj)/$(offsets-file),见下面《4.创建 $(obj)/$(offsets-file)》, 回显 36
    2.1 创建$(obj)/arch/arm/lib/asm-offsets.s,见下面《3.创建 $(obj)/arch/arm/lib/asm-offsets.s》, 回显 35


最终:

  1. 打印和执行$(cmd_cc_s_c)命令,并将实现目标./lib/asm-offsets.s所用的命令、源码、头文件等信息全部写入到 ./lib/.asm-offsets.s.cmd 文件中。 回显 33
  2. 执行$(filechk_offsets)命令,并将执行后的结果写入include/generated/generic-asm-offsets.h 中, 回显 34
  3. 打印和执行$(cmd_cc_s_c)命令,并将实现目标./arch/arm/lib/asm-offsets.s所用的命令、源码、头文件等信息全部写入到 ./arch/arm/lib/.asm-offsets.s.cmd文件中。 回显 35
  4. 执行$(filechk_offsets)命令,并将执行后的结果写入include/generated/asm-offsets.h 中, 回显 36


回显 33-36

33	  /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc -Wp,-MD,lib/.asm-offsets.s.d  -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -mtune=generic-armv7-a -I./arch/arm/mach-bcm283x/include -DDO_DEPS_ONLY    -DKBUILD_BASENAME='"asm_offsets"'  -DKBUILD_MODNAME='"asm_offsets"'  -fverbose-asm -S -o lib/asm-offsets.s lib/asm-offsets.c
34	set -e; mkdir -p include/generated/; 	(set -e; echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; echo "#define __GENERIC_ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < lib/asm-offsets.s > include/generated/generic-asm-offsets.h.tmp; if [ -r include/generated/generic-asm-offsets.h ] && cmp -s include/generated/generic-asm-offsets.h include/generated/generic-asm-offsets.h.tmp; then rm -f include/generated/generic-asm-offsets.h.tmp; else : '  UPD     include/generated/generic-asm-offsets.h'; mv -f include/generated/generic-asm-offsets.h.tmp include/generated/generic-asm-offsets.h; fi
35	  /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc -Wp,-MD,arch/arm/lib/.asm-offsets.s.d  -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -mtune=generic-armv7-a -I./arch/arm/mach-bcm283x/include -DDO_DEPS_ONLY    -DKBUILD_BASENAME='"asm_offsets"'  -DKBUILD_MODNAME='"asm_offsets"'  -fverbose-asm -S -o arch/arm/lib/asm-offsets.s arch/arm/lib/asm-offsets.c
36	set -e; mkdir -p include/generated/; 	(set -e; echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < arch/arm/lib/asm-offsets.s > include/generated/asm-offsets.h.tmp; if [ -r include/generated/asm-offsets.h ] && cmp -s include/generated/asm-offsets.h include/generated/asm-offsets.h.tmp; then rm -f include/generated/asm-offsets.h.tmp; else : '  UPD     include/generated/asm-offsets.h'; mv -f include/generated/asm-offsets.h.tmp include/generated/asm-offsets.h; fi

创建:
创建 ./lib/asm-offsets.s 回显 33
创建 ./lib/.asm-offsets.s.cmd 回显 33
创建 include/generated/generic-asm-offsets.h 回显 34
创建 ./arch/arm/lib/asm-offsets.s 回显 35
创建 ./arch/arm/lib/.asm-offsets.s.cmd 回显 35
创建 include/generated/asm-offsets.h 回显 36

1. 创建 $(obj)/lib/asm-offsets.s

scripts/Makefile.build中有如下创建规则:

# scripts/Makefile.build
152 cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
153 
154 $(obj)/%.s: $(src)/%.c FORCE
155 	$(call if_changed_dep,cc_s_c)
  1. 在顶层Makefile中, $(CC) = /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc
  2. $(DISABLE_LTO)未定义为空
  3. $(c_flags)最终定义如下:
$(KBUILD_CPPFLAGS)       = -D__KERNEL__ -D__UBOOT__
$(KBUILD_CFLAGS)         = -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time 
$(KBUILD_SUBDIR_CCFLAGS) =$(ccflags-y)             = -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe $(arch-y) $(tune-y) $(patsubst %,-I$(srctree)/%include,$(machdirs))
$(CFLAGS_$(basetarget).o)= $(CFLAGS_$(basename $(notdir $@)).o)

$(depfile)       = $(dir $@).$(notdir $@).d
$(NOSTDINC_FLAGS)= -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include
$(UBOOTINCLUDE)  = -Iinclude -I$(srctree)/arch/$(ARCH)/include -include $(srctree)/include/linux/kconfig.h
$(__c_flags)     = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
$(modkern_cflags)=$(basename_flags)= -DKBUILD_BASENAME='"$(subst -,_$(basename $(notdir $@)))"'
$(modname_flags) = -DKBUILD_MODNAME='"$(subst -,_$(basename $(notdir $@)))"'
                   
c_flags = -Wp,-MD,$(depfile)  $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) $(__c_flags) $(modkern_cflags) $(basename_flags) $(modname_flags)

目标的依赖$(src)/%.c在源码中已存在,接下来执行目标的创建命令即可。 回显 33


最终:《if_changed_dep 函数》分析可知:
打印和执行$(cmd_cc_s_c)命令,并将实现目标./lib/asm-offsets.s所用的命令、源码、头文件等信息全部写入到 ./lib/.asm-offsets.s.cmd 文件中。 回显 33


回显 33

33   /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc -Wp,-MD,lib/.asm-offsets.s.d  -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -mtune=generic-armv7-a -I./arch/arm/mach-bcm283x/include -DDO_DEPS_ONLY    -DKBUILD_BASENAME='"asm_offsets"'  -DKBUILD_MODNAME='"asm_offsets"'  -fverbose-asm -S -o lib/asm-offsets.s lib/asm-offsets.c

创建:
创建 ./lib/asm-offsets.s 回显 33
创建 ./lib/.asm-offsets.s.cmd 回显 33

2. 创建 $(obj)/$(generic-offsets-file)

# make -f ./scripts/Makefile.build obj=.
# scripts/Makefile.lib
define filechk_offsets
	(set -e; \
	 echo "#ifndef $2"; \
	 echo "#define $2"; \
	 echo "/*"; \
	 echo " * DO NOT MODIFY."; \
	 echo " *"; \
	 echo " * This file was generated by Kbuild"; \
	 echo " */"; \
	 echo ""; \
	 sed -ne $(sed-offsets); \
	 echo ""; \
	 echo "#endif" )
endef

# ./Kbuild 
generic-offsets-file := include/generated/generic-asm-offsets.h

15	$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
16		$(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)

目标的依赖$(obj)/lib/asm-offsets.s,执行《1.创建 $(obj)/lib/asm-offsets.s》时已创建,接下来执行目标的创建语句即可。 回显 34


最终:《filechk 函数》分析可知:
执行$(filechk_offsets)命令,并将执行后的结果写入include/generated/generic-asm-offsets.h 中,其内容如下: 回显 34

1 	#ifndef __GENERIC_ASM_OFFSETS_H__
2 	#define __GENERIC_ASM_OFFSETS_H__
3 	/*
4 	 * DO NOT MODIFY.
5 	 *
6 	 * This file was generated by Kbuild
7 	 */
8 
9 	#define GENERATED_GBL_DATA_SIZE 240 /* (sizeof(struct global_data) + 15) & ~15	@ */
10	#define GENERATED_BD_INFO_SIZE 80 /* (sizeof(struct bd_info) + 15) & ~15	@ */
11	#define GD_SIZE 232 /* sizeof(struct global_data)	@ */
12	#define GD_BD 0 /* offsetof(struct global_data, bd)	@ */
13	#define GD_MALLOC_BASE 164 /* offsetof(struct global_data, malloc_base)	@ */
14	#define GD_RELOCADDR 60 /* offsetof(struct global_data, relocaddr)	@ */
15	#define GD_RELOC_OFF 80 /* offsetof(struct global_data, reloc_off)	@ */
16	#define GD_START_ADDR_SP 76 /* offsetof(struct global_data, start_addr_sp)	@ */
17	#define GD_NEW_GD 84 /* offsetof(struct global_data, new_gd)	@ */
18	#define GD_ENV_ADDR 36 /* offsetof(struct global_data, env_addr)	@ */
19
20	#endif

回显 34

34 set -e; mkdir -p include/generated/; 	(set -e; echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; echo "#define __GENERIC_ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < lib/asm-offsets.s > include/generated/generic-asm-offsets.h.tmp; if [ -r include/generated/generic-asm-offsets.h ] && cmp -s include/generated/generic-asm-offsets.h include/generated/generic-asm-offsets.h.tmp; then rm -f include/generated/generic-asm-offsets.h.tmp; else : '  UPD     include/generated/generic-asm-offsets.h'; mv -f include/generated/generic-asm-offsets.h.tmp include/generated/generic-asm-offsets.h; fi

创建:
创建 include/generated/generic-asm-offsets.h 回显 34

3. 创建 $(obj)/arch/arm/lib/asm-offsets.s

scripts/Makefile.build中有如下创建规则:

# scripts/Makefile.build
152 cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
153 
154 $(obj)/%.s: $(src)/%.c FORCE
155 	$(call if_changed_dep,cc_s_c)
  1. 在顶层Makefile中, $(CC) = /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc
  2. $(DISABLE_LTO)未定义为空
  3. $(c_flags)最终定义如下:
$(KBUILD_CPPFLAGS)       = -D__KERNEL__ -D__UBOOT__
$(KBUILD_CFLAGS)         = -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time 
$(KBUILD_SUBDIR_CCFLAGS) =$(ccflags-y)             = -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe $(arch-y) $(tune-y) $(patsubst %,-I$(srctree)/%include,$(machdirs))
$(CFLAGS_$(basetarget).o)= $(CFLAGS_$(basename $(notdir $@)).o)

$(depfile)       = $(dir $@).$(notdir $@).d
$(NOSTDINC_FLAGS)= -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include
$(UBOOTINCLUDE)  = -Iinclude -I$(srctree)/arch/$(ARCH)/include -include $(srctree)/include/linux/kconfig.h
$(__c_flags)     = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
$(modkern_cflags)=$(basename_flags)= -DKBUILD_BASENAME='"$(subst -,_$(basename $(notdir $@)))"'
$(modname_flags) = -DKBUILD_MODNAME='"$(subst -,_$(basename $(notdir $@)))"'
                   
c_flags = -Wp,-MD,$(depfile)  $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) $(__c_flags) $(modkern_cflags) $(basename_flags) $(modname_flags)

目标的依赖$(src)/%.c在源码中已存在,接下来执行目标的创建命令即可。 回显 35


最终:《if_changed_dep 函数》分析可知:
打印和执行$(cmd_cc_s_c)命令,并将实现目标./arch/arm/lib/asm-offsets.s所用的命令、源码、头文件等信息全部写入到 ./arch/arm/lib/.asm-offsets.s.cmd文件中。 回显 35


回显 35

35 /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc -Wp,-MD,arch/arm/lib/.asm-offsets.s.d  -nostdinc -isystem /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/include -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -mtune=generic-armv7-a -I./arch/arm/mach-bcm283x/include -DDO_DEPS_ONLY    -DKBUILD_BASENAME='"asm_offsets"'  -DKBUILD_MODNAME='"asm_offsets"'  -fverbose-asm -S -o arch/arm/lib/asm-offsets.s arch/arm/lib/asm-offsets.c

创建:
创建 ./arch/arm/lib/asm-offsets.s 回显 35
创建 ./arch/arm/lib/.asm-offsets.s.cmd 回显 35

4. 创建 $(obj)/$(offsets-file)

# make -f ./scripts/Makefile.build obj=.
# scripts/Makefile.lib
define filechk_offsets
	(set -e; \
	 echo "#ifndef $2"; \
	 echo "#define $2"; \
	 echo "/*"; \
	 echo " * DO NOT MODIFY."; \
	 echo " *"; \
	 echo " * This file was generated by Kbuild"; \
	 echo " */"; \
	 echo ""; \
	 sed -ne $(sed-offsets); \
	 echo ""; \
	 echo "#endif" )
endef

# ./Kbuild 
offsets-file := include/generated/asm-offsets.h

30	$(obj)/$(offsets-file): $(obj)/arch/arm/lib/asm-offsets.s FORCE
31		$(call filechk,offsets,__ASM_OFFSETS_H__)

目标的依赖$(obj)/arch/arm/lib/asm-offsets.s,在执行《3.创建 $(obj)/arch/arm/lib/asm-offsets.s》时已创建,接下来执行目标的创建语句即可。 回显 36

最终:《filechk 函数》分析可知:
执行$(filechk_offsets)命令,并将执行后的结果写入include/generated/asm-offsets.h 中,其内容如下: 回显 36

1 	#ifndef __ASM_OFFSETS_H__
2 	#define __ASM_OFFSETS_H__
3 	/*
4 	 * DO NOT MODIFY.
5 	 *
6 	 * This file was generated by Kbuild
7 	 */
8 
9 
10	#endif

回显 36

36 set -e; mkdir -p include/generated/; 	(set -e; echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < arch/arm/lib/asm-offsets.s > include/generated/asm-offsets.h.tmp; if [ -r include/generated/asm-offsets.h ] && cmp -s include/generated/asm-offsets.h include/generated/asm-offsets.h.tmp; then rm -f include/generated/asm-offsets.h.tmp; else : '  UPD     include/generated/asm-offsets.h'; mv -f include/generated/asm-offsets.h.tmp include/generated/asm-offsets.h; fi

创建:
创建 include/generated/asm-offsets.h 回显 36

  • 10
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值