diff options
| author | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 03:35:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 03:35:51 -0400 |
| commit | ef88b7dba2b47c70037a34a599d383462bb74bd3 (patch) | |
| tree | f50afe82c446cbf93893880878b97339fbdb8f49 | |
| parent | f65e77693aa5a1cf688fc378bc6913a56f9ff7b7 (diff) | |
| parent | aaebf4332018980fef4e601d1b5a6e52dd9e9ae4 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
35 files changed, 547 insertions, 291 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 2616a58a5a4b..9a1586590d82 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
| @@ -872,7 +872,13 @@ When kbuild executes the following steps are followed (roughly): | |||
| 872 | Assignments to $(targets) are without $(obj)/ prefix. | 872 | Assignments to $(targets) are without $(obj)/ prefix. |
| 873 | if_changed may be used in conjunction with custom commands as | 873 | if_changed may be used in conjunction with custom commands as |
| 874 | defined in 6.7 "Custom kbuild commands". | 874 | defined in 6.7 "Custom kbuild commands". |
| 875 | |||
| 875 | Note: It is a typical mistake to forget the FORCE prerequisite. | 876 | Note: It is a typical mistake to forget the FORCE prerequisite. |
| 877 | Another common pitfall is that whitespace is sometimes | ||
| 878 | significant; for instance, the below will fail (note the extra space | ||
| 879 | after the comma): | ||
| 880 | target: source(s) FORCE | ||
| 881 | #WRONG!# $(call if_changed, ld/objcopy/gzip) | ||
| 876 | 882 | ||
| 877 | ld | 883 | ld |
| 878 | Link target. Often LDFLAGS_$@ is used to set specific options to ld. | 884 | Link target. Often LDFLAGS_$@ is used to set specific options to ld. |
| @@ -109,10 +109,9 @@ $(if $(KBUILD_OUTPUT),, \ | |||
| 109 | .PHONY: $(MAKECMDGOALS) | 109 | .PHONY: $(MAKECMDGOALS) |
| 110 | 110 | ||
| 111 | $(filter-out _all,$(MAKECMDGOALS)) _all: | 111 | $(filter-out _all,$(MAKECMDGOALS)) _all: |
| 112 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ | 112 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
| 113 | KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \ | 113 | KBUILD_SRC=$(CURDIR) \ |
| 114 | KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \ | 114 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@ |
| 115 | -f $(CURDIR)/Makefile $@ | ||
| 116 | 115 | ||
| 117 | # Leave processing to above invocation of make | 116 | # Leave processing to above invocation of make |
| 118 | skip-makefile := 1 | 117 | skip-makefile := 1 |
| @@ -233,7 +232,7 @@ ifeq ($(MAKECMDGOALS),) | |||
| 233 | KBUILD_MODULES := 1 | 232 | KBUILD_MODULES := 1 |
| 234 | endif | 233 | endif |
| 235 | 234 | ||
| 236 | export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE | 235 | export KBUILD_MODULES KBUILD_BUILTIN |
| 237 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD | 236 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD |
| 238 | 237 | ||
| 239 | # Beautify output | 238 | # Beautify output |
| @@ -309,6 +308,9 @@ cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ | |||
| 309 | # Look for make include files relative to root of kernel src | 308 | # Look for make include files relative to root of kernel src |
| 310 | MAKEFLAGS += --include-dir=$(srctree) | 309 | MAKEFLAGS += --include-dir=$(srctree) |
| 311 | 310 | ||
| 311 | # We need some generic definitions | ||
| 312 | include $(srctree)/scripts/Kbuild.include | ||
| 313 | |||
| 312 | # For maximum performance (+ possibly random breakage, uncomment | 314 | # For maximum performance (+ possibly random breakage, uncomment |
| 313 | # the following) | 315 | # the following) |
| 314 | 316 | ||
| @@ -348,7 +350,7 @@ LINUXINCLUDE := -Iinclude \ | |||
| 348 | 350 | ||
| 349 | CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) | 351 | CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) |
| 350 | 352 | ||
| 351 | CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ | 353 | CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
| 352 | -fno-strict-aliasing -fno-common \ | 354 | -fno-strict-aliasing -fno-common \ |
| 353 | -ffreestanding | 355 | -ffreestanding |
| 354 | AFLAGS := -D__ASSEMBLY__ | 356 | AFLAGS := -D__ASSEMBLY__ |
| @@ -367,11 +369,6 @@ export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | |||
| 367 | # even be read-only. | 369 | # even be read-only. |
| 368 | export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions | 370 | export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions |
| 369 | 371 | ||
| 370 | # The temporary file to save gcc -MD generated dependencies must not | ||
| 371 | # contain a comma | ||
| 372 | comma := , | ||
| 373 | depfile = $(subst $(comma),_,$(@D)/.$(@F).d) | ||
| 374 | |||
| 375 | # Files to ignore in find ... statements | 372 | # Files to ignore in find ... statements |
| 376 | 373 | ||
| 377 | RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg \) -prune -o | 374 | RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc -o -name .hg \) -prune -o |
| @@ -551,6 +548,26 @@ export KBUILD_IMAGE ?= vmlinux | |||
| 551 | # images. Default is /boot, but you can set it to other values | 548 | # images. Default is /boot, but you can set it to other values |
| 552 | export INSTALL_PATH ?= /boot | 549 | export INSTALL_PATH ?= /boot |
| 553 | 550 | ||
| 551 | # If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests | ||
| 552 | # and try to determine if the current source tree is a release tree, of any sort, | ||
| 553 | # or if is a pure development tree. | ||
| 554 | # | ||
| 555 | # A 'release tree' is any tree with a git TAG associated | ||
| 556 | # with it. The primary goal of this is to make it safe for a native | ||
| 557 | # git/CVS/SVN user to build a release tree (i.e, 2.6.9) and also to | ||
| 558 | # continue developing against the current Linus tree, without having the Linus | ||
| 559 | # tree overwrite the 2.6.9 tree when installed. | ||
| 560 | # | ||
| 561 | # Currently, only git is supported. | ||
| 562 | # Other SCMs can edit scripts/setlocalversion and add the appropriate | ||
| 563 | # checks as needed. | ||
| 564 | |||
| 565 | |||
| 566 | ifdef CONFIG_LOCALVERSION_AUTO | ||
| 567 | localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree)) | ||
| 568 | LOCALVERSION := $(LOCALVERSION)$(localversion-auto) | ||
| 569 | endif | ||
| 570 | |||
| 554 | # | 571 | # |
| 555 | # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory | 572 | # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory |
| 556 | # relocations required by build roots. This is not defined in the | 573 | # relocations required by build roots. This is not defined in the |
| @@ -691,8 +708,10 @@ endef | |||
| 691 | 708 | ||
| 692 | # Update vmlinux version before link | 709 | # Update vmlinux version before link |
| 693 | # Use + in front of this rule to silent warning about make -j1 | 710 | # Use + in front of this rule to silent warning about make -j1 |
| 711 | # First command is ':' to allow us to use + in front of this rule | ||
| 694 | cmd_ksym_ld = $(cmd_vmlinux__) | 712 | cmd_ksym_ld = $(cmd_vmlinux__) |
| 695 | define rule_ksym_ld | 713 | define rule_ksym_ld |
| 714 | : | ||
| 696 | +$(call cmd,vmlinux_version) | 715 | +$(call cmd,vmlinux_version) |
| 697 | $(call cmd,vmlinux__) | 716 | $(call cmd,vmlinux__) |
| 698 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd | 717 | $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd |
| @@ -722,6 +741,16 @@ quiet_cmd_kallsyms = KSYM $@ | |||
| 722 | # Needs to visit scripts/ before $(KALLSYMS) can be used. | 741 | # Needs to visit scripts/ before $(KALLSYMS) can be used. |
| 723 | $(KALLSYMS): scripts ; | 742 | $(KALLSYMS): scripts ; |
| 724 | 743 | ||
| 744 | # Generate some data for debugging strange kallsyms problems | ||
| 745 | debug_kallsyms: .tmp_map$(last_kallsyms) | ||
| 746 | |||
| 747 | .tmp_map%: .tmp_vmlinux% FORCE | ||
| 748 | ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@ | ||
| 749 | |||
| 750 | .tmp_map3: .tmp_map2 | ||
| 751 | |||
| 752 | .tmp_map2: .tmp_map1 | ||
| 753 | |||
| 725 | endif # ifdef CONFIG_KALLSYMS | 754 | endif # ifdef CONFIG_KALLSYMS |
| 726 | 755 | ||
| 727 | # vmlinux image - including updated kernel symbols | 756 | # vmlinux image - including updated kernel symbols |
| @@ -757,7 +786,7 @@ $(vmlinux-dirs): prepare-all scripts | |||
