aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-12-28 23:19:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-28 23:19:47 -0500
commite3c6d4ee545e427b55882d97d3b663c6411645fe (patch)
tree294326663fb757739a98083c2ddd570d1eaf7337 /Makefile
parent5bc053089376217943187ed5153d0d1e5c5085b6 (diff)
parent3c92ec8ae91ecf59d88c798301833d7cf83f2179 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: arch/sparc64/kernel/idprom.c
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile209
1 files changed, 67 insertions, 142 deletions
diff --git a/Makefile b/Makefile
index 7ec3b97336ca..d13a9694e159 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 28 3SUBLEVEL = 28
4EXTRAVERSION = -rc7 4EXTRAVERSION =
5NAME = Erotic Pickled Herring 5NAME = Erotic Pickled Herring
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -337,7 +337,7 @@ LINUXINCLUDE := -Iinclude \
337 -I$(srctree)/arch/$(hdr-arch)/include \ 337 -I$(srctree)/arch/$(hdr-arch)/include \
338 -include include/linux/autoconf.h 338 -include include/linux/autoconf.h
339 339
340KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) 340KBUILD_CPPFLAGS := -D__KERNEL__
341 341
342KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 342KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
343 -fno-strict-aliasing -fno-common \ 343 -fno-strict-aliasing -fno-common \
@@ -440,7 +440,11 @@ ifeq ($(config-targets),1)
440include $(srctree)/arch/$(SRCARCH)/Makefile 440include $(srctree)/arch/$(SRCARCH)/Makefile
441export KBUILD_DEFCONFIG KBUILD_KCONFIG 441export KBUILD_DEFCONFIG KBUILD_KCONFIG
442 442
443config %config: scripts_basic outputmakefile FORCE 443config: scripts_basic outputmakefile FORCE
444 $(Q)mkdir -p include/linux include/config
445 $(Q)$(MAKE) $(build)=scripts/kconfig $@
446
447%config: scripts_basic outputmakefile FORCE
444 $(Q)mkdir -p include/linux include/config 448 $(Q)mkdir -p include/linux include/config
445 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 449 $(Q)$(MAKE) $(build)=scripts/kconfig $@
446 450
@@ -601,20 +605,25 @@ export INSTALL_PATH ?= /boot
601MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 605MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
602export MODLIB 606export MODLIB
603 607
604# 608strip-symbols := $(srctree)/scripts/strip-symbols \
605# INSTALL_MOD_STRIP, if defined, will cause modules to be 609 $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols)
606# stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
607# the default option --strip-debug will be used. Otherwise,
608# INSTALL_MOD_STRIP will used as the options to the strip command.
609 610
611#
612# INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while
613# they get installed. If INSTALL_MOD_STRIP is '1', then the default
614# options (see below) will be used. Otherwise, INSTALL_MOD_STRIP will
615# be used as the option(s) to the objcopy command.
610ifdef INSTALL_MOD_STRIP 616ifdef INSTALL_MOD_STRIP
611ifeq ($(INSTALL_MOD_STRIP),1) 617ifeq ($(INSTALL_MOD_STRIP),1)
612mod_strip_cmd = $(STRIP) --strip-debug 618mod_strip_cmd = $(OBJCOPY) --strip-debug
619ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED))
620mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols))
621endif
613else 622else
614mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) 623mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP)
615endif # INSTALL_MOD_STRIP=1 624endif # INSTALL_MOD_STRIP=1
616else 625else
617mod_strip_cmd = true 626mod_strip_cmd = false
618endif # INSTALL_MOD_STRIP 627endif # INSTALL_MOD_STRIP
619export mod_strip_cmd 628export mod_strip_cmd
620 629
@@ -744,6 +753,7 @@ last_kallsyms := 2
744endif 753endif
745 754
746kallsyms.o := .tmp_kallsyms$(last_kallsyms).o 755kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
756kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h)
747 757
748define verify_kallsyms 758define verify_kallsyms
749 $(Q)$(if $($(quiet)cmd_sysmap), \ 759 $(Q)$(if $($(quiet)cmd_sysmap), \
@@ -768,24 +778,41 @@ endef
768 778
769# Generate .S file with all kernel symbols 779# Generate .S file with all kernel symbols
770quiet_cmd_kallsyms = KSYM $@ 780quiet_cmd_kallsyms = KSYM $@
771 cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ 781 cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \
772 $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ 782 | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@
773 783
774.tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE 784quiet_cmd_kstrip = STRIP $@
785 cmd_kstrip = $(OBJCOPY) --wildcard $(addprefix --strip$(if $(CONFIG_RELOCATABLE),-unneeded)-symbols ,$(filter %/scripts/strip-symbols,$^)) $< $@
786
787$(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): KBUILD_AFLAGS += -Wa,--strip-local-absolute
788$(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): %.o: %.S scripts FORCE
775 $(call if_changed_dep,as_o_S) 789 $(call if_changed_dep,as_o_S)
776 790
777.tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) 791ifeq ($(CONFIG_KALLSYMS_STRIP_GENERATED),y)
792strip-ext := .stripped
793endif
794
795.tmp_kallsyms%.S: .tmp_vmlinux%$(strip-ext) $(KALLSYMS) $(kallsyms.h)
778 $(call cmd,kallsyms) 796 $(call cmd,kallsyms)
779 797
798# make -jN seems to have problems with intermediate files, see bug #3330.
799.SECONDARY: $(foreach n,1 2 3,.tmp_vmlinux$(n).stripped)
800.tmp_vmlinux%.stripped: .tmp_vmlinux% $(strip-symbols) $(kallsyms.h)
801 $(call cmd,kstrip)
802
803ifneq ($(CONFIG_DEBUG_INFO),y)
804.tmp_vmlinux%: LDFLAGS_vmlinux += -S
805endif
780# .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version 806# .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version
781.tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE 807.tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE
782 $(call if_changed_rule,ksym_ld) 808 $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__))
783 809
784.tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE 810.tmp_vmlinux0$(strip-ext):
785 $(call if_changed,vmlinux__) 811 $(Q)echo "placeholder" >$@
786 812
787.tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE 813.tmp_vmlinux1: .tmp_kallsyms0.o
788 $(call if_changed,vmlinux__) 814.tmp_vmlinux2: .tmp_kallsyms1.o
815.tmp_vmlinux3: .tmp_kallsyms2.o
789 816
790# Needs to visit scripts/ before $(KALLSYMS) can be used. 817# Needs to visit scripts/ before $(KALLSYMS) can be used.
791$(KALLSYMS): scripts ; 818$(KALLSYMS): scripts ;
@@ -927,7 +954,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
927# 2) Create the include2 directory, used for the second asm symlink 954# 2) Create the include2 directory, used for the second asm symlink
928prepare3: include/config/kernel.release 955prepare3: include/config/kernel.release
929ifneq ($(KBUILD_SRC),) 956ifneq ($(KBUILD_SRC),)
930 @echo ' Using $(srctree) as source for kernel' 957 @$(kecho) ' Using $(srctree) as source for kernel'
931 $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ 958 $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
932 echo " $(srctree) is not clean, please run 'make mrproper'";\ 959 echo " $(srctree) is not clean, please run 'make mrproper'";\
933 echo " in the '$(srctree)' directory.";\ 960 echo " in the '$(srctree)' directory.";\
@@ -984,7 +1011,7 @@ endef
984# directory for generated filesas used by some architectures. 1011# directory for generated filesas used by some architectures.
985define create-symlink 1012define create-symlink
986 if [ ! -L include/asm ]; then \ 1013 if [ ! -L include/asm ]; then \
987 echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ 1014 $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
988 if [ ! -d include/asm-$(SRCARCH) ]; then \ 1015 if [ ! -d include/asm-$(SRCARCH) ]; then \
989 mkdir -p include/asm-$(SRCARCH); \ 1016 mkdir -p include/asm-$(SRCARCH); \
990 fi; \ 1017 fi; \
@@ -1023,6 +1050,10 @@ include/linux/version.h: $(srctree)/Makefile FORCE
1023include/linux/utsrelease.h: include/config/kernel.release FORCE 1050include/linux/utsrelease.h: include/config/kernel.release FORCE
1024 $(call filechk,utsrelease.h) 1051 $(call filechk,utsrelease.h)
1025 1052
1053PHONY += headerdep
1054headerdep:
1055 $(Q)find include/ -name '*.h' | xargs --max-args 1 scripts/headerdep.pl
1056
1026# --------------------------------------------------------------------------- 1057# ---------------------------------------------------------------------------
1027 1058
1028PHONY += depend dep 1059PHONY += depend dep
@@ -1097,7 +1128,7 @@ all: modules
1097PHONY += modules 1128PHONY += modules
1098modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1129modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
1099 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1130 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1100 @echo ' Building modules, stage 2.'; 1131 @$(kecho) ' Building modules, stage 2.';
1101 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1132 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1102 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild 1133 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
1103 1134
@@ -1271,7 +1302,8 @@ help:
1271 @echo ' versioncheck - Sanity check on version.h usage' 1302 @echo ' versioncheck - Sanity check on version.h usage'
1272 @echo ' includecheck - Check for duplicate included header files' 1303 @echo ' includecheck - Check for duplicate included header files'
1273 @echo ' export_report - List the usages of all exported symbols' 1304 @echo ' export_report - List the usages of all exported symbols'
1274 @echo ' headers_check - Sanity check on exported headers'; \ 1305 @echo ' headers_check - Sanity check on exported headers'
1306 @echo ' headerdep - Detect inclusion cycles in headers'; \
1275 echo '' 1307 echo ''
1276 @echo 'Kernel packaging:' 1308 @echo 'Kernel packaging:'
1277 @$(MAKE) $(build)=$(package-dir) help 1309 @$(MAKE) $(build)=$(package-dir) help
@@ -1361,7 +1393,7 @@ $(module-dirs): crmodverdir $(objtree)/Module.symvers
1361 $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) 1393 $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
1362 1394
1363modules: $(module-dirs) 1395modules: $(module-dirs)
1364 @echo ' Building modules, stage 2.'; 1396 @$(kecho) ' Building modules, stage 2.';
1365 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1397 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1366 1398
1367PHONY += modules_install 1399PHONY += modules_install
@@ -1410,123 +1442,12 @@ endif # KBUILD_EXTMOD
1410 1442
1411# Generate tags for editors 1443# Generate tags for editors
1412# --------------------------------------------------------------------------- 1444# ---------------------------------------------------------------------------
1445quiet_cmd_tags = GEN $@
1446 cmd_tags = $(CONFIG_SHELL) $(srctree)/scripts/tags.sh $@
1413 1447
1414#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set 1448tags TAGS cscope: FORCE
1415#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file.
1416#Adding $(srctree) adds about 20M on i386 to the size of the output file!
1417
1418ifeq ($(src),$(obj))
1419__srctree =
1420else
1421__srctree = $(srctree)/
1422endif
1423
1424ifeq ($(ALLSOURCE_ARCHS),)
1425ifeq ($(ARCH),um)
1426ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
1427else
1428ALLINCLUDE_ARCHS := $(SRCARCH)
1429endif
1430else
1431#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour.
1432ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
1433endif
1434
1435ALLSOURCE_ARCHS := $(SRCARCH)
1436
1437define find-sources
1438 ( for arch in $(ALLSOURCE_ARCHS) ; do \
1439 find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
1440 -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
1441 -o -name $1 -print; \
1442 done ; \
1443 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
1444 -name $1 -print; \
1445 find $(__srctree)include $(RCS_FIND_IGNORE) \
1446 \( -name config -o -name 'asm-*' \) -prune \
1447 -o -name $1 -print; \
1448 for arch in $(ALLINCLUDE_ARCHS) ; do \
1449 test -e $(__srctree)include/asm-$${arch} && \
1450 find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
1451 -name $1 -print; \
1452 test -e $(__srctree)arch/$${arch}/include/asm && \
1453 find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \
1454 -name $1 -print; \
1455 done ; \
1456 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
1457 -name $1 -print; \
1458 find $(__srctree) $(RCS_FIND_IGNORE) \
1459 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
1460 -name $1 -print; \
1461 )
1462endef
1463
1464define all-sources
1465 $(call find-sources,'*.[chS]')
1466endef
1467define all-kconfigs
1468 $(call find-sources,'Kconfig*')
1469endef
1470define all-defconfigs
1471 $(call find-sources,'defconfig')
1472endef
1473
1474define xtags
1475 if $1 --version 2>&1 | grep -iq exuberant; then \
1476 $(all-sources) | xargs $1 -a \
1477 -I __initdata,__exitdata,__acquires,__releases \
1478 -I __read_mostly,____cacheline_aligned,____cacheline_aligned_in_smp,____cacheline_internodealigned_in_smp \
1479 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
1480 --extra=+f --c-kinds=+px \
1481 --regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \
1482 $(all-kconfigs) | xargs $1 -a \
1483 --langdef=kconfig \
1484 --language-force=kconfig \
1485 --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'; \
1486 $(all-defconfigs) | xargs -r $1 -a \
1487 --langdef=dotconfig \
1488 --language-force=dotconfig \
1489 --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
1490 elif $1 --version 2>&1 | grep -iq emacs; then \
1491 $(all-sources) | xargs $1 -a; \
1492 $(all-kconfigs) | xargs $1 -a \
1493 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'; \
1494 $(all-defconfigs) | xargs -r $1 -a \
1495 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1496 else \
1497 $(all-sources) | xargs $1 -a; \
1498 fi
1499endef
1500
1501quiet_cmd_cscope-file = FILELST cscope.files
1502 cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
1503
1504quiet_cmd_cscope = MAKE cscope.out
1505 cmd_cscope = cscope -b -f cscope.out
1506
1507cscope: FORCE
1508 $(call cmd,cscope-file)
1509 $(call cmd,cscope)
1510
1511quiet_cmd_TAGS = MAKE $@
1512define cmd_TAGS
1513 rm -f $@; \
1514 $(call xtags,etags)
1515endef
1516
1517TAGS: FORCE
1518 $(call cmd,TAGS)
1519
1520quiet_cmd_tags = MAKE $@
1521define cmd_tags
1522 rm -f $@; \
1523 $(call xtags,ctags)
1524endef
1525
1526tags: FORCE
1527 $(call cmd,tags) 1449 $(call cmd,tags)
1528 1450
1529
1530# Scripts to check various things for consistency 1451# Scripts to check various things for consistency
1531# --------------------------------------------------------------------------- 1452# ---------------------------------------------------------------------------
1532 1453
@@ -1605,7 +1526,11 @@ endif
1605 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) 1526 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1606 1527
1607# Modules 1528# Modules
1608/ %/: prepare scripts FORCE 1529/: prepare scripts FORCE
1530 $(cmd_crmodverdir)
1531 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1532 $(build)=$(build-dir)
1533%/: prepare scripts FORCE
1609 $(cmd_crmodverdir) 1534 $(cmd_crmodverdir)
1610 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1535 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1611 $(build)=$(build-dir) 1536 $(build)=$(build-dir)
@@ -1639,7 +1564,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
1639 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) 1564 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
1640 1565
1641a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1566a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1642 $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ 1567 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \
1643 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) 1568 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
1644 1569
1645quiet_cmd_as_o_S = AS $@ 1570quiet_cmd_as_o_S = AS $@