diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 112 |
1 files changed, 26 insertions, 86 deletions
@@ -1,8 +1,8 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 33 | 3 | SUBLEVEL = 35 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = |
5 | NAME = Man-Eating Seals of Antiquity | 5 | NAME = 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 |
190 | export KBUILD_BUILDHOST := $(SUBARCH) | 190 | export KBUILD_BUILDHOST := $(SUBARCH) |
191 | ARCH ?= $(SUBARCH) | 191 | ARCH ?= $(SUBARCH) |
192 | CROSS_COMPILE ?= | ||
193 | CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | 192 | CROSS_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 | ||
333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ | 332 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
334 | -Wbitwise -Wno-return-void $(CF) | 333 | -Wbitwise -Wno-return-void $(CF) |
335 | MODFLAGS = -DMODULE | 334 | CFLAGS_MODULE = |
336 | CFLAGS_MODULE = $(MODFLAGS) | 335 | AFLAGS_MODULE = |
337 | AFLAGS_MODULE = $(MODFLAGS) | 336 | LDFLAGS_MODULE = |
338 | LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds | ||
339 | CFLAGS_KERNEL = | 337 | CFLAGS_KERNEL = |
340 | AFLAGS_KERNEL = | 338 | AFLAGS_KERNEL = |
341 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 339 | CFLAGS_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 |
355 | KBUILD_AFLAGS_KERNEL := | ||
356 | KBUILD_CFLAGS_KERNEL := | ||
357 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 357 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
358 | KBUILD_AFLAGS_MODULE := -DMODULE | ||
359 | KBUILD_CFLAGS_MODULE := -DMODULE | ||
360 | KBUILD_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) |
360 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 363 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
@@ -369,6 +372,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | |||
369 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 372 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
370 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 373 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
371 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 374 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
375 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | ||
376 | export 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 | |||
414 | no-dot-config-targets := clean mrproper distclean \ | 419 | no-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 | ||
419 | config-targets := 0 | 424 | config-targets := 0 |
420 | mixed-targets := 0 | 425 | mixed-targets := 0 |
@@ -557,6 +562,10 @@ KBUILD_CFLAGS += -g | |||
557 | KBUILD_AFLAGS += -gdwarf-2 | 562 | KBUILD_AFLAGS += -gdwarf-2 |
558 | endif | 563 | endif |
559 | 564 | ||
565 | ifdef CONFIG_DEBUG_INFO_REDUCED | ||
566 | KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) | ||
567 | endif | ||
568 | |||
560 | ifdef CONFIG_FUNCTION_TRACER | 569 | ifdef CONFIG_FUNCTION_TRACER |
561 | KBUILD_CFLAGS += -pg | 570 | KBUILD_CFLAGS += -pg |
562 | endif | 571 | endif |
@@ -603,7 +612,7 @@ endif | |||
603 | # Use --build-id when available. | 612 | # Use --build-id when available. |
604 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 613 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
605 | $(call cc-ldoption, -Wl$(comma)--build-id,)) | 614 | $(call cc-ldoption, -Wl$(comma)--build-id,)) |
606 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 615 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
607 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 616 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
608 | 617 | ||
609 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 618 | ifeq ($(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 | |||
921 | pattern = ".*/localversion[^~]*" | ||
922 | string = $(shell cat /dev/null \ | ||
923 | `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`) | ||
924 | |||
925 | localver = $(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 | ||
936 | ifeq ($(wildcard .scmversion),) | ||
937 | scm-identifier = $(shell $(CONFIG_SHELL) \ | ||
938 | $(srctree)/scripts/setlocalversion $(srctree)) | ||
939 | else | ||
940 | scm-identifier = $(shell cat .scmversion 2> /dev/null) | ||
941 | endif | ||
942 | |||
943 | ifdef CONFIG_LOCALVERSION_AUTO | ||
944 | localver-extra = $(scm-identifier) | ||
945 | else | ||
946 | ifneq ($scm-identifier,) | ||
947 | ifeq ($(LOCALVERSION),) | ||
948 | localver-extra = + | ||
949 | endif | ||
950 | endif | ||
951 | endif | ||
952 | |||
953 | localver-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 |
956 | kernelrelease = $(KERNELVERSION)$(localver-full) | ||
957 | include/config/kernel.release: include/config/auto.conf FORCE | 896 | include/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 | ||
1097 | PHONY += modules | 1036 | PHONY += modules |
1098 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1037 | modules: $(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 | |||
1117 | modules_install: _modinst_ _modinst_post | 1056 | modules_install: _modinst_ _modinst_post |
1118 | 1057 | ||
1119 | PHONY += _modinst_ | 1058 | PHONY += _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 | ||
1459 | kernelrelease: | 1398 | kernelrelease: 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 | |
1462 | kernelversion: | 1401 | kernelversion: |
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 | ||
1537 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1476 | a_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 | ||