Commit | Line | Data |
---|---|---|
8e1a6dd2 CZ |
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 | # Copyright (C) 2001 - 2005 Tensilica Inc. | |
420ae951 | 7 | # Copyright (C) 2014 Cadence Design Systems Inc. |
8e1a6dd2 CZ |
8 | # |
9 | # This file is included by the global makefile so that you can add your own | |
8212f898 | 10 | # architecture-specific flags and dependencies. |
8e1a6dd2 CZ |
11 | |
12 | # Core configuration. | |
173d6681 | 13 | # (Use VAR=<xtensa_config> to use another default compiler.) |
8e1a6dd2 | 14 | |
129ab0d2 | 15 | variant-y := $(CONFIG_XTENSA_VARIANT_NAME) |
8e1a6dd2 | 16 | |
173d6681 | 17 | VARIANT = $(variant-y) |
8e1a6dd2 | 18 | |
70cefe76 | 19 | ifneq ($(VARIANT),) |
23243c1a | 20 | ifdef cross_compiling |
70cefe76 GU |
21 | ifndef CROSS_COMPILE |
22 | CROSS_COMPILE = xtensa_$(VARIANT)- | |
23 | endif | |
24 | endif | |
25 | endif | |
26 | ||
8e1a6dd2 CZ |
27 | # Platform configuration |
28 | ||
8e1a6dd2 CZ |
29 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 |
30 | platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss | |
0d456bad | 31 | platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga |
8e1a6dd2 | 32 | |
b2444d34 | 33 | # temporarily until string.h is fixed |
a753cd9a | 34 | KBUILD_CFLAGS += -ffreestanding -D__linux__ |
f8f02ca7 | 35 | KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals |
cf1c0aaf | 36 | KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,) |
7bf5234d | 37 | KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,) |
a03cd760 | 38 | KBUILD_CFLAGS += $(call cc-option,-mno-fdpic,) |
c20e1117 MF |
39 | ifneq ($(CONFIG_KERNEL_ABI_CALL0),) |
40 | KBUILD_CFLAGS += -mabi=call0 | |
41 | KBUILD_AFLAGS += -mabi=call0 | |
42 | endif | |
cf1c0aaf | 43 | |
f8f02ca7 | 44 | KBUILD_AFLAGS += -mlongcalls -mtext-section-literals |
a03cd760 MF |
45 | KBUILD_AFLAGS += $(call cc-option,-mno-fdpic,) |
46 | ||
47 | KBUILD_LDFLAGS += -m elf32xtensa | |
f8f02ca7 | 48 | |
65501622 | 49 | ifneq ($(CONFIG_LD_NO_RELAX),) |
a03cd760 | 50 | KBUILD_LDFLAGS += --no-relax |
65501622 CZ |
51 | endif |
52 | ||
c425c546 | 53 | CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__) |
72100ed7 | 54 | |
367b8112 CZ |
55 | vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y)) |
56 | plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) | |
57 | ||
367b8112 | 58 | KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) |
367b8112 | 59 | |
e7d163f7 | 60 | KBUILD_DEFCONFIG := iss_defconfig |
8e1a6dd2 | 61 | |
19c5699f | 62 | libs-y += arch/xtensa/lib/ |
8e1a6dd2 | 63 | |
e7d163f7 CZ |
64 | boot := arch/xtensa/boot |
65 | ||
7af710d9 | 66 | all Image zImage uImage xipImage: vmlinux |
8e1a6dd2 CZ |
67 | $(Q)$(MAKE) $(build)=$(boot) $@ |
68 | ||
5eacadb5 FK |
69 | archheaders: |
70 | $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all | |
71 | ||
8e1a6dd2 | 72 | define archhelp |
9a736fcb | 73 | @echo '* Image - Kernel ELF image with reset vector' |
8e1a6dd2 | 74 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' |
9a736fcb | 75 | @echo '* uImage - U-Boot wrapped image' |
7af710d9 | 76 | @echo ' xipImage - XIP image' |
8e1a6dd2 | 77 | endef |