Back to home page

LXR

 
 

    


0001 #
0002 # This file is subject to the terms and conditions of the GNU General Public
0003 # License.  See the file "COPYING" in the main directory of this archive
0004 # for more details.
0005 #
0006 # This file is included by the global makefile so that you can add your own
0007 # architecture-specific flags and dependencies. Remember to do have actions
0008 # for "archclean" and "archdep" for cleaning up and making dependencies for
0009 # this architecture
0010 
0011 # If building with TILERA_ROOT set (i.e. using the Tilera Multicore
0012 # Development Environment) we can set CROSS_COMPILE based on that.
0013 # If we're not cross-compiling, make sure we're on the right architecture.
0014 # Only bother to test for a few common targets, to avoid useless errors.
0015 ifeq ($(CROSS_COMPILE),)
0016   ifdef TILERA_ROOT
0017     CROSS_COMPILE := $(TILERA_ROOT)/bin/tile-
0018   else
0019     goals := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)
0020     ifneq ($(strip $(filter vmlinux modules all,$(goals))),)
0021       HOST_ARCH := $(shell uname -m)
0022       ifneq ($(HOST_ARCH),$(ARCH))
0023 $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
0024       endif
0025     endif
0026   endif
0027 endif
0028 
0029 # The tile compiler may emit .eh_frame information for backtracing.
0030 # In kernel modules, this causes load failures due to unsupported relocations.
0031 KBUILD_CFLAGS   += -fno-asynchronous-unwind-tables
0032 
0033 LIBGCC_PATH     := \
0034   $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
0035 
0036 # Provide the path to use for "make defconfig".
0037 # We default to the newer TILE-Gx architecture if only "tile" is given.
0038 ifeq ($(ARCH),tile)
0039         KBUILD_DEFCONFIG := tilegx_defconfig
0040 else
0041         KBUILD_DEFCONFIG := $(ARCH)_defconfig
0042 endif
0043 
0044 # Used as a file extension when useful, e.g. head_$(BITS).o
0045 # Not needed for (e.g.) "$(CC) -m32" since the compiler automatically
0046 # uses the right default anyway.
0047 export BITS
0048 ifeq ($(CONFIG_TILEGX),y)
0049 BITS := 64
0050 else
0051 BITS := 32
0052 endif
0053 
0054 head-y          := arch/tile/kernel/head_$(BITS).o
0055 
0056 libs-y          += arch/tile/lib/
0057 libs-y          += $(LIBGCC_PATH)
0058 
0059 # See arch/tile/Kbuild for content of core part of the kernel
0060 core-y          += arch/tile/
0061 
0062 core-$(CONFIG_TILE_GXIO) += arch/tile/gxio/
0063 
0064 ifdef TILERA_ROOT
0065 INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot
0066 endif
0067 
0068 install:
0069         install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
0070         install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
0071         install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
0072 
0073 define archhelp
0074         echo '  install         - install kernel into $(INSTALL_PATH)'
0075 endef