aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGreg KH <gregkh@suse.de>2005-09-12 15:10:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-12 15:10:59 -0400
commitad2c10f8f00d3fe2e37dd8a107e7cf4ac0459489 (patch)
tree5571f6a5784f51efddf9c1ee0408894cd63a460f /Makefile
parent6b7839007098a6b5612d31690e11277d4242e6ae (diff)
parent2ade81473636b33aaac64495f89a7dc572c529f0 (diff)
Merge ../torvalds-2.6/
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile80
1 files changed, 40 insertions, 40 deletions
diff --git a/Makefile b/Makefile
index 63e5c9f0bc7a..45e5a38fbc7a 100644
--- a/Makefile
+++ b/Makefile
@@ -334,7 +334,7 @@ KALLSYMS = scripts/kallsyms
334PERL = perl 334PERL = perl
335CHECK = sparse 335CHECK = sparse
336 336
337CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ 337CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ $(CF)
338MODFLAGS = -DMODULE 338MODFLAGS = -DMODULE
339CFLAGS_MODULE = $(MODFLAGS) 339CFLAGS_MODULE = $(MODFLAGS)
340AFLAGS_MODULE = $(MODFLAGS) 340AFLAGS_MODULE = $(MODFLAGS)
@@ -382,6 +382,9 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV
382scripts_basic: 382scripts_basic:
383 $(Q)$(MAKE) $(build)=scripts/basic 383 $(Q)$(MAKE) $(build)=scripts/basic
384 384
385# To avoid any implicit rule to kick in, define an empty command.
386scripts/basic/%: scripts_basic ;
387
385.PHONY: outputmakefile 388.PHONY: outputmakefile
386# outputmakefile generate a Makefile to be placed in output directory, if 389# outputmakefile generate a Makefile to be placed in output directory, if
387# using a seperate output directory. This allows convinient use 390# using a seperate output directory. This allows convinient use
@@ -444,9 +447,8 @@ ifeq ($(config-targets),1)
444include $(srctree)/arch/$(ARCH)/Makefile 447include $(srctree)/arch/$(ARCH)/Makefile
445export KBUILD_DEFCONFIG 448export KBUILD_DEFCONFIG
446 449
447config: scripts_basic outputmakefile FORCE 450config %config: scripts_basic outputmakefile FORCE
448 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 451 $(Q)mkdir -p include/linux
449%config: scripts_basic outputmakefile FORCE
450 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 452 $(Q)$(MAKE) $(build)=scripts/kconfig $@
451 453
452else 454else
@@ -489,6 +491,7 @@ include .config
489# If .config is newer than include/linux/autoconf.h, someone tinkered 491# If .config is newer than include/linux/autoconf.h, someone tinkered
490# with it and forgot to run make oldconfig 492# with it and forgot to run make oldconfig
491include/linux/autoconf.h: .config 493include/linux/autoconf.h: .config
494 $(Q)mkdir -p include/linux
492 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 495 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
493else 496else
494# Dummy target needed, because used as prerequisite 497# Dummy target needed, because used as prerequisite
@@ -641,8 +644,13 @@ quiet_cmd_vmlinux__ ?= LD $@
641# Generate new vmlinux version 644# Generate new vmlinux version
642quiet_cmd_vmlinux_version = GEN .version 645quiet_cmd_vmlinux_version = GEN .version
643 cmd_vmlinux_version = set -e; \ 646 cmd_vmlinux_version = set -e; \
644 . $(srctree)/scripts/mkversion > .tmp_version; \ 647 if [ ! -r .version ]; then \
645 mv -f .tmp_version .version; \ 648 rm -f .version; \
649 echo 1 >.version; \
650 else \
651 mv .version .old_version; \
652 expr 0$$(cat .old_version) + 1 >.version; \
653 fi; \
646 $(MAKE) $(build)=init 654 $(MAKE) $(build)=init
647 655
648# Generate System.map 656# Generate System.map
@@ -756,6 +764,7 @@ endif # ifdef CONFIG_KALLSYMS
756# vmlinux image - including updated kernel symbols 764# vmlinux image - including updated kernel symbols
757vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 765vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
758 $(call if_changed_rule,vmlinux__) 766 $(call if_changed_rule,vmlinux__)
767 $(Q)rm -f .old_version
759 768
760# The actual objects are generated when descending, 769# The actual objects are generated when descending,
761# make sure no implicit rule kicks in 770# make sure no implicit rule kicks in
@@ -768,22 +777,27 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
768# Error messages still appears in the original language 777# Error messages still appears in the original language
769 778
770.PHONY: $(vmlinux-dirs) 779.PHONY: $(vmlinux-dirs)
771$(vmlinux-dirs): prepare-all scripts 780$(vmlinux-dirs): prepare scripts
772 $(Q)$(MAKE) $(build)=$@ 781 $(Q)$(MAKE) $(build)=$@
773 782
774# Things we need to do before we recursively start building the kernel 783# Things we need to do before we recursively start building the kernel
775# or the modules are listed in "prepare-all". 784# or the modules are listed in "prepare".
776# A multi level approach is used. prepare1 is updated first, then prepare0. 785# A multi level approach is used. prepareN is processed before prepareN-1.
777# prepare-all is the collection point for the prepare targets. 786# archprepare is used in arch Makefiles and when processed asm symlink,
787# version.h and scripts_basic is processed / created.
788
789# Listed in dependency order
790.PHONY: prepare archprepare prepare0 prepare1 prepare2 prepare3
778 791
779.PHONY: prepare-all prepare prepare0 prepare1 prepare2 792# prepare-all is deprecated, use prepare as valid replacement
793.PHONY: prepare-all
780 794
781# prepare2 is used to check if we are building in a separate output directory, 795# prepare3 is used to check if we are building in a separate output directory,
782# and if so do: 796# and if so do:
783# 1) Check that make has not been executed in the kernel src $(srctree) 797# 1) Check that make has not been executed in the kernel src $(srctree)
784# 2) Create the include2 directory, used for the second asm symlink 798# 2) Create the include2 directory, used for the second asm symlink
785 799
786prepare2: 800prepare3:
787ifneq ($(KBUILD_SRC),) 801ifneq ($(KBUILD_SRC),)
788 @echo ' Using $(srctree) as source for kernel' 802 @echo ' Using $(srctree) as source for kernel'
789 $(Q)if [ -f $(srctree)/.config ]; then \ 803 $(Q)if [ -f $(srctree)/.config ]; then \
@@ -795,18 +809,23 @@ ifneq ($(KBUILD_SRC),)
795 $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm 809 $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
796endif 810endif
797 811
798# prepare1 creates a makefile if using a separate output directory 812# prepare2 creates a makefile if using a separate output directory
799prepare1: prepare2 outputmakefile 813prepare2: prepare3 outputmakefile
800 814
801prepare0: prepare1 include/linux/version.h include/asm \ 815prepare1: prepare2 include/linux/version.h include/asm \
802 include/config/MARKER 816 include/config/MARKER
803ifneq ($(KBUILD_MODULES),) 817ifneq ($(KBUILD_MODULES),)
804 $(Q)rm -rf $(MODVERDIR) 818 $(Q)rm -rf $(MODVERDIR)
805 $(Q)mkdir -p $(MODVERDIR) 819 $(Q)mkdir -p $(MODVERDIR)
806endif 820endif
807 821
822archprepare: prepare1 scripts_basic
823
824prepare0: archprepare FORCE
825 $(Q)$(MAKE) $(build)=.
826
808# All the preparing.. 827# All the preparing..
809prepare-all: prepare0 prepare 828prepare prepare-all: prepare0
810 829
811# Leave this as default for preprocessing vmlinux.lds.S, which is now 830# Leave this as default for preprocessing vmlinux.lds.S, which is now
812# done in arch/$(ARCH)/kernel/Makefile 831# done in arch/$(ARCH)/kernel/Makefile
@@ -845,7 +864,7 @@ include/asm:
845 864
846# Split autoconf.h into include/linux/config/* 865# Split autoconf.h into include/linux/config/*
847 866
848include/config/MARKER: include/linux/autoconf.h 867include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h
849 @echo ' SPLIT include/linux/autoconf.h -> include/config/*' 868 @echo ' SPLIT include/linux/autoconf.h -> include/config/*'
850 @scripts/basic/split-include include/linux/autoconf.h include/config 869 @scripts/basic/split-include include/linux/autoconf.h include/config
851 @touch $@ 870 @touch $@
@@ -897,7 +916,7 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
897 916
898# Target to prepare building external modules 917# Target to prepare building external modules
899.PHONY: modules_prepare 918.PHONY: modules_prepare
900modules_prepare: prepare-all scripts 919modules_prepare: prepare scripts
901 920
902# Target to install modules 921# Target to install modules
903.PHONY: modules_install 922.PHONY: modules_install
@@ -949,26 +968,6 @@ modules modules_install: FORCE
949 968
950endif # CONFIG_MODULES 969endif # CONFIG_MODULES
951 970
952# Generate asm-offsets.h
953# ---------------------------------------------------------------------------
954
955define filechk_gen-asm-offsets
956 (set -e; \
957 echo "#ifndef __ASM_OFFSETS_H__"; \
958 echo "#define __ASM_OFFSETS_H__"; \
959 echo "/*"; \
960 echo " * DO NOT MODIFY."; \
961 echo " *"; \
962 echo " * This file was generated by arch/$(ARCH)/Makefile"; \
963 echo " *"; \
964 echo " */"; \
965 echo ""; \
966 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
967 echo ""; \
968 echo "#endif" )
969endef
970
971
972### 971###
973# Cleaning is done on three levels. 972# Cleaning is done on three levels.
974# make clean Delete most generated files 973# make clean Delete most generated files
@@ -991,7 +990,7 @@ MRPROPER_FILES += .config .config.old include/asm .version \
991# 990#
992clean: rm-dirs := $(CLEAN_DIRS) 991clean: rm-dirs := $(CLEAN_DIRS)
993clean: rm-files := $(CLEAN_FILES) 992clean: rm-files := $(CLEAN_FILES)
994clean-dirs := $(addprefix _clean_,$(vmlinux-alldirs)) 993clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
995 994
996.PHONY: $(clean-dirs) clean archclean 995.PHONY: $(clean-dirs) clean archclean
997$(clean-dirs): 996$(clean-dirs):
@@ -1070,6 +1069,7 @@ help:
1070 @echo ' rpm - Build a kernel as an RPM package' 1069 @echo ' rpm - Build a kernel as an RPM package'
1071 @echo ' tags/TAGS - Generate tags file for editors' 1070 @echo ' tags/TAGS - Generate tags file for editors'
1072 @echo ' cscope - Generate cscope index' 1071 @echo ' cscope - Generate cscope index'
1072 @echo ' kernelrelease - Output the release version string'
1073 @echo '' 1073 @echo ''
1074 @echo 'Static analysers' 1074 @echo 'Static analysers'
1075 @echo ' buildcheck - List dangling references to vmlinux discarded sections' 1075 @echo ' buildcheck - List dangling references to vmlinux discarded sections'