aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile111
1 files changed, 26 insertions, 85 deletions
diff --git a/Makefile b/Makefile
index 8acf7edad82c..66c94aad3665 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"
@@ -332,10 +332,9 @@ CHECK = sparse
332 332
333CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ 333CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
334 -Wbitwise -Wno-return-void $(CF) 334 -Wbitwise -Wno-return-void $(CF)
335MODFLAGS = -DMODULE 335CFLAGS_MODULE =
336CFLAGS_MODULE = $(MODFLAGS) 336AFLAGS_MODULE =
337AFLAGS_MODULE = $(MODFLAGS) 337LDFLAGS_MODULE =
338LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds
339CFLAGS_KERNEL = 338CFLAGS_KERNEL =
340AFLAGS_KERNEL = 339AFLAGS_KERNEL =
341CFLAGS_GCOV = -fprofile-arcs -ftest-coverage 340CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
@@ -354,7 +353,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
354 -Werror-implicit-function-declaration \ 353 -Werror-implicit-function-declaration \
355 -Wno-format-security \ 354 -Wno-format-security \
356 -fno-delete-null-pointer-checks 355 -fno-delete-null-pointer-checks
356KBUILD_AFLAGS_KERNEL :=
357KBUILD_CFLAGS_KERNEL :=
357KBUILD_AFLAGS := -D__ASSEMBLY__ 358KBUILD_AFLAGS := -D__ASSEMBLY__
359KBUILD_AFLAGS_MODULE := -DMODULE
360KBUILD_CFLAGS_MODULE := -DMODULE
361KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
358 362
359# Read KERNELRELEASE from include/config/kernel.release (if it exists) 363# Read KERNELRELEASE from include/config/kernel.release (if it exists)
360KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) 364KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -369,6 +373,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
369export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS 373export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
370export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV 374export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
371export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 375export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
376export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
377export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
372 378
373# When compiling out-of-tree modules, put MODVERDIR in the module 379# When compiling out-of-tree modules, put MODVERDIR in the module
374# tree rather than in the kernel tree. The kernel tree might 380# tree rather than in the kernel tree. The kernel tree might
@@ -414,7 +420,7 @@ endif
414no-dot-config-targets := clean mrproper distclean \ 420no-dot-config-targets := clean mrproper distclean \
415 cscope TAGS tags help %docs check% coccicheck \ 421 cscope TAGS tags help %docs check% coccicheck \
416 include/linux/version.h headers_% \ 422 include/linux/version.h headers_% \
417 kernelrelease kernelversion 423 kernelversion
418 424
419config-targets := 0 425config-targets := 0
420mixed-targets := 0 426mixed-targets := 0
@@ -557,6 +563,10 @@ KBUILD_CFLAGS += -g
557KBUILD_AFLAGS += -gdwarf-2 563KBUILD_AFLAGS += -gdwarf-2
558endif 564endif
559 565
566ifdef CONFIG_DEBUG_INFO_REDUCED
567KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly)
568endif
569
560ifdef CONFIG_FUNCTION_TRACER 570ifdef CONFIG_FUNCTION_TRACER
561KBUILD_CFLAGS += -pg 571KBUILD_CFLAGS += -pg
562endif 572endif
@@ -603,7 +613,7 @@ endif
603# Use --build-id when available. 613# Use --build-id when available.
604LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ 614LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
605 $(call cc-ldoption, -Wl$(comma)--build-id,)) 615 $(call cc-ldoption, -Wl$(comma)--build-id,))
606LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 616KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
607LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 617LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
608 618
609ifeq ($(CONFIG_STRIP_ASM_SYMS),y) 619ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
@@ -883,80 +893,10 @@ PHONY += $(vmlinux-dirs)
883$(vmlinux-dirs): prepare scripts 893$(vmlinux-dirs): prepare scripts
884 $(Q)$(MAKE) $(build)=$@ 894 $(Q)$(MAKE) $(build)=$@
885 895
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 896# Store (new) KERNELRELASE string in include/config/kernel.release
956kernelrelease = $(KERNELVERSION)$(localver-full)
957include/config/kernel.release: include/config/auto.conf FORCE 897include/config/kernel.release: include/config/auto.conf FORCE
958 $(Q)rm -f $@ 898 $(Q)rm -f $@
959 $(Q)echo $(kernelrelease) > $@ 899 $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
960 900
961 901
962# Things we need to do before we recursively start building the kernel 902# Things we need to do before we recursively start building the kernel
@@ -1095,7 +1035,7 @@ all: modules
1095# using awk while concatenating to the final file. 1035# using awk while concatenating to the final file.
1096 1036
1097PHONY += modules 1037PHONY += modules
1098modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1038modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
1099 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1039 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1100 @$(kecho) ' Building modules, stage 2.'; 1040 @$(kecho) ' Building modules, stage 2.';
1101 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1041 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1117,7 +1057,7 @@ PHONY += modules_install
1117modules_install: _modinst_ _modinst_post 1057modules_install: _modinst_ _modinst_post
1118 1058
1119PHONY += _modinst_ 1059PHONY += _modinst_
1120_modinst_: modules.builtin 1060_modinst_:
1121 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ 1061 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
1122 echo "Warning: you may need to install module-init-tools"; \ 1062 echo "Warning: you may need to install module-init-tools"; \
1123 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ 1063 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
@@ -1467,9 +1407,9 @@ checkstack:
1467 $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ 1407 $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
1468 $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) 1408 $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
1469 1409
1470kernelrelease: 1410kernelrelease: include/config/kernel.release
1471 $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ 1411 @echo $(KERNELRELEASE)
1472 $(error kernelrelease not valid - run 'make prepare' to update it)) 1412
1473kernelversion: 1413kernelversion:
1474 @echo $(KERNELVERSION) 1414 @echo $(KERNELVERSION)
1475 1415
@@ -1546,6 +1486,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
1546 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) 1486 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
1547 1487
1548a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1488a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1489 $(KBUILD_AFLAGS_KERNEL) \
1549 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ 1490 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \
1550 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) 1491 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
1551 1492