aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile62
1 files changed, 45 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index cadf4cd595d7..529d93fa2430 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 39 3SUBLEVEL = 39
4EXTRAVERSION = -rc5 4EXTRAVERSION =
5NAME = Flesh-Eating Bats with Fangs 5NAME = Flesh-Eating Bats with Fangs
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line")
103endif 103endif
104 104
105ifeq ("$(origin W)", "command line") 105ifeq ("$(origin W)", "command line")
106 export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1 106 export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
107endif 107endif
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
360LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ 360LINUXINCLUDE := -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
390export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 391export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
391export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE 392export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
392export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL 393export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
394export 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)
425endif 427endif
426 428
429# Support for using generic headers in asm-generic
430PHONY += asm-generic
431asm-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
567KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) 575KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
568endif 576endif
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)
580KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
581
570ifdef CONFIG_FRAME_POINTER 582ifdef CONFIG_FRAME_POINTER
571KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls 583KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
572else 584else
@@ -612,7 +624,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
612KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) 624KBUILD_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
615KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 627KBUILD_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
618KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) 630KBUILD_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
621KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) 633KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
622 634
635# use the deterministic mode of AR if available
636KBUILD_ARFLAGS := $(call ar-option,D)
637
623# check for 'asm goto' 638# check for 'asm goto'
624ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) 639ifeq ($(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
813ifdef CONFIG_KALLSYMS_EXTRA_PASS
814last_kallsyms := 3
815else
816last_kallsyms := 2 828last_kallsyms := 2
829
830ifdef KALLSYMS_EXTRA_PASS
831ifneq ($(KALLSYMS_EXTRA_PASS),0)
832last_kallsyms := 3
833endif
817endif 834endif
818 835
819kallsyms.o := .tmp_kallsyms$(last_kallsyms).o 836kallsyms.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 )
829endef 847endef
830 848
@@ -955,7 +973,7 @@ ifneq ($(KBUILD_SRC),)
955endif 973endif
956 974
957# prepare2 creates a makefile if using a separate output directory 975# prepare2 creates a makefile if using a separate output directory
958prepare2: prepare3 outputmakefile 976prepare2: prepare3 outputmakefile asm-generic
959 977
960prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ 978prepare1: 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
1000PHONY += headerdep 1018PHONY += headerdep
1001headerdep: 1019headerdep:
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
1029hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) 1048hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
1030 1049
1031PHONY += __headers 1050PHONY += __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
1035PHONY += headers_install_all 1054PHONY += 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'
1147MRPROPER_DIRS += include/config usr/include include/generated 1166MRPROPER_DIRS += include/config usr/include include/generated \
1167 arch/*/include/generated
1148MRPROPER_FILES += .config .config.old .version .old_version \ 1168MRPROPER_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
1303else # KBUILD_EXTMOD 1329else # KBUILD_EXTMOD
@@ -1382,7 +1408,7 @@ endif # KBUILD_EXTMOD
1382clean: $(clean-dirs) 1408clean: $(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
1429PHONY += includecheck versioncheck coccicheck namespacecheck export_report
1430
1403includecheck: 1431includecheck:
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
1408versioncheck: 1436versioncheck:
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