diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 62 |
1 files changed, 45 insertions, 17 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 39 | 3 | SUBLEVEL = 39 |
4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = |
5 | NAME = Flesh-Eating Bats with Fangs | 5 | NAME = Flesh-Eating Bats with Fangs |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
@@ -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 |
@@ -357,7 +357,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | |||
357 | 357 | ||
358 | # Use LINUXINCLUDE when you must reference the include/ directory. | 358 | # Use LINUXINCLUDE when you must reference the include/ directory. |
359 | # Needed to be compatible with the O= option | 359 | # Needed to be compatible with the O= option |
360 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ | 360 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ |
361 | -Iarch/$(hdr-arch)/include/generated -Iinclude \ | ||
361 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 362 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
362 | -include include/generated/autoconf.h | 363 | -include include/generated/autoconf.h |
363 | 364 | ||
@@ -390,6 +391,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | |||
390 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 391 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
391 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | 392 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE |
392 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | 393 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL |
394 | export KBUILD_ARFLAGS | ||
393 | 395 | ||
394 | # When compiling out-of-tree modules, put MODVERDIR in the module | 396 | # When compiling out-of-tree modules, put MODVERDIR in the module |
395 | # tree rather than in the kernel tree. The kernel tree might | 397 | # tree rather than in the kernel tree. The kernel tree might |
@@ -424,6 +426,12 @@ ifneq ($(KBUILD_SRC),) | |||
424 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) | 426 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) |
425 | endif | 427 | endif |
426 | 428 | ||
429 | # Support for using generic headers in asm-generic | ||
430 | PHONY += asm-generic | ||
431 | asm-generic: | ||
432 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ | ||
433 | obj=arch/$(SRCARCH)/include/generated/asm | ||
434 | |||
427 | # To make sure we do not include .config for any of the *config targets | 435 | # To make sure we do not include .config for any of the *config targets |
428 | # catch them early, and hand them over to scripts/kconfig/Makefile | 436 | # catch them early, and hand them over to scripts/kconfig/Makefile |
429 | # It is allowed to specify more targets when calling make, including | 437 | # It is allowed to specify more targets when calling make, including |
@@ -567,6 +575,10 @@ ifndef CONFIG_CC_STACKPROTECTOR | |||
567 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) | 575 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) |
568 | endif | 576 | endif |
569 | 577 | ||
578 | # This warning generated too much noise in a regular build. | ||
579 | # Use make W=1 to enable this warning (see scripts/Makefile.build) | ||
580 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
581 | |||
570 | ifdef CONFIG_FRAME_POINTER | 582 | ifdef CONFIG_FRAME_POINTER |
571 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 583 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
572 | else | 584 | else |
@@ -612,7 +624,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS) | |||
612 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) | 624 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) |
613 | 625 | ||
614 | # disable pointer signed / unsigned warnings in gcc 4.0 | 626 | # disable pointer signed / unsigned warnings in gcc 4.0 |
615 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | 627 | KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) |
616 | 628 | ||
617 | # disable invalid "can't wrap" optimizations for signed / pointers | 629 | # disable invalid "can't wrap" optimizations for signed / pointers |
618 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | 630 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) |
@@ -620,6 +632,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | |||
620 | # conserve stack if available | 632 | # conserve stack if available |
621 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 633 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
622 | 634 | ||
635 | # use the deterministic mode of AR if available | ||
636 | KBUILD_ARFLAGS := $(call ar-option,D) | ||
637 | |||
623 | # check for 'asm goto' | 638 | # check for 'asm goto' |
624 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) | 639 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) |
625 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO | 640 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO |
@@ -805,15 +820,17 @@ ifdef CONFIG_KALLSYMS | |||
805 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. | 820 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. |
806 | # o Verify that the System.map from vmlinux matches the map from | 821 | # o Verify that the System.map from vmlinux matches the map from |
807 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. | 822 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. |
808 | # o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using | 823 | # o If 'make KALLSYMS_EXTRA_PASS=1" was used, do an extra pass using |
809 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a | 824 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a |
810 | # temporary bypass to allow the kernel to be built while the | 825 | # temporary bypass to allow the kernel to be built while the |
811 | # maintainers work out what went wrong with kallsyms. | 826 | # maintainers work out what went wrong with kallsyms. |
812 | 827 | ||
813 | ifdef CONFIG_KALLSYMS_EXTRA_PASS | ||
814 | last_kallsyms := 3 | ||
815 | else | ||
816 | last_kallsyms := 2 | 828 | last_kallsyms := 2 |
829 | |||
830 | ifdef KALLSYMS_EXTRA_PASS | ||
831 | ifneq ($(KALLSYMS_EXTRA_PASS),0) | ||
832 | last_kallsyms := 3 | ||
833 | endif | ||
817 | endif | 834 | endif |
818 | 835 | ||
819 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 836 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
@@ -824,7 +841,8 @@ define verify_kallsyms | |||
824 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map | 841 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map |
825 | $(Q)cmp -s System.map .tmp_System.map || \ | 842 | $(Q)cmp -s System.map .tmp_System.map || \ |
826 | (echo Inconsistent kallsyms data; \ | 843 | (echo Inconsistent kallsyms data; \ |
827 | echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ | 844 | echo This is a bug - please report about it; \ |
845 | echo Try "make KALLSYMS_EXTRA_PASS=1" as a workaround; \ | ||
828 | rm .tmp_kallsyms* ; /bin/false ) | 846 | rm .tmp_kallsyms* ; /bin/false ) |
829 | endef | 847 | endef |
830 | 848 | ||
@@ -955,7 +973,7 @@ ifneq ($(KBUILD_SRC),) | |||
955 | endif | 973 | endif |
956 | 974 | ||
957 | # prepare2 creates a makefile if using a separate output directory | 975 | # prepare2 creates a makefile if using a separate output directory |
958 | prepare2: prepare3 outputmakefile | 976 | prepare2: prepare3 outputmakefile asm-generic |
959 | 977 | ||
960 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ | 978 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ |
961 | include/config/auto.conf | 979 | include/config/auto.conf |
@@ -999,7 +1017,8 @@ include/generated/utsrelease.h: include/config/kernel.release FORCE | |||
999 | 1017 | ||
1000 | PHONY += headerdep | 1018 | PHONY += headerdep |
1001 | headerdep: | 1019 | headerdep: |
1002 | $(Q)find include/ -name '*.h' | xargs --max-args 1 scripts/headerdep.pl | 1020 | $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \ |
1021 | $(srctree)/scripts/headerdep.pl -I$(srctree)/include | ||
1003 | 1022 | ||
1004 | # --------------------------------------------------------------------------- | 1023 | # --------------------------------------------------------------------------- |
1005 | 1024 | ||
@@ -1029,7 +1048,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | |||
1029 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1048 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
1030 | 1049 | ||
1031 | PHONY += __headers | 1050 | PHONY += __headers |
1032 | __headers: include/linux/version.h scripts_basic FORCE | 1051 | __headers: include/linux/version.h scripts_basic asm-generic FORCE |
1033 | $(Q)$(MAKE) $(build)=scripts build_unifdef | 1052 | $(Q)$(MAKE) $(build)=scripts build_unifdef |
1034 | 1053 | ||
1035 | PHONY += headers_install_all | 1054 | PHONY += headers_install_all |
@@ -1144,7 +1163,8 @@ CLEAN_FILES += vmlinux System.map \ | |||
1144 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1163 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
1145 | 1164 | ||
1146 | # Directories & files removed with 'make mrproper' | 1165 | # Directories & files removed with 'make mrproper' |
1147 | MRPROPER_DIRS += include/config usr/include include/generated | 1166 | MRPROPER_DIRS += include/config usr/include include/generated \ |
1167 | arch/*/include/generated | ||
1148 | MRPROPER_FILES += .config .config.old .version .old_version \ | 1168 | MRPROPER_FILES += .config .config.old .version .old_version \ |
1149 | include/linux/version.h \ | 1169 | include/linux/version.h \ |
1150 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | 1170 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS |
@@ -1275,7 +1295,12 @@ help: | |||
1275 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' | 1295 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' |
1276 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' | 1296 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' |
1277 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' | 1297 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' |
1278 | @echo ' make W=1 [targets] Enable extra gcc checks' | 1298 | @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where' |
1299 | @echo ' 1: warnings which may be relevant and do not occur too often' | ||
1300 | @echo ' 2: warnings which occur quite often but may still be relevant' | ||
1301 | @echo ' 3: more obscure warnings, can most likely be ignored' | ||
1302 | @echo ' Multiple levels can be combined with W=12 or W=123' | ||
1303 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' | ||
1279 | @echo '' | 1304 | @echo '' |
1280 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' | 1305 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' |
1281 | @echo 'For further info see the ./README file' | 1306 | @echo 'For further info see the ./README file' |
@@ -1298,6 +1323,7 @@ $(help-board-dirs): help-%: | |||
1298 | # Documentation targets | 1323 | # Documentation targets |
1299 | # --------------------------------------------------------------------------- | 1324 | # --------------------------------------------------------------------------- |
1300 | %docs: scripts_basic FORCE | 1325 | %docs: scripts_basic FORCE |
1326 | $(Q)$(MAKE) $(build)=scripts build_docproc | ||
1301 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ | 1327 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ |
1302 | 1328 | ||
1303 | else # KBUILD_EXTMOD | 1329 | else # KBUILD_EXTMOD |
@@ -1382,7 +1408,7 @@ endif # KBUILD_EXTMOD | |||
1382 | clean: $(clean-dirs) | 1408 | clean: $(clean-dirs) |
1383 | $(call cmd,rmdirs) | 1409 | $(call cmd,rmdirs) |
1384 | $(call cmd,rmfiles) | 1410 | $(call cmd,rmfiles) |
1385 | @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ | 1411 | @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ |
1386 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1412 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1387 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1413 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1388 | -o -name '*.symtypes' -o -name 'modules.order' \ | 1414 | -o -name '*.symtypes' -o -name 'modules.order' \ |
@@ -1400,13 +1426,15 @@ tags TAGS cscope gtags: FORCE | |||
1400 | # Scripts to check various things for consistency | 1426 | # Scripts to check various things for consistency |
1401 | # --------------------------------------------------------------------------- | 1427 | # --------------------------------------------------------------------------- |
1402 | 1428 | ||
1429 | PHONY += includecheck versioncheck coccicheck namespacecheck export_report | ||
1430 | |||
1403 | includecheck: | 1431 | includecheck: |
1404 | find * $(RCS_FIND_IGNORE) \ | 1432 | find $(srctree)/* $(RCS_FIND_IGNORE) \ |
1405 | -name '*.[hcS]' -type f -print | sort \ | 1433 | -name '*.[hcS]' -type f -print | sort \ |
1406 | | xargs $(PERL) -w $(srctree)/scripts/checkincludes.pl | 1434 | | xargs $(PERL) -w $(srctree)/scripts/checkincludes.pl |
1407 | 1435 | ||
1408 | versioncheck: | 1436 | versioncheck: |
1409 | find * $(RCS_FIND_IGNORE) \ | 1437 | find $(srctree)/* $(RCS_FIND_IGNORE) \ |
1410 | -name '*.[hcS]' -type f -print | sort \ | 1438 | -name '*.[hcS]' -type f -print | sort \ |
1411 | | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl | 1439 | | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl |
1412 | 1440 | ||