aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile112
1 files changed, 26 insertions, 86 deletions
diff --git a/Makefile b/Makefile
index 414a64697283..edfa6cf7cb94 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 33 3SUBLEVEL = 35
4EXTRAVERSION = -rc6 4EXTRAVERSION =
5NAME = Man-Eating Seals of Antiquity 5NAME = Sheep on Meth
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help" 8# To see a list of typical targets execute "make help"
@@ -189,7 +189,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
189# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile 189# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
190export KBUILD_BUILDHOST := $(SUBARCH) 190export KBUILD_BUILDHOST := $(SUBARCH)
191ARCH ?= $(SUBARCH) 191ARCH ?= $(SUBARCH)
192CROSS_COMPILE ?=
193CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) 192CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
194 193
195# Architecture as present in compile.h 194# Architecture as present in compile.h
@@ -332,10 +331,9 @@ CHECK = sparse
332 331
333CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ 332CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
334 -Wbitwise -Wno-return-void $(CF) 333 -Wbitwise -Wno-return-void $(CF)
335MODFLAGS = -DMODULE 334CFLAGS_MODULE =
336CFLAGS_MODULE = $(MODFLAGS) 335AFLAGS_MODULE =
337AFLAGS_MODULE = $(MODFLAGS) 336LDFLAGS_MODULE =
338LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds
339CFLAGS_KERNEL = 337CFLAGS_KERNEL =
340AFLAGS_KERNEL = 338AFLAGS_KERNEL =
341CFLAGS_GCOV = -fprofile-arcs -ftest-coverage 339CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
@@ -354,7 +352,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
354 -Werror-implicit-function-declaration \ 352 -Werror-implicit-function-declaration \
355 -Wno-format-security \ 353 -Wno-format-security \
356 -fno-delete-null-pointer-checks 354 -fno-delete-null-pointer-checks
355KBUILD_AFLAGS_KERNEL :=
356KBUILD_CFLAGS_KERNEL :=
357KBUILD_AFLAGS := -D__ASSEMBLY__ 357KBUILD_AFLAGS := -D__ASSEMBLY__
358KBUILD_AFLAGS_MODULE := -DMODULE
359KBUILD_CFLAGS_MODULE := -DMODULE
360KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
358 361
359# Read KERNELRELEASE from include/config/kernel.release (if it exists) 362# Read KERNELRELEASE from include/config/kernel.release (if it exists)
360KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) 363KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -369,6 +372,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
369export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS 372export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
370export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV 373export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
371export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 374export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
375export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
376export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
372 377
373# When compiling out-of-tree modules, put MODVERDIR in the module 378# When compiling out-of-tree modules, put MODVERDIR in the module
374# tree rather than in the kernel tree. The kernel tree might 379# tree rather than in the kernel tree. The kernel tree might
@@ -414,7 +419,7 @@ endif
414no-dot-config-targets := clean mrproper distclean \ 419no-dot-config-targets := clean mrproper distclean \
415 cscope TAGS tags help %docs check% \ 420 cscope TAGS tags help %docs check% \
416 include/linux/version.h headers_% \ 421 include/linux/version.h headers_% \
417 kernelrelease kernelversion 422 kernelversion
418 423
419config-targets := 0 424config-targets := 0
420mixed-targets := 0 425mixed-targets := 0
@@ -557,6 +562,10 @@ KBUILD_CFLAGS += -g
557KBUILD_AFLAGS += -gdwarf-2 562KBUILD_AFLAGS += -gdwarf-2
558endif 563endif
559 564
565ifdef CONFIG_DEBUG_INFO_REDUCED
566KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly)
567endif
568
560ifdef CONFIG_FUNCTION_TRACER 569ifdef CONFIG_FUNCTION_TRACER
561KBUILD_CFLAGS += -pg 570KBUILD_CFLAGS += -pg
562endif 571endif
@@ -603,7 +612,7 @@ endif
603# Use --build-id when available. 612# Use --build-id when available.
604LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ 613LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
605 $(call cc-ldoption, -Wl$(comma)--build-id,)) 614 $(call cc-ldoption, -Wl$(comma)--build-id,))
606LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 615KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
607LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 616LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
608 617
609ifeq ($(CONFIG_STRIP_ASM_SYMS),y) 618ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
@@ -883,80 +892,10 @@ PHONY += $(vmlinux-dirs)
883$(vmlinux-dirs): prepare scripts 892$(vmlinux-dirs): prepare scripts
884 $(Q)$(MAKE) $(build)=$@ 893 $(Q)$(MAKE) $(build)=$@
885 894
886# Build the kernel release string
887#
888# The KERNELRELEASE value built here is stored in the file
889# include/config/kernel.release, and is used when executing several
890# make targets, such as "make install" or "make modules_install."
891#
892# The eventual kernel release string consists of the following fields,
893# shown in a hierarchical format to show how smaller parts are concatenated
894# to form the larger and final value, with values coming from places like
895# the Makefile, kernel config options, make command line options and/or
896# SCM tag information.
897#
898# $(KERNELVERSION)
899# $(VERSION) eg, 2
900# $(PATCHLEVEL) eg, 6
901# $(SUBLEVEL) eg, 18
902# $(EXTRAVERSION) eg, -rc6
903# $(localver-full)
904# $(localver)
905# localversion* (files without backups, containing '~')
906# $(CONFIG_LOCALVERSION) (from kernel config setting)
907# $(LOCALVERSION) (from make command line, if provided)
908# $(localver-extra)
909# $(scm-identifier) (unique SCM tag, if one exists)
910# ./scripts/setlocalversion (only with CONFIG_LOCALVERSION_AUTO)
911# .scmversion (only with CONFIG_LOCALVERSION_AUTO)
912# + (only without CONFIG_LOCALVERSION_AUTO
913# and without LOCALVERSION= and
914# repository is at non-tagged commit)
915#
916# For kernels without CONFIG_LOCALVERSION_AUTO compiled from an SCM that has
917# been revised beyond a tagged commit, `+' is appended to the version string
918# when not overridden by using "make LOCALVERSION=". This indicates that the
919# kernel is not a vanilla release version and has been modified.
920
921pattern = ".*/localversion[^~]*"
922string = $(shell cat /dev/null \
923 `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`)
924
925localver = $(subst $(space),, $(string) \
926 $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
927
928# scripts/setlocalversion is called to create a unique identifier if the source
929# is managed by a known SCM and the repository has been revised since the last
930# tagged (release) commit. The format of the identifier is determined by the
931# SCM's implementation.
932#
933# .scmversion is used when generating rpm packages so we do not loose
934# the version information from the SCM when we do the build of the kernel
935# from the copied source
936ifeq ($(wildcard .scmversion),)
937 scm-identifier = $(shell $(CONFIG_SHELL) \
938 $(srctree)/scripts/setlocalversion $(srctree))
939else
940 scm-identifier = $(shell cat .scmversion 2> /dev/null)
941endif
942
943ifdef CONFIG_LOCALVERSION_AUTO
944 localver-extra = $(scm-identifier)
945else
946 ifneq ($scm-identifier,)
947 ifeq ($(LOCALVERSION),)
948 localver-extra = +
949 endif
950 endif
951endif
952
953localver-full = $(localver)$(LOCALVERSION)$(localver-extra)
954
955# Store (new) KERNELRELASE string in include/config/kernel.release 895# Store (new) KERNELRELASE string in include/config/kernel.release
956kernelrelease = $(KERNELVERSION)$(localver-full)
957include/config/kernel.release: include/config/auto.conf FORCE 896include/config/kernel.release: include/config/auto.conf FORCE
958 $(Q)rm -f $@ 897 $(Q)rm -f $@
959 $(Q)echo $(kernelrelease) > $@ 898 $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
960 899
961 900
962# Things we need to do before we recursively start building the kernel 901# Things we need to do before we recursively start building the kernel
@@ -1095,7 +1034,7 @@ all: modules
1095# using awk while concatenating to the final file. 1034# using awk while concatenating to the final file.
1096 1035
1097PHONY += modules 1036PHONY += modules
1098modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1037modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
1099 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1038 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1100 @$(kecho) ' Building modules, stage 2.'; 1039 @$(kecho) ' Building modules, stage 2.';
1101 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1040 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1117,7 +1056,7 @@ PHONY += modules_install
1117modules_install: _modinst_ _modinst_post 1056modules_install: _modinst_ _modinst_post
1118 1057
1119PHONY += _modinst_ 1058PHONY += _modinst_
1120_modinst_: modules.builtin 1059_modinst_:
1121 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ 1060 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
1122 echo "Warning: you may need to install module-init-tools"; \ 1061 echo "Warning: you may need to install module-init-tools"; \
1123 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ 1062 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
@@ -1456,9 +1395,9 @@ checkstack:
1456 $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ 1395 $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
1457 $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) 1396 $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
1458 1397
1459kernelrelease: 1398kernelrelease: include/config/kernel.release
1460 $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ 1399 @echo $(KERNELRELEASE)
1461 $(error kernelrelease not valid - run 'make prepare' to update it)) 1400
1462kernelversion: 1401kernelversion:
1463 @echo $(KERNELVERSION) 1402 @echo $(KERNELVERSION)
1464 1403
@@ -1535,6 +1474,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
1535 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) 1474 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
1536 1475
1537a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1476a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1477 $(KBUILD_AFLAGS_KERNEL) \
1538 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ 1478 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \
1539 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) 1479 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
1540 1480