diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
| commit | 2bb732cdb48d271ff7a910260ffb851fb4bc8a28 (patch) | |
| tree | 580bf68eb1e52b4e6915588d61423347ae09c318 /Makefile | |
| parent | f50d1d9e8d964fdd3b4cedfbca8843d1bc5916c1 (diff) | |
| parent | c4d5ee13984f57b2f881635c49045151679f5e8a (diff) | |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
scripts/kallsyms.c: fix potential segfault
scripts/gen_initramfs_list.sh: Convert to a /bin/sh script
kbuild: Fix GNU make v3.80 compatibility
kbuild: Fix passing -Wno-* options to gcc 4.4+
kbuild: move scripts/basic/docproc.c to scripts/docproc.c
kbuild: Fix Makefile.asm-generic for um
kbuild: Allow to combine multiple W= levels
kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
Fix handling of backlash character in LINUX_COMPILE_BY name
kbuild: asm-generic support
kbuild: implement several W= levels
kbuild: Fix build with binutils <= 2.19
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros
kbuild: Use the deterministic mode of ar
kbuild: Call gzip with -n
kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile
Kconfig: improve KALLSYMS_ALL documentation
Fix up trivial conflict in Makefile
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 50 |
1 files changed, 37 insertions, 13 deletions
| @@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line") | |||
| 103 | endif | 103 | endif |
| 104 | 104 | ||
| 105 | ifeq ("$(origin W)", "command line") | 105 | ifeq ("$(origin W)", "command line") |
| 106 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1 | 106 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) |
| 107 | endif | 107 | endif |
| 108 | 108 | ||
| 109 | # That's our default target when none is given on the command line | 109 | # That's our default target when none is given on the command line |
| @@ -349,7 +349,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | |||
| 349 | 349 | ||
| 350 | # Use LINUXINCLUDE when you must reference the include/ directory. | 350 | # Use LINUXINCLUDE when you must reference the include/ directory. |
| 351 | # Needed to be compatible with the O= option | 351 | # Needed to be compatible with the O= option |
| 352 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ | 352 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ |
| 353 | -Iarch/$(hdr-arch)/include/generated -Iinclude \ | ||
| 353 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 354 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
| 354 | -include include/generated/autoconf.h | 355 | -include include/generated/autoconf.h |
| 355 | 356 | ||
| @@ -382,6 +383,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | |||
| 382 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 383 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
| 383 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | 384 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE |
| 384 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | 385 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL |
| 386 | export KBUILD_ARFLAGS | ||
| 385 | 387 | ||
| 386 | # When compiling out-of-tree modules, put MODVERDIR in the module | 388 | # When compiling out-of-tree modules, put MODVERDIR in the module |
| 387 | # tree rather than in the kernel tree. The kernel tree might | 389 | # tree rather than in the kernel tree. The kernel tree might |
| @@ -416,6 +418,12 @@ ifneq ($(KBUILD_SRC),) | |||
| 416 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) | 418 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) |
| 417 | endif | 419 | endif |
| 418 | 420 | ||
| 421 | # Support for using generic headers in asm-generic | ||
| 422 | PHONY += asm-generic | ||
| 423 | asm-generic: | ||
| 424 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ | ||
| 425 | obj=arch/$(SRCARCH)/include/generated/asm | ||
| 426 | |||
| 419 | # To make sure we do not include .config for any of the *config targets | 427 | # To make sure we do not include .config for any of the *config targets |
| 420 | # catch them early, and hand them over to scripts/kconfig/Makefile | 428 | # catch them early, and hand them over to scripts/kconfig/Makefile |
| 421 | # It is allowed to specify more targets when calling make, including | 429 | # It is allowed to specify more targets when calling make, including |
| @@ -559,6 +567,10 @@ ifndef CONFIG_CC_STACKPROTECTOR | |||
| 559 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) | 567 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) |
| 560 | endif | 568 | endif |
| 561 | 569 | ||
| 570 | # This warning generated too much noise in a regular build. | ||
| 571 | # Use make W=1 to enable this warning (see scripts/Makefile.build) | ||
| 572 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
| 573 | |||
| 562 | ifdef CONFIG_FRAME_POINTER | 574 | ifdef CONFIG_FRAME_POINTER |
| 563 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 575 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
| 564 | else | 576 | else |
| @@ -604,7 +616,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS) | |||
| 604 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) | 616 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) |
| 605 | 617 | ||
| 606 | # disable pointer signed / unsigned warnings in gcc 4.0 | 618 | # disable pointer signed / unsigned warnings in gcc 4.0 |
| 607 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | 619 | KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) |
| 608 | 620 | ||
| 609 | # disable invalid "can't wrap" optimizations for signed / pointers | 621 | # disable invalid "can't wrap" optimizations for signed / pointers |
| 610 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | 622 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) |
| @@ -612,6 +624,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | |||
| 612 | # conserve stack if available | 624 | # conserve stack if available |
| 613 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 625 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
| 614 | 626 | ||
| 627 | # use the deterministic mode of AR if available | ||
| 628 | KBUILD_ARFLAGS := $(call ar-option,D) | ||
| 629 | |||
| 615 | # check for 'asm goto' | 630 | # check for 'asm goto' |
| 616 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) | 631 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) |
| 617 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO | 632 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO |
| @@ -797,15 +812,17 @@ ifdef CONFIG_KALLSYMS | |||
| 797 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. | 812 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. |
| 798 | # o Verify that the System.map from vmlinux matches the map from | 813 | # o Verify that the System.map from vmlinux matches the map from |
| 799 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. | 814 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. |
| 800 | # o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using | 815 | # o If 'make KALLSYMS_EXTRA_PASS=1" was used, do an extra pass using |
| 801 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a | 816 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a |
| 802 | # temporary bypass to allow the kernel to be built while the | 817 | # temporary bypass to allow the kernel to be built while the |
| 803 | # maintainers work out what went wrong with kallsyms. | 818 | # maintainers work out what went wrong with kallsyms. |
| 804 | 819 | ||
| 805 | ifdef CONFIG_KALLSYMS_EXTRA_PASS | ||
| 806 | last_kallsyms := 3 | ||
| 807 | else | ||
| 808 | last_kallsyms := 2 | 820 | last_kallsyms := 2 |
| 821 | |||
| 822 | ifdef KALLSYMS_EXTRA_PASS | ||
| 823 | ifneq ($(KALLSYMS_EXTRA_PASS),0) | ||
| 824 | last_kallsyms := 3 | ||
| 825 | endif | ||
| 809 | endif | 826 | endif |
| 810 | 827 | ||
| 811 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 828 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
| @@ -816,7 +833,8 @@ define verify_kallsyms | |||
| 816 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map | 833 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map |
| 817 | $(Q)cmp -s System.map .tmp_System.map || \ | 834 | $(Q)cmp -s System.map .tmp_System.map || \ |
| 818 | (echo Inconsistent kallsyms data; \ | 835 | (echo Inconsistent kallsyms data; \ |
| 819 | echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ | 836 | echo This is a bug - please report about it; \ |
| 837 | echo Try "make KALLSYMS_EXTRA_PASS=1" as a workaround; \ | ||
| 820 | rm .tmp_kallsyms* ; /bin/false ) | 838 | rm .tmp_kallsyms* ; /bin/false ) |
| 821 | endef | 839 | endef |
| 822 | 840 | ||
| @@ -947,7 +965,7 @@ ifneq ($(KBUILD_SRC),) | |||
| 947 | endif | 965 | endif |
| 948 | 966 | ||
| 949 | # prepare2 creates a makefile if using a separate output directory | 967 | # prepare2 creates a makefile if using a separate output directory |
| 950 | prepare2: prepare3 outputmakefile | 968 | prepare2: prepare3 outputmakefile asm-generic |
| 951 | 969 | ||
| 952 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ | 970 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ |
| 953 | include/config/auto.conf | 971 | include/config/auto.conf |
| @@ -1021,7 +1039,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | |||
| 1021 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1039 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
| 1022 | 1040 | ||
| 1023 | PHONY += __headers | 1041 | PHONY += __headers |
| 1024 | __headers: include/linux/version.h scripts_basic FORCE | 1042 | __headers: include/linux/version.h scripts_basic asm-generic FORCE |
| 1025 | $(Q)$(MAKE) $(build)=scripts build_unifdef | 1043 | $(Q)$(MAKE) $(build)=scripts build_unifdef |
| 1026 | 1044 | ||
| 1027 | PHONY += headers_install_all | 1045 | PHONY += headers_install_all |
| @@ -1136,7 +1154,8 @@ CLEAN_FILES += vmlinux System.map \ | |||
| 1136 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1154 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
| 1137 | 1155 | ||
| 1138 | # Directories & files removed with 'make mrproper' | 1156 | # Directories & files removed with 'make mrproper' |
| 1139 | MRPROPER_DIRS += include/config usr/include include/generated | 1157 | MRPROPER_DIRS += include/config usr/include include/generated \ |
| 1158 | arch/*/include/generated | ||
| 1140 | MRPROPER_FILES += .config .config.old .version .old_version \ | 1159 | MRPROPER_FILES += .config .config.old .version .old_version \ |
| 1141 | include/linux/version.h \ | 1160 | include/linux/version.h \ |
| 1142 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | 1161 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS |
| @@ -1267,7 +1286,11 @@ help: | |||
| 1267 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' | 1286 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' |
| 1268 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' | 1287 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' |
| 1269 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' | 1288 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' |
| 1270 | @echo ' make W=1 [targets] Enable extra gcc checks' | 1289 | @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where' |
| 1290 | @echo ' 1: warnings which may be relevant and do not occur too often' | ||
| 1291 | @echo ' 2: warnings which occur quite often but may still be relevant' | ||
| 1292 | @echo ' 3: more obscure warnings, can most likely be ignored' | ||
| 1293 | @echo ' Multiple levels can be combined with W=12 or W=123' | ||
| 1271 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' | 1294 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' |
| 1272 | @echo '' | 1295 | @echo '' |
| 1273 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' | 1296 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' |
| @@ -1291,6 +1314,7 @@ $(help-board-dirs): help-%: | |||
| 1291 | # Documentation targets | 1314 | # Documentation targets |
| 1292 | # --------------------------------------------------------------------------- | 1315 | # --------------------------------------------------------------------------- |
| 1293 | %docs: scripts_basic FORCE | 1316 | %docs: scripts_basic FORCE |
| 1317 | $(Q)$(MAKE) $(build)=scripts build_docproc | ||
| 1294 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ | 1318 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ |
| 1295 | 1319 | ||
| 1296 | else # KBUILD_EXTMOD | 1320 | else # KBUILD_EXTMOD |
| @@ -1375,7 +1399,7 @@ endif # KBUILD_EXTMOD | |||
| 1375 | clean: $(clean-dirs) | 1399 | clean: $(clean-dirs) |
| 1376 | $(call cmd,rmdirs) | 1400 | $(call cmd,rmdirs) |
| 1377 | $(call cmd,rmfiles) | 1401 | $(call cmd,rmfiles) |
| 1378 | @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ | 1402 | @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ |
| 1379 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1403 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
| 1380 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1404 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
| 1381 | -o -name '*.symtypes' -o -name 'modules.order' \ | 1405 | -o -name '*.symtypes' -o -name 'modules.order' \ |
