blob: 99f461d8d9da176882899394fa1e6a93f6d42b15 [file] [log] [blame]
Chris Metcalf867e3592010-05-28 23:09:12 -04001#
2# This file is subject to the terms and conditions of the GNU General Public
3# License. See the file "COPYING" in the main directory of this archive
4# for more details.
5#
6# This file is included by the global makefile so that you can add your own
7# architecture-specific flags and dependencies. Remember to do have actions
8# for "archclean" and "archdep" for cleaning up and making dependencies for
9# this architecture
10
Chris Metcalf867e3592010-05-28 23:09:12 -040011# If building with TILERA_ROOT set (i.e. using the Tilera Multicore
12# Development Environment) we can set CROSS_COMPILE based on that.
Chris Metcalf867e3592010-05-28 23:09:12 -040013# If we're not cross-compiling, make sure we're on the right architecture.
Chris Metcalfa5854dd2010-08-15 15:01:45 -040014# Only bother to test for a few common targets, to avoid useless errors.
Chris Metcalf867e3592010-05-28 23:09:12 -040015ifeq ($(CROSS_COMPILE),)
Chris Metcalfa5854dd2010-08-15 15:01:45 -040016 ifdef TILERA_ROOT
17 CROSS_COMPILE := $(TILERA_ROOT)/bin/tile-
18 else
19 goals := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)
20 ifneq ($(strip $(filter vmlinux modules all,$(goals))),)
21 HOST_ARCH := $(shell uname -m)
22 ifneq ($(HOST_ARCH),$(ARCH))
Chris Metcalf867e3592010-05-28 23:09:12 -040023$(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
Chris Metcalfa5854dd2010-08-15 15:01:45 -040024 endif
25 endif
26 endif
Chris Metcalf867e3592010-05-28 23:09:12 -040027endif
28
Chris Metcalf75383fac92012-10-19 11:43:11 -040029# The tile compiler may emit .eh_frame information for backtracing.
30# In kernel modules, this causes load failures due to unsupported relocations.
31KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
32
Chris Metcalf45123f72010-10-14 15:16:59 -040033ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"")
Chris Metcalf867e3592010-05-28 23:09:12 -040034KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS)
Chris Metcalf45123f72010-10-14 15:16:59 -040035endif
Chris Metcalf867e3592010-05-28 23:09:12 -040036
Chris Metcalf6731aa92012-03-29 15:30:19 -040037LIBGCC_PATH := \
38 $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
Chris Metcalf867e3592010-05-28 23:09:12 -040039
40# Provide the path to use for "make defconfig".
41KBUILD_DEFCONFIG := $(ARCH)_defconfig
42
43# Used as a file extension when useful, e.g. head_$(BITS).o
44# Not needed for (e.g.) "$(CC) -m32" since the compiler automatically
45# uses the right default anyway.
46export BITS
47ifeq ($(CONFIG_TILEGX),y)
48BITS := 64
49else
50BITS := 32
51endif
52
53head-y := arch/tile/kernel/head_$(BITS).o
54
55libs-y += arch/tile/lib/
56libs-y += $(LIBGCC_PATH)
57
Chris Metcalf867e3592010-05-28 23:09:12 -040058# See arch/tile/Kbuild for content of core part of the kernel
59core-y += arch/tile/
Chris Metcalf45123f72010-10-14 15:16:59 -040060
61ifdef TILERA_ROOT
62INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot
63endif
64
65install:
66 install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
67 install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
68 install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
69
70define archhelp
71 echo ' install - install kernel into $(INSTALL_PATH)'
72endef