aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile107
1 files changed, 35 insertions, 72 deletions
diff --git a/Makefile b/Makefile
index 33d4732a6c4a..9f64552f09d6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 32 3SUBLEVEL = 33
4EXTRAVERSION = 4EXTRAVERSION = -rc4
5NAME = Man-Eating Seals of Antiquity 5NAME = Man-Eating Seals of Antiquity
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -16,6 +16,13 @@ NAME = Man-Eating Seals of Antiquity
16# o print "Entering directory ..."; 16# o print "Entering directory ...";
17MAKEFLAGS += -rR --no-print-directory 17MAKEFLAGS += -rR --no-print-directory
18 18
19# Avoid funny character set dependencies
20unexport LC_ALL
21LC_CTYPE=C
22LC_COLLATE=C
23LC_NUMERIC=C
24export LC_CTYPE LC_COLLATE LC_NUMERIC
25
19# We are using a recursive build, so we need to do a little thinking 26# We are using a recursive build, so we need to do a little thinking
20# to get the ordering right. 27# to get the ordering right.
21# 28#
@@ -334,10 +341,9 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
334 341
335# Use LINUXINCLUDE when you must reference the include/ directory. 342# Use LINUXINCLUDE when you must reference the include/ directory.
336# Needed to be compatible with the O= option 343# Needed to be compatible with the O= option
337LINUXINCLUDE := -Iinclude \ 344LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \
338 $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ 345 $(if $(KBUILD_SRC), -I$(srctree)/include) \
339 -I$(srctree)/arch/$(hdr-arch)/include \ 346 -include include/generated/autoconf.h
340 -include include/linux/autoconf.h
341 347
342KBUILD_CPPFLAGS := -D__KERNEL__ 348KBUILD_CPPFLAGS := -D__KERNEL__
343 349
@@ -465,7 +471,7 @@ ifeq ($(KBUILD_EXTMOD),)
465# 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
466# in parallel 472# in parallel
467PHONY += scripts 473PHONY += scripts
468scripts: scripts_basic include/config/auto.conf 474scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
469 $(Q)$(MAKE) $(build)=$(@) 475 $(Q)$(MAKE) $(build)=$(@)
470 476
471# Objects we will link into vmlinux / subdirs we need to visit 477# Objects we will link into vmlinux / subdirs we need to visit
@@ -492,18 +498,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
492# with it and forgot to run make oldconfig. 498# with it and forgot to run make oldconfig.
493# 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
494# 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
495include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 501include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
496 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 502 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
497else 503else
498# 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
499# 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
500PHONY += include/config/auto.conf 506PHONY += include/config/auto.conf
501 507
502include/config/auto.conf: 508include/config/auto.conf:
503 $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ 509 $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \
504 echo; \ 510 echo; \
505 echo " ERROR: Kernel configuration is invalid."; \ 511 echo " ERROR: Kernel configuration is invalid."; \
506 echo " include/linux/autoconf.h or $@ are missing."; \ 512 echo " include/generated/autoconf.h or $@ are missing.";\
507 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."; \
508 echo; \ 514 echo; \
509 /bin/false) 515 /bin/false)
@@ -877,6 +883,9 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
877PHONY += $(vmlinux-dirs) 883PHONY += $(vmlinux-dirs)
878$(vmlinux-dirs): prepare scripts 884$(vmlinux-dirs): prepare scripts
879 $(Q)$(MAKE) $(build)=$@ 885 $(Q)$(MAKE) $(build)=$@
886ifdef CONFIG_MODULES
887 $(Q)$(MAKE) $(modbuiltin)=$@
888endif
880 889
881# Build the kernel release string 890# Build the kernel release string
882# 891#
@@ -955,7 +964,6 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
955# 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,
956# and if so do: 965# and if so do:
957# 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)
958# 2) Create the include2 directory, used for the second asm symlink
959prepare3: include/config/kernel.release 967prepare3: include/config/kernel.release
960ifneq ($(KBUILD_SRC),) 968ifneq ($(KBUILD_SRC),)
961 @$(kecho) ' Using $(srctree) as source for kernel' 969 @$(kecho) ' Using $(srctree) as source for kernel'
@@ -964,17 +972,13 @@ ifneq ($(KBUILD_SRC),)
964 echo " in the '$(srctree)' directory.";\ 972 echo " in the '$(srctree)' directory.";\
965 /bin/false; \ 973 /bin/false; \
966 fi; 974 fi;
967 $(Q)if [ ! -d include2 ]; then \
968 mkdir -p include2; \
969 ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \
970 fi
971endif 975endif
972 976
973# prepare2 creates a makefile if using a separate output directory 977# prepare2 creates a makefile if using a separate output directory
974prepare2: prepare3 outputmakefile 978prepare2: prepare3 outputmakefile
975 979
976prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ 980prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
977 include/asm include/config/auto.conf 981 include/config/auto.conf
978 $(cmd_crmodverdir) 982 $(cmd_crmodverdir)
979 983
980archprepare: prepare1 scripts_basic 984archprepare: prepare1 scripts_basic
@@ -986,42 +990,6 @@ prepare0: archprepare FORCE
986# All the preparing.. 990# All the preparing..
987prepare: prepare0 991prepare: prepare0
988 992
989# The asm symlink changes when $(ARCH) changes.
990# Detect this and ask user to run make mrproper
991# If asm is a stale symlink (point to dir that does not exist) remove it
992define check-symlink
993 set -e; \
994 if [ -L include/asm ]; then \
995 asmlink=`readlink include/asm | cut -d '-' -f 2`; \
996 if [ "$$asmlink" != "$(SRCARCH)" ]; then \
997 echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
998 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
999 exit 1; \
1000 fi; \
1001 test -e $$asmlink || rm include/asm; \
1002 elif [ -d include/asm ]; then \
1003 echo "ERROR: $@ is a directory but a symlink was expected";\
1004 exit 1; \
1005 fi
1006endef
1007
1008# We create the target directory of the symlink if it does
1009# not exist so the test in check-symlink works and we have a
1010# directory for generated filesas used by some architectures.
1011define create-symlink
1012 if [ ! -L include/asm ]; then \
1013 $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
1014 if [ ! -d include/asm-$(SRCARCH) ]; then \
1015 mkdir -p include/asm-$(SRCARCH); \
1016 fi; \
1017 ln -fsn asm-$(SRCARCH) $@; \
1018 fi
1019endef
1020
1021include/asm: FORCE
1022 $(Q)$(check-symlink)
1023 $(Q)$(create-symlink)
1024
1025# Generate some files 993# Generate some files
1026# --------------------------------------------------------------------------- 994# ---------------------------------------------------------------------------
1027 995
@@ -1046,7 +1014,7 @@ endef
1046include/linux/version.h: $(srctree)/Makefile FORCE 1014include/linux/version.h: $(srctree)/Makefile FORCE
1047 $(call filechk,version.h) 1015 $(call filechk,version.h)
1048 1016
1049include/linux/utsrelease.h: include/config/kernel.release FORCE 1017include/generated/utsrelease.h: include/config/kernel.release FORCE
1050 $(call filechk,utsrelease.h) 1018 $(call filechk,utsrelease.h)
1051 1019
1052PHONY += headerdep 1020PHONY += headerdep
@@ -1076,11 +1044,6 @@ firmware_install: FORCE
1076export INSTALL_HDR_PATH = $(objtree)/usr 1044export INSTALL_HDR_PATH = $(objtree)/usr
1077 1045
1078hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 1046hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
1079# Find out where the Kbuild file is located to support
1080# arch/$(ARCH)/include/asm
1081hdr-dir = $(strip \
1082 $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \
1083 arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch)))
1084 1047
1085# 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)
1086hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) 1049hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
@@ -1095,10 +1058,10 @@ headers_install_all:
1095 1058
1096PHONY += headers_install 1059PHONY += headers_install
1097headers_install: __headers 1060headers_install: __headers
1098 $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ 1061 $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \
1099 $(error Headers not exportable for the $(SRCARCH) architecture)) 1062 $(error Headers not exportable for the $(SRCARCH) architecture))
1100 $(Q)$(MAKE) $(hdr-inst)=include 1063 $(Q)$(MAKE) $(hdr-inst)=include
1101 $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) 1064 $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)
1102 1065
1103PHONY += headers_check_all 1066PHONY += headers_check_all
1104headers_check_all: headers_install_all 1067headers_check_all: headers_install_all
@@ -1107,7 +1070,7 @@ headers_check_all: headers_install_all
1107PHONY += headers_check 1070PHONY += headers_check
1108headers_check: headers_install 1071headers_check: headers_install
1109 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 1072 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
1110 $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 1073 $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1
1111 1074
1112# --------------------------------------------------------------------------- 1075# ---------------------------------------------------------------------------
1113# Modules 1076# Modules
@@ -1127,6 +1090,7 @@ all: modules
1127PHONY += modules 1090PHONY += modules
1128modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1091modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
1129 $(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
1130 @$(kecho) ' Building modules, stage 2.'; 1094 @$(kecho) ' Building modules, stage 2.';
1131 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1095 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1132 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild 1096 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
@@ -1156,6 +1120,7 @@ _modinst_:
1156 ln -s $(objtree) $(MODLIB)/build ; \ 1120 ln -s $(objtree) $(MODLIB)/build ; \
1157 fi 1121 fi
1158 @cp -f $(objtree)/modules.order $(MODLIB)/ 1122 @cp -f $(objtree)/modules.order $(MODLIB)/
1123 @cp -f $(objtree)/modules.builtin $(MODLIB)/
1159 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1124 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1160 1125
1161# This depmod is only for convenience to give the initial 1126# This depmod is only for convenience to give the initial
@@ -1194,12 +1159,10 @@ CLEAN_FILES += vmlinux System.map \
1194 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1159 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
1195 1160
1196# Directories & files removed with 'make mrproper' 1161# Directories & files removed with 'make mrproper'
1197MRPROPER_DIRS += include/config include2 usr/include include/generated 1162MRPROPER_DIRS += include/config usr/include include/generated
1198MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1163MRPROPER_FILES += .config .config.old .version .old_version \
1199 include/linux/autoconf.h include/linux/version.h \ 1164 include/linux/version.h \
1200 include/linux/utsrelease.h \ 1165 Module.symvers tags TAGS cscope*
1201 include/linux/bounds.h include/asm*/asm-offsets.h \
1202 Module.symvers Module.markers tags TAGS cscope*
1203 1166
1204# clean - Delete most, but leave enough to build external modules 1167# clean - Delete most, but leave enough to build external modules
1205# 1168#
@@ -1218,7 +1181,7 @@ clean: archclean $(clean-dirs)
1218 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1181 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
1219 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1182 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1220 -o -name '*.symtypes' -o -name 'modules.order' \ 1183 -o -name '*.symtypes' -o -name 'modules.order' \
1221 -o -name 'Module.markers' -o -name '.tmp_*.o.*' \ 1184 -o -name modules.builtin -o -name '.tmp_*.o.*' \
1222 -o -name '*.gcno' \) -type f -print | xargs rm -f 1185 -o -name '*.gcno' \) -type f -print | xargs rm -f
1223 1186
1224# mrproper - Delete all generated files, including .config 1187# mrproper - Delete all generated files, including .config
@@ -1416,8 +1379,8 @@ $(clean-dirs):
1416 1379
1417clean: rm-dirs := $(MODVERDIR) 1380clean: rm-dirs := $(MODVERDIR)
1418clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ 1381clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
1419 $(KBUILD_EXTMOD)/Module.markers \ 1382 $(KBUILD_EXTMOD)/modules.order \
1420 $(KBUILD_EXTMOD)/modules.order 1383 $(KBUILD_EXTMOD)/modules.builtin
1421clean: $(clean-dirs) 1384clean: $(clean-dirs)
1422 $(call cmd,rmdirs) 1385 $(call cmd,rmdirs)
1423 $(call cmd,rmfiles) 1386 $(call cmd,rmfiles)