2010-05-29 07:09:12 +04:00
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
# If building with TILERA_ROOT set (i.e. using the Tilera Multicore
# Development Environment) we can set CROSS_COMPILE based on that.
# If we're not cross-compiling, make sure we're on the right architecture.
2010-08-15 23:01:45 +04:00
# Only bother to test for a few common targets, to avoid useless errors.
2010-05-29 07:09:12 +04:00
i f e q ( $( CROSS_COMPILE ) , )
2010-08-15 23:01:45 +04:00
ifdef TILERA_ROOT
CROSS_COMPILE := $( TILERA_ROOT) /bin/tile-
else
goals := $( if $( MAKECMDGOALS) , $( MAKECMDGOALS) , all)
ifneq ( $( strip $( filter vmlinux modules all,$( goals) ) ) ,)
HOST_ARCH := $( shell uname -m)
ifneq ( $( HOST_ARCH) ,$( ARCH) )
2010-05-29 07:09:12 +04:00
$( error Set TILERA_ROOT or CROSS_COMPILE when building $ ( ARCH ) on $ ( HOST_ARCH ) )
2010-08-15 23:01:45 +04:00
endif
endif
endif
2010-05-29 07:09:12 +04:00
e n d i f
2010-10-14 23:16:59 +04:00
i f n e q ( $( CONFIG_DEBUG_EXTRA_FLAGS ) , "" )
2010-05-29 07:09:12 +04:00
KBUILD_CFLAGS += $( CONFIG_DEBUG_EXTRA_FLAGS)
2010-10-14 23:16:59 +04:00
e n d i f
2010-05-29 07:09:12 +04:00
LIBGCC_PATH := $( shell $( CC) $( KBUILD_CFLAGS) -print-libgcc-file-name)
# Provide the path to use for "make defconfig".
KBUILD_DEFCONFIG := $( ARCH) _defconfig
# Used as a file extension when useful, e.g. head_$(BITS).o
# Not needed for (e.g.) "$(CC) -m32" since the compiler automatically
# uses the right default anyway.
export BITS
i f e q ( $( CONFIG_TILEGX ) , y )
BITS := 64
e l s e
BITS := 32
e n d i f
head-y := arch/tile/kernel/head_$( BITS) .o
libs-y += arch/tile/lib/
libs-y += $( LIBGCC_PATH)
# See arch/tile/Kbuild for content of core part of the kernel
core-y += arch/tile/
2010-10-14 23:16:59 +04:00
2010-10-15 00:23:03 +04:00
core-$(CONFIG_KVM) += arch/tile/kvm/
2010-10-14 23:16:59 +04:00
i f d e f T I L E R A _ R O O T
INSTALL_PATH ?= $( TILERA_ROOT) /tile/boot
e n d i f
install :
install -D -m 755 vmlinux $( INSTALL_PATH) /vmlinux-$( KERNELRELEASE)
install -D -m 644 .config $( INSTALL_PATH) /config-$( KERNELRELEASE)
install -D -m 644 System.map $( INSTALL_PATH) /System.map-$( KERNELRELEASE)
d e f i n e a r c h h e l p
echo ' install - install kernel into $(INSTALL_PATH)'
e n d e f