diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-01 11:55:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-01 11:55:52 -0400 |
commit | 1f73897861b8ef0be64ff4b801f8d6f830f683b5 (patch) | |
tree | b4bae8f12e1422113910d8cb00a19d010dc4a52f /Makefile | |
parent | b904d7131d116900524bd36ec170dcd97846bfd3 (diff) | |
parent | 64ffc9ff424c65adcffe7d590018cc75e2d5d42a (diff) |
Merge branch 'for-35' of git://repo.or.cz/linux-kbuild
* 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits)
kbuild: Revert part of e8d400a to resolve a conflict
kbuild: Fix checking of scm-identifier variable
gconfig: add support to show hidden options that have prompts
menuconfig: add support to show hidden options which have prompts
gconfig: remove show_debug option
gconfig: remove dbg_print_ptype() and dbg_print_stype()
kconfig: fix zconfdump()
kconfig: some small fixes
add random binaries to .gitignore
kbuild: Include gen_initramfs_list.sh and the file list in the .d file
kconfig: recalc symbol value before showing search results
.gitignore: ignore *.lzo files
headerdep: perlcritic warning
scripts/Makefile.lib: Align the output of LZO
kbuild: Generate modules.builtin in make modules_install
Revert "kbuild: specify absolute paths for cscope"
kbuild: Do not unnecessarily regenerate modules.builtin
headers_install: use local file handles
headers_check: fix perl warnings
export_report: fix perl warnings
...
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 65 |
1 files changed, 40 insertions, 25 deletions
@@ -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 |
188 | export KBUILD_BUILDHOST := $(SUBARCH) | 190 | export KBUILD_BUILDHOST := $(SUBARCH) |
189 | ARCH ?= $(SUBARCH) | 191 | ARCH ?= $(SUBARCH) |
190 | CROSS_COMPILE ?= | 192 | CROSS_COMPILE ?= |
193 | CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | ||
191 | 194 | ||
192 | # Architecture as present in compile.h | 195 | # Architecture as present in compile.h |
193 | UTS_MACHINE := $(ARCH) | 196 | UTS_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 |
577 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | 580 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) |
578 | 581 | ||
579 | # revert to pre-gcc-4.4 behaviour of .eh_frame | ||
580 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | ||
581 | |||
582 | # conserve stack if available | 582 | # conserve stack if available |
583 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 583 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
584 | 584 | ||
@@ -882,9 +882,6 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | |||
882 | PHONY += $(vmlinux-dirs) | 882 | PHONY += $(vmlinux-dirs) |
883 | $(vmlinux-dirs): prepare scripts | 883 | $(vmlinux-dirs): prepare scripts |
884 | $(Q)$(MAKE) $(build)=$@ | 884 | $(Q)$(MAKE) $(build)=$@ |
885 | ifdef CONFIG_MODULES | ||
886 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
887 | endif | ||
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 | ||
919 | pattern = ".*/localversion[^~]*" | 921 | pattern = ".*/localversion[^~]*" |
920 | string = $(shell cat /dev/null \ | 922 | string = $(shell cat /dev/null \ |
@@ -923,26 +925,32 @@ string = $(shell cat /dev/null \ | |||
923 | localver = $(subst $(space),, $(string) \ | 925 | localver = $(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 |
933 | ifdef CONFIG_LOCALVERSION_AUTO | ||
934 | |||
935 | ifeq ($(wildcard .scmversion),) | 936 | ifeq ($(wildcard .scmversion),) |
936 | _localver-auto = $(shell $(CONFIG_SHELL) \ | 937 | scm-identifier = $(shell $(CONFIG_SHELL) \ |
937 | $(srctree)/scripts/setlocalversion $(srctree)) | 938 | $(srctree)/scripts/setlocalversion $(srctree)) |
938 | else | 939 | else |
939 | _localver-auto = $(shell cat .scmversion 2> /dev/null) | 940 | scm-identifier = $(shell cat .scmversion 2> /dev/null) |
940 | endif | 941 | endif |
941 | 942 | ||
942 | localver-auto = $(LOCALVERSION)$(_localver-auto) | 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 | ||
943 | endif | 951 | endif |
944 | 952 | ||
945 | localver-full = $(localver)$(localver-auto) | 953 | localver-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 |
948 | kernelrelease = $(KERNELVERSION)$(localver-full) | 956 | kernelrelease = $(KERNELVERSION)$(localver-full) |
@@ -1089,11 +1097,16 @@ all: modules | |||
1089 | PHONY += modules | 1097 | PHONY += modules |
1090 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1098 | modules: $(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 | ||
1104 | modules.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 |
1099 | PHONY += modules_prepare | 1112 | PHONY += modules_prepare |
@@ -1104,7 +1117,7 @@ PHONY += modules_install | |||
1104 | modules_install: _modinst_ _modinst_post | 1117 | modules_install: _modinst_ _modinst_post |
1105 | 1118 | ||
1106 | PHONY += _modinst_ | 1119 | PHONY += _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' |