最新linux内核makefile分析,linux4.9.78内核Makefile分析

linux4.9.78内核Makefile分析(自用)

1、顶层Makefile:

534

include arch/$(SRCARCH)/Makefile

344

include scripts/Kbuild.include

558

init-y:= init/

init-y := $(patsubst %/, %/built-in.o, $(init-y))

core-y+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/

drivers-y:= drivers/ sound/ firmware/

libs-y:= lib/

vmlinux-dirs:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \

$(core-y) $(core-m) $(drivers-y) $(drivers-m) \

$(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))

407

# Read KERNELRELEASE from include/config/kernel.release (if it exists)

476

version_h := include/generated/uapi/linux/version.h

old_version_h := include/linux/version.h

1033

prepare1: prepare2 $(version_h) include/generated/utsrelease.h \

include/config/auto.conf

975

vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE

+$(call if_changed,link-vmlinux)

export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)

export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(virt-y)

export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds

946

vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN)

2、arch/arm/Makefile

328

$(BOOT_TARGETS): vmlinux

$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@

@$(kecho) ' Kernel: $(boot)/$@ is ready'

137

head-y:= arch/arm/kernel/head$(MMUEXT).o

3、Kbuild.include

179:

# $(Q)$(MAKE) $(build)=dir

build := -f $(srctree)/scripts/Makefile.build obj

4、scripst/Makefile.build

cmd_link_o_target = $(if $(strip $(obj-y)),\

$(cmd_make_builtin) $@ $(filter $(obj-y), $^) \

$(cmd_secanalysis),\

$(cmd_make_empty_builtin) $@)

cmd_make_builtin = $(LD) $(ld_flags) -r -o

PHONY += $(subdir-ym)

$(subdir-ym):

$(Q)$(MAKE) $(build)=$@

来源:oschina

链接:https://my.oschina.net/u/4297704/blog/4580419

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值