Commit | Line | Data |
---|---|---|
867e359b CM |
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 | ||
867e359b CM |
11 | # If building with TILERA_ROOT set (i.e. using the Tilera Multicore |
12 | # Development Environment) we can set CROSS_COMPILE based on that. | |
867e359b | 13 | # If we're not cross-compiling, make sure we're on the right architecture. |
a5854dd7 | 14 | # Only bother to test for a few common targets, to avoid useless errors. |
867e359b | 15 | ifeq ($(CROSS_COMPILE),) |
a5854dd7 CM |
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)) | |
867e359b | 23 | $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) |
a5854dd7 CM |
24 | endif |
25 | endif | |
26 | endif | |
867e359b CM |
27 | endif |
28 | ||
627072b0 CM |
29 | # The tile compiler may emit .eh_frame information for backtracing. |
30 | # In kernel modules, this causes load failures due to unsupported relocations. | |
31 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | |
32 | ||
45123f7e | 33 | ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") |
867e359b | 34 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) |
45123f7e | 35 | endif |
867e359b | 36 | |
6731aa9e CM |
37 | LIBGCC_PATH := \ |
38 | $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) | |
867e359b CM |
39 | |
40 | # Provide the path to use for "make defconfig". | |
1fcb78e9 CM |
41 | # We default to the newer TILE-Gx architecture if only "tile" is given. |
42 | ifeq ($(ARCH),tile) | |
43 | KBUILD_DEFCONFIG := tilegx_defconfig | |
44 | else | |
45 | KBUILD_DEFCONFIG := $(ARCH)_defconfig | |
46 | endif | |
867e359b CM |
47 | |
48 | # Used as a file extension when useful, e.g. head_$(BITS).o | |
49 | # Not needed for (e.g.) "$(CC) -m32" since the compiler automatically | |
50 | # uses the right default anyway. | |
51 | export BITS | |
52 | ifeq ($(CONFIG_TILEGX),y) | |
53 | BITS := 64 | |
54 | else | |
55 | BITS := 32 | |
56 | endif | |
57 | ||
58 | head-y := arch/tile/kernel/head_$(BITS).o | |
59 | ||
60 | libs-y += arch/tile/lib/ | |
61 | libs-y += $(LIBGCC_PATH) | |
62 | ||
867e359b CM |
63 | # See arch/tile/Kbuild for content of core part of the kernel |
64 | core-y += arch/tile/ | |
45123f7e | 65 | |
37b82b5d CM |
66 | core-$(CONFIG_TILE_GXIO) += arch/tile/gxio/ |
67 | ||
45123f7e CM |
68 | ifdef TILERA_ROOT |
69 | INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot | |
70 | endif | |
71 | ||
72 | install: | |
73 | install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) | |
74 | install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) | |
75 | install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) | |
76 | ||
77 | define archhelp | |
78 | echo ' install - install kernel into $(INSTALL_PATH)' | |
79 | endef |