aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 40 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 6e39ec701cbf..efdc3d0d8e60 100644
--- a/Makefile
+++ b/Makefile
@@ -183,11 +183,14 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
183# CROSS_COMPILE can be set on the command line 183# CROSS_COMPILE can be set on the command line
184# make CROSS_COMPILE=ia64-linux- 184# make CROSS_COMPILE=ia64-linux-
185# Alternatively CROSS_COMPILE can be set in the environment. 185# Alternatively CROSS_COMPILE can be set in the environment.
186# A third alternative is to store a setting in .config so that plain
187# "make" in the configured kernel build directory always uses that.
186# Default value for CROSS_COMPILE is not to prefix executables 188# Default value for CROSS_COMPILE is not to prefix executables
187# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile 189# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
188export KBUILD_BUILDHOST := $(SUBARCH) 190export KBUILD_BUILDHOST := $(SUBARCH)
189ARCH ?= $(SUBARCH) 191ARCH ?= $(SUBARCH)
190CROSS_COMPILE ?= 192CROSS_COMPILE ?=
193CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
191 194
192# Architecture as present in compile.h 195# Architecture as present in compile.h
193UTS_MACHINE := $(ARCH) 196UTS_MACHINE := $(ARCH)
@@ -576,9 +579,6 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
576# disable invalid "can't wrap" optimizations for signed / pointers 579# disable invalid "can't wrap" optimizations for signed / pointers
577KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) 580KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
578 581
579# revert to pre-gcc-4.4 behaviour of .eh_frame
580KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
581
582# conserve stack if available 582# conserve stack if available
583KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) 583KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
584 584
@@ -882,9 +882,6 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
882PHONY += $(vmlinux-dirs) 882PHONY += $(vmlinux-dirs)
883$(vmlinux-dirs): prepare scripts 883$(vmlinux-dirs): prepare scripts
884 $(Q)$(MAKE) $(build)=$@ 884 $(Q)$(MAKE) $(build)=$@
885ifdef CONFIG_MODULES
886 $(Q)$(MAKE) $(modbuiltin)=$@
887endif
888 885
889# Build the kernel release string 886# Build the kernel release string
890# 887#
@@ -907,14 +904,19 @@ endif
907# $(localver) 904# $(localver)
908# localversion* (files without backups, containing '~') 905# localversion* (files without backups, containing '~')
909# $(CONFIG_LOCALVERSION) (from kernel config setting) 906# $(CONFIG_LOCALVERSION) (from kernel config setting)
910# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) 907# $(LOCALVERSION) (from make command line, if provided)
911# ./scripts/setlocalversion (SCM tag, if one exists) 908# $(localver-extra)
912# $(LOCALVERSION) (from make command line if provided) 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)
913# 915#
914# Note how the final $(localver-auto) string is included *only* if the 916# For kernels without CONFIG_LOCALVERSION_AUTO compiled from an SCM that has
915# kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the 917# been revised beyond a tagged commit, `+' is appended to the version string
916# moment, only git is supported but other SCMs can edit the script 918# when not overridden by using "make LOCALVERSION=". This indicates that the
917# scripts/setlocalversion and add the appropriate checks as needed. 919# kernel is not a vanilla release version and has been modified.
918 920
919pattern = ".*/localversion[^~]*" 921pattern = ".*/localversion[^~]*"
920string = $(shell cat /dev/null \ 922string = $(shell cat /dev/null \
@@ -923,26 +925,32 @@ string = $(shell cat /dev/null \
923localver = $(subst $(space),, $(string) \ 925localver = $(subst $(space),, $(string) \
924 $(patsubst "%",%,$(CONFIG_LOCALVERSION))) 926 $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
925 927
926# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called 928# scripts/setlocalversion is called to create a unique identifier if the source
927# and if the SCM is know a tag from the SCM is appended. 929# is managed by a known SCM and the repository has been revised since the last
928# The appended tag is determined by the SCM used. 930# tagged (release) commit. The format of the identifier is determined by the
931# SCM's implementation.
929# 932#
930# .scmversion is used when generating rpm packages so we do not loose 933# .scmversion is used when generating rpm packages so we do not loose
931# the version information from the SCM when we do the build of the kernel 934# the version information from the SCM when we do the build of the kernel
932# from the copied source 935# from the copied source
933ifdef CONFIG_LOCALVERSION_AUTO
934
935ifeq ($(wildcard .scmversion),) 936ifeq ($(wildcard .scmversion),)
936 _localver-auto = $(shell $(CONFIG_SHELL) \ 937 scm-identifier = $(shell $(CONFIG_SHELL) \
937 $(srctree)/scripts/setlocalversion $(srctree)) 938 $(srctree)/scripts/setlocalversion $(srctree))
938else 939else
939 _localver-auto = $(shell cat .scmversion 2> /dev/null) 940 scm-identifier = $(shell cat .scmversion 2> /dev/null)
940endif 941endif
941 942
942 localver-auto = $(LOCALVERSION)$(_localver-auto) 943ifdef CONFIG_LOCALVERSION_AUTO
944 localver-extra = $(scm-identifier)
945else
946 ifneq ($(scm-identifier),)
947 ifeq ($(LOCALVERSION),)
948 localver-extra = +
949 endif
950 endif
943endif 951endif
944 952
945localver-full = $(localver)$(localver-auto) 953localver-full = $(localver)$(LOCALVERSION)$(localver-extra)
946 954
947# Store (new) KERNELRELASE string in include/config/kernel.release 955# Store (new) KERNELRELASE string in include/config/kernel.release
948kernelrelease = $(KERNELVERSION)$(localver-full) 956kernelrelease = $(KERNELVERSION)$(localver-full)
@@ -1089,11 +1097,16 @@ all: modules
1089PHONY += modules 1097PHONY += modules
1090modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1098modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
1091 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1099 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1092 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
1093 @$(kecho) ' Building modules, stage 2.'; 1100 @$(kecho) ' Building modules, stage 2.';
1094 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1101 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1095 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild 1102 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
1096 1103
1104modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
1105 $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
1106
1107%/modules.builtin: include/config/auto.conf
1108 $(Q)$(MAKE) $(modbuiltin)=$*
1109
1097 1110
1098# Target to prepare building external modules 1111# Target to prepare building external modules
1099PHONY += modules_prepare 1112PHONY += modules_prepare
@@ -1104,7 +1117,7 @@ PHONY += modules_install
1104modules_install: _modinst_ _modinst_post 1117modules_install: _modinst_ _modinst_post
1105 1118
1106PHONY += _modinst_ 1119PHONY += _modinst_
1107_modinst_: 1120_modinst_: modules.builtin
1108 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ 1121 @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
1109 echo "Warning: you may need to install module-init-tools"; \ 1122 echo "Warning: you may need to install module-init-tools"; \
1110 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ 1123 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
@@ -1247,7 +1260,9 @@ help:
1247 @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH' 1260 @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH'
1248 @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)' 1261 @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
1249 @echo ' dir/ - Build all files in dir and below' 1262 @echo ' dir/ - Build all files in dir and below'
1250 @echo ' dir/file.[ois] - Build specified target only' 1263 @echo ' dir/file.[oisS] - Build specified target only'
1264 @echo ' dir/file.lst - Build specified mixed source/assembly target only'
1265 @echo ' (requires a recent binutils and recent build (System.map))'
1251 @echo ' dir/file.ko - Build module including final link' 1266 @echo ' dir/file.ko - Build module including final link'
1252 @echo ' modules_prepare - Set up for building external modules' 1267 @echo ' modules_prepare - Set up for building external modules'
1253 @echo ' tags/TAGS - Generate tags file for editors' 1268 @echo ' tags/TAGS - Generate tags file for editors'