aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-25 12:26:59 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-25 12:26:59 -0400
commit363e065c02b1273364d5356711a83e7f548fc0c8 (patch)
tree0df0e65da403ade33ade580c2770c97437b1b1af /Makefile
parent907b9bceb41fa46beae93f79cc4a2247df502c0f (diff)
parent7c250413e5b7c3dfae89354725b70c76d7621395 (diff)
[GFS2] Fix up merge of Linus' kernel into GFS2
This fixes up a couple of conflicts when merging up with Linus' latest kernel. This will hopefully allow GFS2 to be more easily merged into forthcoming -mm and FC kernels due to the "one line per header" format now used for the kernel headers. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Conflicts: include/linux/Kbuild include/linux/kernel.h
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile155
1 files changed, 106 insertions, 49 deletions
diff --git a/Makefile b/Makefile
index edfc2fdf76..80dac0245d 100644
--- a/Makefile
+++ b/Makefile
@@ -41,9 +41,15 @@ ifndef KBUILD_VERBOSE
41 KBUILD_VERBOSE = 0 41 KBUILD_VERBOSE = 0
42endif 42endif
43 43
44# Call checker as part of compilation of C files 44# Call a source code checker (by default, "sparse") as part of the
45# Use 'make C=1' to enable checking (sparse, by default) 45# C compilation.
46# Override with 'make C=1 CHECK=checker_executable CHECKFLAGS=....' 46#
47# Use 'make C=1' to enable checking of only re-compiled files.
48# Use 'make C=2' to enable checking of *all* source files, regardless
49# of whether they are re-compiled or not.
50#
51# See the file "Documentation/sparse.txt" for more details, including
52# where to get the "sparse" utility.
47 53
48ifdef C 54ifdef C
49 ifeq ("$(origin C)", "command line") 55 ifeq ("$(origin C)", "command line")
@@ -639,12 +645,12 @@ define rule_vmlinux__
639 $(call cmd,vmlinux__) 645 $(call cmd,vmlinux__)
640 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd 646 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
641 647
642 $(Q)$(if $($(quiet)cmd_sysmap), \ 648 $(Q)$(if $($(quiet)cmd_sysmap), \
643 echo ' $($(quiet)cmd_sysmap) System.map' &&) \ 649 echo ' $($(quiet)cmd_sysmap) System.map' &&) \
644 $(cmd_sysmap) $@ System.map; \ 650 $(cmd_sysmap) $@ System.map; \
645 if [ $$? -ne 0 ]; then \ 651 if [ $$? -ne 0 ]; then \
646 rm -f $@; \ 652 rm -f $@; \
647 /bin/false; \ 653 /bin/false; \
648 fi; 654 fi;
649 $(verify_kallsyms) 655 $(verify_kallsyms)
650endef 656endef
@@ -677,12 +683,12 @@ endif
677kallsyms.o := .tmp_kallsyms$(last_kallsyms).o 683kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
678 684
679define verify_kallsyms 685define verify_kallsyms
680 $(Q)$(if $($(quiet)cmd_sysmap), \ 686 $(Q)$(if $($(quiet)cmd_sysmap), \
681 echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \ 687 echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \
682 $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map 688 $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map
683 $(Q)cmp -s System.map .tmp_System.map || \ 689 $(Q)cmp -s System.map .tmp_System.map || \
684 (echo Inconsistent kallsyms data; \ 690 (echo Inconsistent kallsyms data; \
685 echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ 691 echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \
686 rm .tmp_kallsyms* ; /bin/false ) 692 rm .tmp_kallsyms* ; /bin/false )
687endef 693endef
688 694
@@ -736,6 +742,7 @@ endif # ifdef CONFIG_KALLSYMS
736# vmlinux image - including updated kernel symbols 742# vmlinux image - including updated kernel symbols
737vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 743vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
738 $(call if_changed_rule,vmlinux__) 744 $(call if_changed_rule,vmlinux__)
745 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
739 $(Q)rm -f .old_version 746 $(Q)rm -f .old_version
740 747
741# The actual objects are generated when descending, 748# The actual objects are generated when descending,
@@ -753,12 +760,34 @@ $(vmlinux-dirs): prepare scripts
753 $(Q)$(MAKE) $(build)=$@ 760 $(Q)$(MAKE) $(build)=$@
754 761
755# Build the kernel release string 762# Build the kernel release string
756# The KERNELRELEASE is stored in a file named include/config/kernel.release
757# to be used when executing for example make install or make modules_install
758# 763#
759# Take the contents of any files called localversion* and the config 764# The KERNELRELEASE value built here is stored in the file
760# variable CONFIG_LOCALVERSION and append them to KERNELRELEASE. 765# include/config/kernel.release, and is used when executing several
761# LOCALVERSION from the command line override all of this 766# make targets, such as "make install" or "make modules_install."
767#
768# The eventual kernel release string consists of the following fields,
769# shown in a hierarchical format to show how smaller parts are concatenated
770# to form the larger and final value, with values coming from places like
771# the Makefile, kernel config options, make command line options and/or
772# SCM tag information.
773#
774# $(KERNELVERSION)
775# $(VERSION) eg, 2
776# $(PATCHLEVEL) eg, 6
777# $(SUBLEVEL) eg, 18
778# $(EXTRAVERSION) eg, -rc6
779# $(localver-full)
780# $(localver)
781# localversion* (all localversion* files)
782# $(CONFIG_LOCALVERSION) (from kernel config setting)
783# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set)
784# ./scripts/setlocalversion (SCM tag, if one exists)
785# $(LOCALVERSION) (from make command line if provided)
786#
787# Note how the final $(localver-auto) string is included *only* if the
788# kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the
789# moment, only git is supported but other SCMs can edit the script
790# scripts/setlocalversion and add the appropriate checks as needed.
762 791
763nullstring := 792nullstring :=
764space := $(nullstring) # end of line 793space := $(nullstring) # end of line
@@ -892,15 +921,26 @@ depend dep:
892INSTALL_HDR_PATH=$(objtree)/usr 921INSTALL_HDR_PATH=$(objtree)/usr
893export INSTALL_HDR_PATH 922export INSTALL_HDR_PATH
894 923
924HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
925
926PHONY += headers_install_all
927headers_install_all: include/linux/version.h scripts_basic FORCE
928 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
929 $(Q)for arch in $(HDRARCHES); do \
930 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\
931 done
932
895PHONY += headers_install 933PHONY += headers_install
896headers_install: include/linux/version.h 934headers_install: include/linux/version.h scripts_basic FORCE
897 $(Q)unifdef -Ux /dev/null 935 @if [ ! -r include/asm-$(ARCH)/Kbuild ]; then \
898 $(Q)rm -rf $(INSTALL_HDR_PATH)/include 936 echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \
899 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include 937 exit 1 ; fi
938 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
939 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst obj=include
900 940
901PHONY += headers_check 941PHONY += headers_check
902headers_check: headers_install 942headers_check: headers_install
903 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1 943 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1
904 944
905# --------------------------------------------------------------------------- 945# ---------------------------------------------------------------------------
906# Modules 946# Modules
@@ -916,7 +956,7 @@ all: modules
916PHONY += modules 956PHONY += modules
917modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 957modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
918 @echo ' Building modules, stage 2.'; 958 @echo ' Building modules, stage 2.';
919 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost 959 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
920 960
921 961
922# Target to prepare building external modules 962# Target to prepare building external modules
@@ -942,7 +982,7 @@ _modinst_:
942 rm -f $(MODLIB)/build ; \ 982 rm -f $(MODLIB)/build ; \
943 ln -s $(objtree) $(MODLIB)/build ; \ 983 ln -s $(objtree) $(MODLIB)/build ; \
944 fi 984 fi
945 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst 985 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
946 986
947# If System.map exists, run depmod. This deliberately does not have a 987# If System.map exists, run depmod. This deliberately does not have a
948# dependency on System.map since that would run the dependency tree on 988# dependency on System.map since that would run the dependency tree on
@@ -1057,8 +1097,10 @@ boards := $(notdir $(boards))
1057 1097
1058help: 1098help:
1059 @echo 'Cleaning targets:' 1099 @echo 'Cleaning targets:'
1060 @echo ' clean - remove most generated files but keep the config' 1100 @echo ' clean - remove most generated files but keep the config and'
1101 @echo ' enough build support to build external modules'
1061 @echo ' mrproper - remove all generated files + config + various backup files' 1102 @echo ' mrproper - remove all generated files + config + various backup files'
1103 @echo ' distclean - mrproper + remove editor backup and patch files'
1062 @echo '' 1104 @echo ''
1063 @echo 'Configuration targets:' 1105 @echo 'Configuration targets:'
1064 @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help 1106 @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
@@ -1076,13 +1118,17 @@ help:
1076 @echo ' cscope - Generate cscope index' 1118 @echo ' cscope - Generate cscope index'
1077 @echo ' kernelrelease - Output the release version string' 1119 @echo ' kernelrelease - Output the release version string'
1078 @echo ' kernelversion - Output the version stored in Makefile' 1120 @echo ' kernelversion - Output the version stored in Makefile'
1079 @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH' 1121 @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
1122 echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
1123 fi
1080 @echo ' (default: $(INSTALL_HDR_PATH))' 1124 @echo ' (default: $(INSTALL_HDR_PATH))'
1081 @echo '' 1125 @echo ''
1082 @echo 'Static analysers' 1126 @echo 'Static analysers'
1083 @echo ' checkstack - Generate a list of stack hogs' 1127 @echo ' checkstack - Generate a list of stack hogs'
1084 @echo ' namespacecheck - Name space analysis on compiled kernel' 1128 @echo ' namespacecheck - Name space analysis on compiled kernel'
1085 @echo ' headers_check - Sanity check on exported headers' 1129 @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
1130 echo ' headers_check - Sanity check on exported headers'; \
1131 fi
1086 @echo '' 1132 @echo ''
1087 @echo 'Kernel packaging:' 1133 @echo 'Kernel packaging:'
1088 @$(MAKE) $(build)=$(package-dir) help 1134 @$(MAKE) $(build)=$(package-dir) help
@@ -1100,6 +1146,7 @@ help:
1100 echo '') 1146 echo '')
1101 1147
1102 @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' 1148 @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
1149 @echo ' make V=2 [targets] 2 => give reason for rebuild of target'
1103 @echo ' make O=dir [targets] Locate all output files in "dir", including .config' 1150 @echo ' make O=dir [targets] Locate all output files in "dir", including .config'
1104 @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' 1151 @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
1105 @echo ' make C=2 [targets] Force check of all c source with $$CHECK' 1152 @echo ' make C=2 [targets] Force check of all c source with $$CHECK'
@@ -1154,7 +1201,7 @@ $(module-dirs): crmodverdir $(objtree)/Module.symvers
1154 1201
1155modules: $(module-dirs) 1202modules: $(module-dirs)
1156 @echo ' Building modules, stage 2.'; 1203 @echo ' Building modules, stage 2.';
1157 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost 1204 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1158 1205
1159PHONY += modules_install 1206PHONY += modules_install
1160modules_install: _emodinst_ _emodinst_post 1207modules_install: _emodinst_ _emodinst_post
@@ -1163,7 +1210,7 @@ install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
1163PHONY += _emodinst_ 1210PHONY += _emodinst_
1164_emodinst_: 1211_emodinst_:
1165 $(Q)mkdir -p $(MODLIB)/$(install-dir) 1212 $(Q)mkdir -p $(MODLIB)/$(install-dir)
1166 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst 1213 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1167 1214
1168# Run depmod only is we have System.map and depmod is executable 1215# Run depmod only is we have System.map and depmod is executable
1169quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) 1216quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
@@ -1264,6 +1311,31 @@ define all-defconfigs
1264 $(call find-sources,'defconfig') 1311 $(call find-sources,'defconfig')
1265endef 1312endef
1266 1313
1314define xtags
1315 if $1 --version 2>&1 | grep -iq exuberant; then \
1316 $(all-sources) | xargs $1 -a \
1317 -I __initdata,__exitdata,__acquires,__releases \
1318 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1319 --extra=+f --c-kinds=+px; \
1320 $(all-kconfigs) | xargs $1 -a \
1321 --langdef=kconfig \
1322 --language-force=kconfig \
1323 --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
1324 $(all-defconfigs) | xargs $1 -a \
1325 --langdef=dotconfig \
1326 --language-force=dotconfig \
1327 --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
1328 elif $1 --version 2>&1 | grep -iq emacs; then \
1329 $(all-sources) | xargs $1 -a; \
1330 $(all-kconfigs) | xargs $1 -a \
1331 --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
1332 $(all-defconfigs) | xargs $1 -a \
1333 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1334 else \
1335 $(all-sources) | xargs $1 -a; \
1336 fi
1337endef
1338
1267quiet_cmd_cscope-file = FILELST cscope.files 1339quiet_cmd_cscope-file = FILELST cscope.files
1268 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files 1340 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
1269 1341
@@ -1277,31 +1349,16 @@ cscope: FORCE
1277quiet_cmd_TAGS = MAKE $@ 1349quiet_cmd_TAGS = MAKE $@
1278define cmd_TAGS 1350define cmd_TAGS
1279 rm -f $@; \ 1351 rm -f $@; \
1280 ETAGSF=`etags --version | grep -i exuberant >/dev/null && \ 1352 $(call xtags,etags)
1281 echo "-I __initdata,__exitdata,__acquires,__releases \
1282 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1283 --extra=+f --c-kinds=+px"`; \
1284 $(all-sources) | xargs etags $$ETAGSF -a; \
1285 if test "x$$ETAGSF" = x; then \
1286 $(all-kconfigs) | xargs etags -a \
1287 --regex='/^config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
1288 $(all-defconfigs) | xargs etags -a \
1289 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1290 fi
1291endef 1353endef
1292 1354
1293TAGS: FORCE 1355TAGS: FORCE
1294 $(call cmd,TAGS) 1356 $(call cmd,TAGS)
1295 1357
1296
1297quiet_cmd_tags = MAKE $@ 1358quiet_cmd_tags = MAKE $@
1298define cmd_tags 1359define cmd_tags
1299 rm -f $@; \ 1360 rm -f $@; \
1300 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && \ 1361 $(call xtags,ctags)
1301 echo "-I __initdata,__exitdata,__acquires,__releases \
1302 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1303 --extra=+f --c-kinds=+px"`; \
1304 $(all-sources) | xargs ctags $$CTAGSF -a
1305endef 1362endef
1306 1363
1307tags: FORCE 1364tags: FORCE
@@ -1379,7 +1436,7 @@ endif
1379%.ko: prepare scripts FORCE 1436%.ko: prepare scripts FORCE
1380 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1437 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1381 $(build)=$(build-dir) $(@:.ko=.o) 1438 $(build)=$(build-dir) $(@:.ko=.o)
1382 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost 1439 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1383 1440
1384# FIXME Should go into a make.lib or something 1441# FIXME Should go into a make.lib or something
1385# =========================================================================== 1442# ===========================================================================