repository.
summaryrefslogblamecommitdiffstats
path: root/Makefile
blob: 0d46615bffe5c95704a83cfb7cdf82d2fa792c48 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

              
             
                   
                                    






                                                                  

                                            
                                                                     

                                     



















                                                                    

                                    




                     








                                                                     
 

                                    










                                                                 
 


                                    





                                                                            
 















                                                                       

                                    


                                                                  
             

     


                                       






                                                                          
 

                                 
                                                                              


               

                                                                 

                                                                










                                                                             
            






                                                              



                             
                                                                     
 
                            
 








                                                                            
                                                                          
                                                                         
                                                      


















                                                                             
                                     



                                      

                          
 






                                  
 
                                    
                      
                       
     
 




                                 


                                       



                        

                          




                                                               



                                                                 
 

                                                     






                                                                         
                                                                     
















                                                             
                                    













                                                                             
                                                                  

                                                  
                                                                  























                                                                   



                                                            

                                                                   
                                         


















                                           

                                                                    


                             
                 

                 
                                                




                                                                  
                                                                        

                                                                        
 
                               
 
                                                                     
                                                     
                                                          

                                                  
                                 
 

                                                                       
                                                                   
 
                                                              
                                                                         

                                                                         
 
                                                                       
                                                            
                                                





                                                                                      

                                        

                                                                                                                                   




                                                                             
                      


                                          


                                                                 
                       


                                                                         
               
                      
                                     


                                                           




                                                                       
                                   


                                                                       
                                                   
                                                             

                                                            




































                                                                             
                                           
                                      
 




                                                 
                                                 









                                                                             
             
                
                                               

                                 

                                                              
                                            





                       

                                 
 
                        

                                                              
                                     
 
                                                                
                                                 
 
                                                                     
                                           
                                                                       
                                                                      
                                                                        

                                                          













                                                                                         
 

                                                   
                           
                     



                                                                            
                                                                    


                                 
                      
    
                      

     

                                           
                              


                                                                           
                                                          
                               
                                                        
     
 
                          
                                                                      
    
                                       


                       
                     
                            

     
                            


                      




                                                                     
                                                                            
                                                                            

                                   
                                            
                                                                 
 
                                                       
                                                     
 
                                                                  
                                                         
 


                                                        
                                                                       















                                                                                        
 





                                                                        



                                 
                                                                 
                                                      












                                                                         
                                                            

 
                                                          

             
 




                                                                        

                             
                                      
    
                                             

                           
                    


                         

                        
                                                                



















                                                                             
                                                                   
                                                                       
                                                                    
























                                                                          
                                                  
                                            






                                                                  
                                                                                      



                                                         






                                                         


                             
                         




                                                               

                                                                            
                     
         




                                                                





                                                                              































                                                                            

                                                                              
                                                                    


                                                                              




                                                              
                                                                 

                              
          






                                                                

                                                                    
 
                                                                          

                                     
                                           


                                                                           

                                                  
 

                                                                   
 

                                                                   



                                                         









                                                                                           

                             




                                                                                
                                                                






                                                                       
                                                  
                                                                                     
                          
                                                        
     


                                    


                                          
                               
                                         
                              
 
                                                              


                        


                                                              

                                               









                                                                         
                        
                                

                               
                                 
 
















                                                                           
                                                                               








                                                                                 
 

                                 
                                                                                
 

                                                                       
 

                                                                      
                                                 
 


                                                                         
                              







                                                                       




                                                         
                                                                  
                                                
                                                             

                                      

 
                                                                      



                                                                          
 
                            
                                                                
 
                                                                              


                                                                       
                                       
                      
                                                           
                                                                                



                                                                              

                                                                         
                                                                         
          

     

                                                                  
 

                                                                       
                          
 


                                   
                              
                                               
 
                     
                 
 

                                                                     


                                              

                                               
                                                                        




                                                                            

                                                                                                               

                                                                            



                                                                            
          


                                                          
                                                            


                                                                            
                                                                            



                                                                            
          




                             
 






                                                                             






                                                                           

                        


                                                                               

     
                                                  

                                 


                                                               



                                                                               

                                                                             
                   



                                                                             









                                                                                   
                
 

                                        
 
                                                              







                                                                               


                                                      
                                                    

                            

                                                                 
 
                        
                          

                                                                        
                                       
                                                     
 

                                      
                                                               
 

                              
                                                  
                                                                
 
                                                                             



                    
                                   



                     



                                                                   
 
                
                                                        
                                                                                                      
                                                 
                                                          
                                                                                    


                                             
                        
                                

                           
                        

                                        
                  
          
                                                                                











                                                                                     
                                                  
                                                          
 
                                                         

                                                                      
                      
                        
                                                                                   
                          















                                                                             












                                                                              
                                                                       
                                                                         

                                                                         
                                                                         
                                                                 




                                                                 
                                                                                   
 
                                      






                                                      
                                                                      
                                                                      
                                                                

                                                                 






                                                                           
                                               








                                                         
                  


                                             
                                                                  
                                                                    
                                              








                                                                             
                                         
                                              
                                        
                                              




                                                                             
                                                                    
                             

                                                                                 


                                  
                                                                                        
                                                                                   
                                                                                               
                                                                                    







                                                                      
                                                                                         

                                                                                 

                                                                     
                                                                      
                                                                         

                                                                   
                                                                      
                                                                          
                                                                                            
                                                                      
                 
                                 

                                                                           
                                                                    
                                                                              
                                                                            

                                                                          
                 
                                  
                                             



                                                                     
                                                            
                                       
                                                                              




                                                                                     




                                                                                 

                                                                                      
                                                                              
                                                                                           

                                                                                           




                                                                                   













                                                                                        




















                                                                             
                                                                        



                                                                   
                    
            
                          
 
                                  







                                                                                           
                               



                                                       
                                                 
                                                          
 
                        
                                          
 

                                                                
           
                                             
                                                          
 
                       


                          

                                                   
                            



                                                      


                                                    

                          
                           
                                                   
                                                                      

                                                                      








                                                                                    

            
                        

          



                                                                             

                                                              
 
                       

                        


                                                                             


                                                       
                                                                      



                                                       
                                                                     
 


                                               


                                                   


                                 
                                               
 








                                                                      

                                                         
                                                               

              

                                                                                    
              
                              
 

                                                                             
                                     
                                      






                                                       
                                               






                                                                     
                              
                                                                   
                              
                                                                   
                              
                                                                   
                                
                                                                   
                              
                                                                   
                              
                                                                   

                                                                   
 
         




                                                              
                          
                                                              

                             
                          
                                                                
                                         
                                                          
 








                                                                                 
                                                                

                                           
                                                                                 
                                                                                 
                                                                                 


                                                                                 
                                               


                                                                
 
                                                                
                                                                
                                                                     













                                                                                      




                                                                     

                       
              
      
 
                                                                     
                                                                       
                
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 31
EXTRAVERSION = -rc5
NAME = Man-Eating Seals of Antiquity

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.

# Do not:
# o  use make's built-in rules and variables
#    (this increases performance and avoids hard-to-debug behaviour);
# o  print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory

# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
#
# 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 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
# is now up to date.
#
# The only cases where we need to modify files which have global
# effects are thus separated out and done before the recursive
# descending is started. They are now explicitly listed as the
# prepare rule.

# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands

ifeq ("$(origin V)", "command line")
  KBUILD_VERBOSE = $(V)
endif
ifndef KBUILD_VERBOSE
  KBUILD_VERBOSE = 0
endif

# Call a source code checker (by default, "sparse") as part of the
# C compilation.
#
# Use 'make C=1' to enable checking of only re-compiled files.
# Use 'make C=2' to enable checking of *all* source files, regardless
# of whether they are re-compiled or not.
#
# See the file "Documentation/sparse.txt" for more details, including
# where to get the "sparse" utility.

ifeq ("$(origin C)", "command line")
  KBUILD_CHECKSRC = $(C)
endif
ifndef KBUILD_CHECKSRC
  KBUILD_CHECKSRC = 0
endif

# Use make M=dir to specify directory of external module to build
# Old syntax make ... SUBDIRS=$PWD is still supported
# Setting the environment variable KBUILD_EXTMOD take precedence
ifdef SUBDIRS
  KBUILD_EXTMOD ?= $(SUBDIRS)
endif

ifeq ("$(origin M)", "command line")
  KBUILD_EXTMOD := $(M)
endif

# kbuild supports saving output files in a separate directory.
# 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/"
#
# 2) Set KBUILD_OUTPUT
# Set the environment variable KBUILD_OUTPUT to point to the directory
# where the output files shall be placed.
# export KBUILD_OUTPUT=dir/to/store/output/files/
# make
#
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.


# KBUILD_SRC is set on invocation of make in OBJ directory
# KBUILD_SRC is not intended to be used by the regular user (for now)
ifeq ($(KBUILD_SRC),)

# OK, Make called in directory where kernel src resides
# Do we want to locate output files in a separate directory?
ifeq ("$(origin O)", "command line")
  KBUILD_OUTPUT := $(O)
endif

# That's our default target when none is given on the command line
PHONY := _all
_all:

# Cancel implicit rules on top Makefile
$(CURDIR)/Makefile Makefile: ;

ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(KBUILD_OUTPUT),, \
     $(error output directory "$(saved-output)" does not exist))

PHONY += $(MAKECMDGOALS) sub-make

$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
	$(Q)@:

sub-make: FORCE
	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
	KBUILD_SRC=$(CURDIR) \
	KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
	$(filter-out _all sub-make,$(MAKECMDGOALS))

# Leave processing to above invocation of make
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)

# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

# If building an external module we do not care about the all: rule
# but instead _all depend on modules
PHONY += all
ifeq ($(KBUILD_EXTMOD),)
_all: all
else
_all: modules
endif

srctree		:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
objtree		:= $(CURDIR)
src		:= $(srctree)
obj		:= $(objtree)

VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))

export srctree objtree VPATH


# SUBARCH tells the usermode build what the underlying arch is.  That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
# line overrides the setting of ARCH below.  If a native build is happening,
# then ARCH is assigned, getting whatever value it gets normally, and 
# SUBARCH is subsequently ignored.

SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
				  -e s/arm.*/arm/ -e s/sa110/arm/ \
				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
				  -e s/sh[234].*/sh/ )

# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.

# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH		?= $(SUBARCH)
CROSS_COMPILE	?=

# Architecture as present in compile.h
UTS_MACHINE 	:= $(ARCH)
SRCARCH 	:= $(ARCH)

# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
        SRCARCH := x86
endif
ifeq ($(ARCH),x86_64)
        SRCARCH := x86
endif

# Additional ARCH settings for sparc
ifeq ($(ARCH),sparc64)
       SRCARCH := sparc
endif

# Additional ARCH settings for sh
ifeq ($(ARCH),sh64)
       SRCARCH := sh
endif

# Where to locate arch specific headers
hdr-arch  := $(SRCARCH)

ifeq ($(ARCH),m68knommu)
       hdr-arch  := m68k
endif

KCONFIG_CONFIG	?= .config

# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
	  else if [ -x /bin/bash ]; then echo /bin/bash; \
	  else echo sh; fi ; fi)

HOSTCC       = gcc
HOSTCXX      = g++
HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2

# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.

KBUILD_MODULES :=
KBUILD_BUILTIN := 1

#	If we have only "make modules", don't compile built-in objects.
#	When we're building modules with modversions, we need to consider
#	the built-in objects during the descend as well, in order to
#	make sure the checksums are up to date before we record them.

ifeq ($(MAKECMDGOALS),modules)
  KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
endif

#	If we have "make <whatever> modules", compile modules