diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 100 |
1 files changed, 28 insertions, 72 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 32 | 3 | SUBLEVEL = 33 |
4 | EXTRAVERSION = | 4 | EXTRAVERSION = -rc1 |
5 | NAME = Man-Eating Seals of Antiquity | 5 | NAME = Man-Eating Seals of Antiquity |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
@@ -341,10 +341,9 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | |||
341 | 341 | ||
342 | # Use LINUXINCLUDE when you must reference the include/ directory. | 342 | # Use LINUXINCLUDE when you must reference the include/ directory. |
343 | # Needed to be compatible with the O= option | 343 | # Needed to be compatible with the O= option |
344 | LINUXINCLUDE := -Iinclude \ | 344 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ |
345 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ | 345 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
346 | -I$(srctree)/arch/$(hdr-arch)/include \ | 346 | -include include/generated/autoconf.h |
347 | -include include/linux/autoconf.h | ||
348 | 347 | ||
349 | KBUILD_CPPFLAGS := -D__KERNEL__ | 348 | KBUILD_CPPFLAGS := -D__KERNEL__ |
350 | 349 | ||
@@ -472,7 +471,7 @@ ifeq ($(KBUILD_EXTMOD),) | |||
472 | # Carefully list dependencies so we do not try to build scripts twice | 471 | # Carefully list dependencies so we do not try to build scripts twice |
473 | # in parallel | 472 | # in parallel |
474 | PHONY += scripts | 473 | PHONY += scripts |
475 | scripts: scripts_basic include/config/auto.conf | 474 | scripts: scripts_basic include/config/auto.conf include/config/tristate.conf |
476 | $(Q)$(MAKE) $(build)=$(@) | 475 | $(Q)$(MAKE) $(build)=$(@) |
477 | 476 | ||
478 | # Objects we will link into vmlinux / subdirs we need to visit | 477 | # Objects we will link into vmlinux / subdirs we need to visit |
@@ -499,18 +498,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; | |||
499 | # with it and forgot to run make oldconfig. | 498 | # with it and forgot to run make oldconfig. |
500 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so | 499 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so |
501 | # we execute the config step to be sure to catch updated Kconfig files | 500 | # we execute the config step to be sure to catch updated Kconfig files |
502 | include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd | 501 | include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd |
503 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig | 502 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig |
504 | else | 503 | else |
505 | # external modules needs include/linux/autoconf.h and include/config/auto.conf | 504 | # external modules needs include/generated/autoconf.h and include/config/auto.conf |
506 | # but do not care if they are up-to-date. Use auto.conf to trigger the test | 505 | # but do not care if they are up-to-date. Use auto.conf to trigger the test |
507 | PHONY += include/config/auto.conf | 506 | PHONY += include/config/auto.conf |
508 | 507 | ||
509 | include/config/auto.conf: | 508 | include/config/auto.conf: |
510 | $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ | 509 | $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ |
511 | echo; \ | 510 | echo; \ |
512 | echo " ERROR: Kernel configuration is invalid."; \ | 511 | echo " ERROR: Kernel configuration is invalid."; \ |
513 | echo " include/linux/autoconf.h or $@ are missing."; \ | 512 | echo " include/generated/autoconf.h or $@ are missing.";\ |
514 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ | 513 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ |
515 | echo; \ | 514 | echo; \ |
516 | /bin/false) | 515 | /bin/false) |
@@ -884,6 +883,9 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | |||
884 | PHONY += $(vmlinux-dirs) | 883 | PHONY += $(vmlinux-dirs) |
885 | $(vmlinux-dirs): prepare scripts | 884 | $(vmlinux-dirs): prepare scripts |
886 | $(Q)$(MAKE) $(build)=$@ | 885 | $(Q)$(MAKE) $(build)=$@ |
886 | ifdef CONFIG_MODULES | ||
887 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
888 | endif | ||
887 | 889 | ||
888 | # Build the kernel release string | 890 | # Build the kernel release string |
889 | # | 891 | # |
@@ -962,7 +964,6 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 | |||
962 | # prepare3 is used to check if we are building in a separate output directory, | 964 | # prepare3 is used to check if we are building in a separate output directory, |
963 | # and if so do: | 965 | # and if so do: |
964 | # 1) Check that make has not been executed in the kernel src $(srctree) | 966 | # 1) Check that make has not been executed in the kernel src $(srctree) |
965 | # 2) Create the include2 directory, used for the second asm symlink | ||
966 | prepare3: include/config/kernel.release | 967 | prepare3: include/config/kernel.release |
967 | ifneq ($(KBUILD_SRC),) | 968 | ifneq ($(KBUILD_SRC),) |
968 | @$(kecho) ' Using $(srctree) as source for kernel' | 969 | @$(kecho) ' Using $(srctree) as source for kernel' |
@@ -971,17 +972,13 @@ ifneq ($(KBUILD_SRC),) | |||
971 | echo " in the '$(srctree)' directory.";\ | 972 | echo " in the '$(srctree)' directory.";\ |
972 | /bin/false; \ | 973 | /bin/false; \ |
973 | fi; | 974 | fi; |
974 | $(Q)if [ ! -d include2 ]; then \ | ||
975 | mkdir -p include2; \ | ||
976 | ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ | ||
977 | fi | ||
978 | endif | 975 | endif |
979 | 976 | ||
980 | # prepare2 creates a makefile if using a separate output directory | 977 | # prepare2 creates a makefile if using a separate output directory |
981 | prepare2: prepare3 outputmakefile | 978 | prepare2: prepare3 outputmakefile |
982 | 979 | ||
983 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ | 980 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ |
984 | include/asm include/config/auto.conf | 981 | include/config/auto.conf |
985 | $(cmd_crmodverdir) | 982 | $(cmd_crmodverdir) |
986 | 983 | ||
987 | archprepare: prepare1 scripts_basic | 984 | archprepare: prepare1 scripts_basic |
@@ -993,42 +990,6 @@ prepare0: archprepare FORCE | |||
993 | # All the preparing.. | 990 | # All the preparing.. |
994 | prepare: prepare0 | 991 | prepare: prepare0 |
995 | 992 | ||
996 | # The asm symlink changes when $(ARCH) changes. | ||
997 | # Detect this and ask user to run make mrproper | ||
998 | # If asm is a stale symlink (point to dir that does not exist) remove it | ||
999 | define check-symlink | ||
1000 | set -e; \ | ||
1001 | if [ -L include/asm ]; then \ | ||
1002 | asmlink=`readlink include/asm | cut -d '-' -f 2`; \ | ||
1003 | if [ "$$asmlink" != "$(SRCARCH)" ]; then \ | ||
1004 | echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ | ||
1005 | echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ | ||
1006 | exit 1; \ | ||
1007 | fi; \ | ||
1008 | test -e $$asmlink || rm include/asm; \ | ||
1009 | elif [ -d include/asm ]; then \ | ||
1010 | echo "ERROR: $@ is a directory but a symlink was expected";\ | ||
1011 | exit 1; \ | ||
1012 | fi | ||
1013 | endef | ||
1014 | |||
1015 | # We create the target directory of the symlink if it does | ||
1016 | # not exist so the test in check-symlink works and we have a | ||
1017 | # directory for generated filesas used by some architectures. | ||
1018 | define create-symlink | ||
1019 | if [ ! -L include/asm ]; then \ | ||
1020 | $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ | ||
1021 | if [ ! -d include/asm-$(SRCARCH) ]; then \ | ||
1022 | mkdir -p include/asm-$(SRCARCH); \ | ||
1023 | fi; \ | ||
1024 | ln -fsn asm-$(SRCARCH) $@; \ | ||
1025 | fi | ||
1026 | endef | ||
1027 | |||
1028 | include/asm: FORCE | ||
1029 | $(Q)$(check-symlink) | ||
1030 | $(Q)$(create-symlink) | ||
1031 | |||
1032 | # Generate some files | 993 | # Generate some files |
1033 | # --------------------------------------------------------------------------- | 994 | # --------------------------------------------------------------------------- |
1034 | 995 | ||
@@ -1053,7 +1014,7 @@ endef | |||
1053 | include/linux/version.h: $(srctree)/Makefile FORCE | 1014 | include/linux/version.h: $(srctree)/Makefile FORCE |
1054 | $(call filechk,version.h) | 1015 | $(call filechk,version.h) |
1055 | 1016 | ||
1056 | include/linux/utsrelease.h: include/config/kernel.release FORCE | 1017 | include/generated/utsrelease.h: include/config/kernel.release FORCE |
1057 | $(call filechk,utsrelease.h) | 1018 | $(call filechk,utsrelease.h) |
1058 | 1019 | ||
1059 | PHONY += headerdep | 1020 | PHONY += headerdep |
@@ -1083,11 +1044,6 @@ firmware_install: FORCE | |||
1083 | export INSTALL_HDR_PATH = $(objtree)/usr | 1044 | export INSTALL_HDR_PATH = $(objtree)/usr |
1084 | 1045 | ||
1085 | hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | 1046 | hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj |
1086 | # Find out where the Kbuild file is located to support | ||
1087 | # arch/$(ARCH)/include/asm | ||
1088 | hdr-dir = $(strip \ | ||
1089 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \ | ||
1090 | arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch))) | ||
1091 | 1047 | ||
1092 | # If we do an all arch process set dst to asm-$(hdr-arch) | 1048 | # If we do an all arch process set dst to asm-$(hdr-arch) |
1093 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1049 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
@@ -1102,10 +1058,10 @@ headers_install_all: | |||
1102 | 1058 | ||
1103 | PHONY += headers_install | 1059 | PHONY += headers_install |
1104 | headers_install: __headers | 1060 | headers_install: __headers |
1105 | $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ | 1061 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ |
1106 | $(error Headers not exportable for the $(SRCARCH) architecture)) | 1062 | $(error Headers not exportable for the $(SRCARCH) architecture)) |
1107 | $(Q)$(MAKE) $(hdr-inst)=include | 1063 | $(Q)$(MAKE) $(hdr-inst)=include |
1108 | $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) | 1064 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) |
1109 | 1065 | ||
1110 | PHONY += headers_check_all | 1066 | PHONY += headers_check_all |
1111 | headers_check_all: headers_install_all | 1067 | headers_check_all: headers_install_all |
@@ -1114,7 +1070,7 @@ headers_check_all: headers_install_all | |||
1114 | PHONY += headers_check | 1070 | PHONY += headers_check |
1115 | headers_check: headers_install | 1071 | headers_check: headers_install |
1116 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 | 1072 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 |
1117 | $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 | 1073 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 |
1118 | 1074 | ||
1119 | # --------------------------------------------------------------------------- | 1075 | # --------------------------------------------------------------------------- |
1120 | # Modules | 1076 | # Modules |
@@ -1134,6 +1090,7 @@ all: modules | |||
1134 | PHONY += modules | 1090 | PHONY += modules |
1135 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1091 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
1136 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order | 1092 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
1093 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin | ||
1137 | @$(kecho) ' Building modules, stage 2.'; | 1094 | @$(kecho) ' Building modules, stage 2.'; |
1138 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1095 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1139 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild | 1096 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild |
@@ -1163,6 +1120,7 @@ _modinst_: | |||
1163 | ln -s $(objtree) $(MODLIB)/build ; \ | 1120 | ln -s $(objtree) $(MODLIB)/build ; \ |
1164 | fi | 1121 | fi |
1165 | @cp -f $(objtree)/modules.order $(MODLIB)/ | 1122 | @cp -f $(objtree)/modules.order $(MODLIB)/ |
1123 | @cp -f $(objtree)/modules.builtin $(MODLIB)/ | ||
1166 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1124 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
1167 | 1125 | ||
1168 | # This depmod is only for convenience to give the initial | 1126 | # This depmod is only for convenience to give the initial |
@@ -1201,12 +1159,10 @@ CLEAN_FILES += vmlinux System.map \ | |||
1201 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1159 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
1202 | 1160 | ||
1203 | # Directories & files removed with 'make mrproper' | 1161 | # Directories & files removed with 'make mrproper' |
1204 | MRPROPER_DIRS += include/config include2 usr/include include/generated | 1162 | MRPROPER_DIRS += include/config usr/include include/generated |
1205 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ | 1163 | MRPROPER_FILES += .config .config.old .version .old_version \ |
1206 | include/linux/autoconf.h include/linux/version.h \ | 1164 | include/linux/version.h \ |
1207 | include/linux/utsrelease.h \ | 1165 | Module.symvers tags TAGS cscope* |
1208 | include/linux/bounds.h include/asm*/asm-offsets.h \ | ||
1209 | Module.symvers Module.markers tags TAGS cscope* | ||
1210 | 1166 | ||
1211 | # clean - Delete most, but leave enough to build external modules | 1167 | # clean - Delete most, but leave enough to build external modules |
1212 | # | 1168 | # |
@@ -1225,7 +1181,7 @@ clean: archclean $(clean-dirs) | |||
1225 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1181 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1226 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1182 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1227 | -o -name '*.symtypes' -o -name 'modules.order' \ | 1183 | -o -name '*.symtypes' -o -name 'modules.order' \ |
1228 | -o -name 'Module.markers' -o -name '.tmp_*.o.*' \ | 1184 | -o -name modules.builtin -o -name '.tmp_*.o.*' \ |
1229 | -o -name '*.gcno' \) -type f -print | xargs rm -f | 1185 | -o -name '*.gcno' \) -type f -print | xargs rm -f |
1230 | 1186 | ||
1231 | # mrproper - Delete all generated files, including .config | 1187 | # mrproper - Delete all generated files, including .config |
@@ -1423,8 +1379,8 @@ $(clean-dirs): | |||
1423 | 1379 | ||
1424 | clean: rm-dirs := $(MODVERDIR) | 1380 | clean: rm-dirs := $(MODVERDIR) |
1425 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ | 1381 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ |
1426 | $(KBUILD_EXTMOD)/Module.markers \ | 1382 | $(KBUILD_EXTMOD)/modules.order \ |
1427 | $(KBUILD_EXTMOD)/modules.order | 1383 | $(KBUILD_EXTMOD)/modules.builtin |
1428 | clean: $(clean-dirs) | 1384 | clean: $(clean-dirs) |
1429 | $(call cmd,rmdirs) | 1385 | $(call cmd,rmdirs) |
1430 | $(call cmd,rmfiles) | 1386 | $(call cmd,rmfiles) |