Xen used the i386 version this file, which was modified to support kexec.
[linux-2.6.git] / Makefile
index 5133b8b..ab6aae1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 10
-EXTRAVERSION = -1.12_FC2.1.planetlab
-NAME=AC 1
+SUBLEVEL = 12
+EXTRAVERSION = -1.1_1390_FC4.1.planetlab
+NAME=Woozy Numbat
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -18,7 +18,7 @@ MAKEFLAGS += --no-print-directory
 #
 # Most importantly: sub-Makefiles should only ever modify files in
 # their own directory. If in some directory we have a dependency on
-# a file in another dir (which doesn't happen often, but it's of
+# a file in another dir (which doesn't happen often, but it's often
 # unavoidable when linking the built-in.o targets which finally
 # turn into vmlinux), we will call a sub make in that other dir, and
 # after that we are sure that everything which is in that other dir
@@ -67,7 +67,7 @@ endif
 
 
 # kbuild supports saving output files in a separate directory.
-# To locate output files in a separate directory two syntax'es are supported.
+# To locate output files in a separate directory two syntaxes are supported.
 # In both cases the working directory must be the root of the kernel src.
 # 1) O=
 # Use "make O=dir/to/store/output/files/"
@@ -78,7 +78,8 @@ endif
 # export KBUILD_OUTPUT=dir/to/store/output/files/
 # make
 #
-# The O= assigment takes precedence over the KBUILD_OUTPUT environment variable.
+# The O= assignment takes precedence over the KBUILD_OUTPUT environment
+# variable.
 
 
 # KBUILD_SRC is set on invocation of make in OBJ directory
@@ -149,14 +150,13 @@ space      := $(nullstring) # end of line
 # careful not to include files twice if building in the source
 # directory. LOCALVERSION from the command line override all of this
 
-ifeq ($(objtree),$(srctree))
-localversion-files := $(wildcard $(srctree)/localversion*)
-else
-localversion-files := $(wildcard $(objtree)/localversion* $(srctree)/localversion*)
-endif
+localver := $(objtree)/localversion* $(srctree)/localversion*
+localver := $(sort $(wildcard $(localver)))
+# skip backup files (containing '~')
+localver := $(foreach f, $(localver), $(if $(findstring ~, $(f)),,$(f)))
 
 LOCALVERSION = $(subst $(space),, \
-              $(shell cat /dev/null $(localversion-files:%~=)) \
+              $(shell cat /dev/null $(localver)) \
               $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)
@@ -291,7 +291,7 @@ check_gcc = $(warning check_gcc is deprecated - use cc-option) \
             $(call cc-option, $(1),$(2))
 
 # cc-option-yn
-# Usage: flag := $(call gcc-option-yn, -march=winchip-c6)
+# Usage: flag := $(call cc-option-yn, -march=winchip-c6)
 cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
                 > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
 
@@ -331,6 +331,7 @@ DEPMOD              = /sbin/depmod
 KALLSYMS       = scripts/kallsyms
 PERL           = perl
 CHECK          = sparse
+
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__
 MODFLAGS       = -DMODULE
 CFLAGS_MODULE   = $(MODFLAGS)
@@ -339,7 +340,6 @@ LDFLAGS_MODULE  = -r
 CFLAGS_KERNEL  =
 AFLAGS_KERNEL  =
 
-NOSTDINC_FLAGS  = -nostdinc -iwithprefix include
 
 # Use LINUXINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
@@ -349,7 +349,8 @@ LINUXINCLUDE    := -Iinclude \
 CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE)
 
 CFLAGS                 := -Wall -Wstrict-prototypes -Wno-trigraphs \
-                  -fno-strict-aliasing -fno-common
+                  -fno-strict-aliasing -fno-common \
+                  -ffreestanding
 AFLAGS         := -D__ASSEMBLY__
 
 export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \
@@ -389,7 +390,7 @@ scripts_basic:
 # using a seperate output directory. This allows convinient use
 # of make in output directory
 outputmakefile:
-       $(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
+       $(Q)if test ! $(srctree) -ef $(objtree); then \
        $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile              \
            $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)         \
            > $(objtree)/Makefile;                                 \
@@ -532,22 +533,27 @@ endif
 
 include $(srctree)/arch/$(ARCH)/Makefile
 
+# arch Makefile may override CC so keep this after arch Makefile is included
+NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+CHECKFLAGS     += $(NOSTDINC_FLAGS)
+
 # warn about C99 declaration after statement
 CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
 
+# disable pointer signedness warnings in gcc 4.0
+CFLAGS += $(call cc-option,-Wno-pointer-sign,)
+
 # Default kernel image to build when no specific target is given.
 # KBUILD_IMAGE may be overruled on the commandline or
 # set in the environment
-# Also any assingments in arch/$(ARCH)/Makefiel take precedence over
+# Also any assignments in arch/$(ARCH)/Makefile take precedence over
 # this default value
 export KBUILD_IMAGE ?= vmlinux
 
 #
 # INSTALL_PATH specifies where to place the updated kernel and system map
-# images.  Uncomment if you want to place them anywhere other than root.
-#
-
-#export        INSTALL_PATH=/boot
+# images. Default is /boot, but you can set it to other values
+export INSTALL_PATH ?= /boot
 
 #
 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
@@ -897,7 +903,7 @@ depmod_opts := -b $(INSTALL_MOD_PATH) -r
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
-       if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+       if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
 
 else # CONFIG_MODULES
 
@@ -950,7 +956,7 @@ CLEAN_FILES +=      vmlinux System.map \
 MRPROPER_DIRS  += include/config include2
 MRPROPER_FILES += .config .config.old include/asm .version \
                   include/linux/autoconf.h include/linux/version.h \
-                  Module.symvers tags TAGS cscope*
+                  Module.symvers tags TAGS cscope* include/.asm-ignore
 
 # clean - Delete most, but leave enough to build external modules
 #
@@ -1095,9 +1101,17 @@ KBUILD_MODULES := 1
 crmodverdir:
        $(Q)mkdir -p $(MODVERDIR)
 
+.PHONY: $(objtree)/Module.symvers
+$(objtree)/Module.symvers:
+       @test -e $(objtree)/Module.symvers || ( \
+       echo; \
+       echo "  WARNING: Symbol version dump $(objtree)/Module.symvers"; \
+       echo "           is missing; modules will have no dependencies and modversions."; \
+       echo )
+
 module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
 .PHONY: $(module-dirs) modules
-$(module-dirs): crmodverdir
+$(module-dirs): crmodverdir $(objtree)/Module.symvers
        $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 
 modules: $(module-dirs)
@@ -1135,20 +1149,30 @@ endif # KBUILD_EXTMOD
 # Generate tags for editors
 # ---------------------------------------------------------------------------
 
+#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set
+#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file.
+#Adding $(srctree) adds about 20M on i386 to the size of the output file!
+
+ifeq ($(KBUILD_OUTPUT),)
+__srctree =
+else
+__srctree = $(srctree)/
+endif
+
 define all-sources
-       ( find $(srctree) $(RCS_FIND_IGNORE) \
+       ( find $(__srctree) $(RCS_FIND_IGNORE) \
               \( -name include -o -name arch \) -prune -o \
               -name '*.[chS]' -print; \
-         find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
+         find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
               -name '*.[chS]' -print; \
-         find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
+         find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
               -name '*.[chS]' -print; \
-         find $(srctree)/include $(RCS_FIND_IGNORE) \
+         find $(__srctree)include $(RCS_FIND_IGNORE) \
               \( -name config -o -name 'asm-*' \) -prune \
               -o -name '*.[chS]' -print; \
-         find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
+         find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
               -name '*.[chS]' -print; \
-         find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
+         find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
               -name '*.[chS]' -print )
 endef
 
@@ -1170,7 +1194,7 @@ cmd_TAGS = $(all-sources) | etags -
 quiet_cmd_tags = MAKE   $@
 define cmd_tags
        rm -f $@; \
-       CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
+       CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
        $(all-sources) | xargs ctags $$CTAGSF -a
 endef
 
@@ -1214,6 +1238,9 @@ checkstack:
        $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
        $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
+kernelrelease:
+       @echo $(KERNELRELEASE)
+
 # FIXME Should go into a make.lib or something 
 # ===========================================================================