Merge tag 'for-linus-2022102101' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / arch / xtensa / Makefile
CommitLineData
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 15variant-y := $(CONFIG_XTENSA_VARIANT_NAME)
8e1a6dd2 16
173d6681 17VARIANT = $(variant-y)
8e1a6dd2 18
70cefe76 19ifneq ($(VARIANT),)
23243c1a 20 ifdef cross_compiling
70cefe76
GU
21 ifndef CROSS_COMPILE
22 CROSS_COMPILE = xtensa_$(VARIANT)-
23 endif
24 endif
25endif
26
8e1a6dd2
CZ
27# Platform configuration
28
8e1a6dd2
CZ
29platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
30platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
0d456bad 31platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
8e1a6dd2 32
b2444d34 33# temporarily until string.h is fixed
a753cd9a 34KBUILD_CFLAGS += -ffreestanding -D__linux__
f8f02ca7 35KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
cf1c0aaf 36KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
7bf5234d 37KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
c20e1117
MF
38ifneq ($(CONFIG_KERNEL_ABI_CALL0),)
39KBUILD_CFLAGS += -mabi=call0
40KBUILD_AFLAGS += -mabi=call0
41endif
cf1c0aaf 42
f8f02ca7
MF
43KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
44
65501622 45ifneq ($(CONFIG_LD_NO_RELAX),)
d503ac53 46KBUILD_LDFLAGS := --no-relax
65501622
CZ
47endif
48
c425c546 49CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)
72100ed7 50
367b8112
CZ
51vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
52plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
53
367b8112 54KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
367b8112 55
e7d163f7 56KBUILD_DEFCONFIG := iss_defconfig
8e1a6dd2 57
19c5699f 58libs-y += arch/xtensa/lib/
8e1a6dd2 59
e7d163f7
CZ
60boot := arch/xtensa/boot
61
7af710d9 62all Image zImage uImage xipImage: vmlinux
8e1a6dd2
CZ
63 $(Q)$(MAKE) $(build)=$(boot) $@
64
5eacadb5
FK
65archheaders:
66 $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all
67
8e1a6dd2 68define archhelp
9a736fcb 69 @echo '* Image - Kernel ELF image with reset vector'
8e1a6dd2 70 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
9a736fcb 71 @echo '* uImage - U-Boot wrapped image'
7af710d9 72 @echo ' xipImage - XIP image'
8e1a6dd2 73endef