Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 1 | # |
| 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 Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 11 | # If building with TILERA_ROOT set (i.e. using the Tilera Multicore |
| 12 | # Development Environment) we can set CROSS_COMPILE based on that. |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 13 | # If we're not cross-compiling, make sure we're on the right architecture. |
Chris Metcalf | a5854dd | 2010-08-15 15:01:45 -0400 | [diff] [blame] | 14 | # Only bother to test for a few common targets, to avoid useless errors. |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 15 | ifeq ($(CROSS_COMPILE),) |
Chris Metcalf | a5854dd | 2010-08-15 15:01:45 -0400 | [diff] [blame] | 16 | 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 Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 23 | $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) |
Chris Metcalf | a5854dd | 2010-08-15 15:01:45 -0400 | [diff] [blame] | 24 | endif |
| 25 | endif |
| 26 | endif |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 27 | endif |
| 28 | |
Chris Metcalf | 45123f7 | 2010-10-14 15:16:59 -0400 | [diff] [blame] | 29 | ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 30 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) |
Chris Metcalf | 45123f7 | 2010-10-14 15:16:59 -0400 | [diff] [blame] | 31 | endif |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 32 | |
Chris Metcalf | 6731aa9 | 2012-03-29 15:30:19 -0400 | [diff] [blame] | 33 | LIBGCC_PATH := \ |
| 34 | $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 35 | |
| 36 | # Provide the path to use for "make defconfig". |
Chris Metcalf | 1fcb78e | 2012-05-20 15:15:34 -0400 | [diff] [blame^] | 37 | # We default to the newer TILE-Gx architecture if only "tile" is given. |
| 38 | ifeq ($(ARCH),tile) |
| 39 | KBUILD_DEFCONFIG := tilegx_defconfig |
| 40 | else |
| 41 | KBUILD_DEFCONFIG := $(ARCH)_defconfig |
| 42 | endif |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 43 | |
| 44 | # Used as a file extension when useful, e.g. head_$(BITS).o |
| 45 | # Not needed for (e.g.) "$(CC) -m32" since the compiler automatically |
| 46 | # uses the right default anyway. |
| 47 | export BITS |
| 48 | ifeq ($(CONFIG_TILEGX),y) |
| 49 | BITS := 64 |
| 50 | else |
| 51 | BITS := 32 |
| 52 | endif |
| 53 | |
| 54 | head-y := arch/tile/kernel/head_$(BITS).o |
| 55 | |
| 56 | libs-y += arch/tile/lib/ |
| 57 | libs-y += $(LIBGCC_PATH) |
| 58 | |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 59 | # See arch/tile/Kbuild for content of core part of the kernel |
| 60 | core-y += arch/tile/ |
Chris Metcalf | 45123f7 | 2010-10-14 15:16:59 -0400 | [diff] [blame] | 61 | |
| 62 | ifdef TILERA_ROOT |
| 63 | INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot |
| 64 | endif |
| 65 | |
| 66 | install: |
| 67 | install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) |
| 68 | install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) |
| 69 | install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) |
| 70 | |
| 71 | define archhelp |
| 72 | echo ' install - install kernel into $(INSTALL_PATH)' |
| 73 | endef |