Makefile_linux-2.6.35.2.new.doc

上传人:bao****ty 文档编号:144597199 上传时间:2020-09-11 格式:DOC 页数:45 大小:51.52KB
返回 下载 相关 举报
Makefile_linux-2.6.35.2.new.doc_第1页
第1页 / 共45页
Makefile_linux-2.6.35.2.new.doc_第2页
第2页 / 共45页
Makefile_linux-2.6.35.2.new.doc_第3页
第3页 / 共45页
Makefile_linux-2.6.35.2.new.doc_第4页
第4页 / 共45页
Makefile_linux-2.6.35.2.new.doc_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《Makefile_linux-2.6.35.2.new.doc》由会员分享,可在线阅读,更多相关《Makefile_linux-2.6.35.2.new.doc(45页珍藏版)》请在金锄头文库上搜索。

1、VERSION = 2PATCHLEVEL = 6SUBLEVEL = 35EXTRAVERSION = .2NAME = Sheep on Meth# *DOCUMENTATION*# To see a list of typical targets execute make help# More info can be located in ./README# Comments in this file are targeted only to the developer, do not# expect to learn how to build the kernel reading th

2、is file.# Do not:# o use makes built-in rules and variables# (this increases performance and avoids hard-to-debug behaviour);# o print Entering directory .;MAKEFLAGS += -rR -no-print-directory# Avoid funny character set dependenciesunexport LC_ALLLC_COLLATE=CLC_NUMERIC=Cexport LC_COLLATE LC_NUMERIC#

3、 We are using a recursive build, so we need to do a little thinking# to get the ordering right.# Most importantly: sub-Makefiles should only ever modify files in# their own directory. If in some directory we have a dependency on# a file in another dir (which doesnt happen often, but its often# unavo

4、idable when linking the built-in.o targets which finally# turn into vmlinux), we will call a sub make in that other dir, and# after that we are sure that everything which is in that other dir# is now up to date.# The only cases where we need to modify files which have global# effects are thus separa

5、ted out and done before the recursive# descending is started. They are now explicitly listed as the# prepare rule.# To put more focus on warnings, be less verbose as default# Use make V=1 to see the full commandsifeq ($(origin V), command line)KBUILD_VERBOSE = $(V)endififndef KBUILD_VERBOSEKBUILD_VE

6、RBOSE = 0endif# Call a source code checker (by default, sparse) as part of the# C compilation.# Use make C=1 to enable checking of only re-compiled files.# Use make C=2 to enable checking of *all* source files, regardless# of whether they are re-compiled or not.# See the file Documentation/sparse.tx

7、t for more details, including# where to get the sparse utility.ifeq ($(origin C), command line)KBUILD_CHECKSRC = $(C)endififndef KBUILD_CHECKSRCKBUILD_CHECKSRC = 0endif# Use make M=dir to specify directory of external module to build# Old syntax make . SUBDIRS=$PWD is still supported# Setting the en

8、vironment variable KBUILD_EXTMOD take precedenceifdef SUBDIRSKBUILD_EXTMOD ?= $(SUBDIRS)endififeq ($(origin M), command line)KBUILD_EXTMOD := $(M)endif# kbuild supports saving output files in a separate directory.# To locate output files in a separate directory two syntaxes are supported.# In both c

9、ases the working directory must be the root of the kernel src.# 1) O=# Use make O=dir/to/store/output/files/# 2) Set KBUILD_OUTPUT# Set the environment variable KBUILD_OUTPUT to point to the directory# where the output files shall be placed.# export KBUILD_OUTPUT=dir/to/store/output/files/# make# Th

10、e O= assignment takes precedence over the KBUILD_OUTPUT environment# variable.# KBUILD_SRC is set on invocation of make in OBJ directory# KBUILD_SRC is not intended to be used by the regular user (for now)ifeq ($(KBUILD_SRC),)# OK, Make called in directory where kernel src resides# Do we want to loc

11、ate output files in a separate directory?ifeq ($(origin O), command line)KBUILD_OUTPUT := $(O)endif# Thats our default target when none is given on the command linePHONY := _all_all:# Cancel implicit rules on top Makefile$(CURDIR)/Makefile Makefile: ;ifneq ($(KBUILD_OUTPUT),)# Invoke a second make i

12、n the output directory, passing relevant variables# check that the output directory actually existssaved-output := $(KBUILD_OUTPUT)KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) & /bin/pwd)$(if $(KBUILD_OUTPUT), $(error output directory $(saved-output) does not exist)PHONY += $(MAKECMDGOALS) sub-make$

13、(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS) _all: sub-make$(Q):sub-make: FORCE$(if $(KBUILD_VERBOSE:1=),)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) KBUILD_EXTMOD=$(KBUILD_EXTMOD) -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)# Leave processing to above invoc

14、ation of makeskip-makefile := 1endif # ifneq ($(KBUILD_OUTPUT),)endif # ifeq ($(KBUILD_SRC),)# We process the rest of the Makefile if this is the final invocation of makeifeq ($(skip-makefile),)# If building an external module we do not care about the all: rule# but instead _all depend on modulesPHO

15、NY += allifeq ($(KBUILD_EXTMOD),)_all: allelse_all: modulesendifsrctree:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)objtree:= $(CURDIR)src:= $(srctree)obj:= $(objtree)VPATH:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)export srctree objtree VPATH# SUBARCH tells the usermode build what the underlying arch is. That is set# first, and if a usermode build is happening, the ARCH=um on the command

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号