文章目录
# 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
- 13行:在顶层Makefile中定义:
$(LTO_CFLAGS):=
- 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__)
由上可知,创建目标前要先创建其依赖,所以:
- 创建
$(obj)/$(generic-offsets-file)
,见下面《2.创建 $(obj)/$(generic-offsets-file)》, 回显 34
1.1 创建$(obj)/lib/asm-offsets.s
,见下面《1.创建 $(obj)/lib/asm-offsets.s》, 回显 33- 创建
$(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
最终:
- 打印和执行
$(cmd_cc_s_c)
命令,并将实现目标./lib/asm-offsets.s
所用的命令、源码、头文件等信息全部写入到./lib/.asm-offsets.s.cmd
文件中。 回显 33- 执行
$(filechk_offsets)
命令,并将执行后的结果写入include/generated/generic-asm-offsets.h
中, 回显 34- 打印和执行
$(cmd_cc_s_c)
命令,并将实现目标./arch/arm/lib/asm-offsets.s
所用的命令、源码、头文件等信息全部写入到./arch/arm/lib/.asm-offsets.s.cmd
文件中。 回显 35- 执行
$(filechk_offsets)
命令,并将执行后的结果写入include/generated/asm-offsets.h
中, 回显 36
回显 33-3633 /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)
- 在顶层Makefile中, $(CC) = /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc
$(DISABLE_LTO)
未定义为空$(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
回显 3333 /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
中,其内容如下: 回显 341 #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)
- 在顶层Makefile中, $(CC) = /home/xd/rpi3b/toolchain/toolchain-rpi32b/bin/arm-linux-gnueabihf-gcc
$(DISABLE_LTO)
未定义为空$(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
回显 3535 /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
中,其内容如下: 回显 361 #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