diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 111 |
1 files changed, 26 insertions, 85 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" |
@@ -332,10 +332,9 @@ CHECK = sparse | |||
332 | 332 | ||
333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ | 333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
334 | -Wbitwise -Wno-return-void $(CF) | 334 | -Wbitwise -Wno-return-void $(CF) |
335 | MODFLAGS = -DMODULE | 335 | CFLAGS_MODULE = |
336 | CFLAGS_MODULE = $(MODFLAGS) | 336 | AFLAGS_MODULE = |
337 | AFLAGS_MODULE = $(MODFLAGS) | 337 | LDFLAGS_MODULE = |
338 | LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds | ||
339 | CFLAGS_KERNEL = | 338 | CFLAGS_KERNEL = |
340 | AFLAGS_KERNEL = | 339 | AFLAGS_KERNEL = |
341 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 340 | CFLAGS_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 |
356 | KBUILD_AFLAGS_KERNEL := | ||
357 | KBUILD_CFLAGS_KERNEL := | ||
357 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 358 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
359 | KBUILD_AFLAGS_MODULE := -DMODULE | ||
360 | KBUILD_CFLAGS_MODULE := -DMODULE | ||
361 | KBUILD_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) |
360 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 364 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
@@ -369,6 +373,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | |||
369 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 373 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
370 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 374 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
371 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 375 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
376 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | ||
377 | export 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 | |||
414 | no-dot-config-targets := clean mrproper distclean \ | 420 | no-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 | ||
419 | config-targets := 0 | 425 | config-targets := 0 |
420 | mixed-targets := 0 | 426 | mixed-targets := 0 |
@@ -557,6 +563,10 @@ KBUILD_CFLAGS += -g | |||
557 | KBUILD_AFLAGS += -gdwarf-2 | 563 | KBUILD_AFLAGS += -gdwarf-2 |
558 | endif | 564 | endif |
559 | 565 | ||
566 | ifdef CONFIG_DEBUG_INFO_REDUCED | ||
567 | KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) | ||
568 | endif | ||
569 | |||
560 | ifdef CONFIG_FUNCTION_TRACER | 570 | ifdef CONFIG_FUNCTION_TRACER |
561 | KBUILD_CFLAGS += -pg | 571 | KBUILD_CFLAGS += -pg |
562 | endif | 572 | endif |
@@ -603,7 +613,7 @@ endif | |||
603 | # Use --build-id when available. | 613 | # Use --build-id when available. |
604 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 614 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
605 | $(call cc-ldoption, -Wl$(comma)--build-id,)) | 615 | $(call cc-ldoption, -Wl$(comma)--build-id,)) |
606 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 616 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
607 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 617 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
608 | 618 | ||
609 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 619 | ifeq ($(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 | |||
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 | 896 | # Store (new) KERNELRELASE string in include/config/kernel.release |
956 | kernelrelease = $(KERNELVERSION)$(localver-full) | ||
957 | include/config/kernel.release: include/config/auto.conf FORCE | 897 | include/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 | ||
1097 | PHONY += modules | 1037 | PHONY += modules |
1098 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1038 | modules: $(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 | |||
1117 | modules_install: _modinst_ _modinst_post | 1057 | modules_install: _modinst_ _modinst_post |
1118 | 1058 | ||
1119 | PHONY += _modinst_ | 1059 | PHONY += _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 | ||
1470 | kernelrelease: | 1410 | kernelrelease: 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 | |
1473 | kernelversion: | 1413 | kernelversion: |
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 | ||
1548 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1488 | a_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 | ||