xref: /linux/arch/xtensa/Makefile (revision 06d07429858317ded2db7986113a9e0129cd599b)
18e1a6dd2SChris Zankel#
28e1a6dd2SChris Zankel# This file is subject to the terms and conditions of the GNU General Public
38e1a6dd2SChris Zankel# License.  See the file "COPYING" in the main directory of this archive
48e1a6dd2SChris Zankel# for more details.
58e1a6dd2SChris Zankel#
68e1a6dd2SChris Zankel# Copyright (C) 2001 - 2005  Tensilica Inc.
7420ae951SMax Filippov# Copyright (C) 2014 Cadence Design Systems Inc.
88e1a6dd2SChris Zankel#
98e1a6dd2SChris Zankel# This file is included by the global makefile so that you can add your own
108212f898SMasahiro Yamada# architecture-specific flags and dependencies.
118e1a6dd2SChris Zankel
128e1a6dd2SChris Zankel# Core configuration.
13173d6681SChris Zankel# (Use VAR=<xtensa_config> to use another default compiler.)
148e1a6dd2SChris Zankel
15129ab0d2SMasahiro Yamadavariant-y := $(CONFIG_XTENSA_VARIANT_NAME)
168e1a6dd2SChris Zankel
17173d6681SChris ZankelVARIANT = $(variant-y)
188e1a6dd2SChris Zankel
1970cefe76SGeert Uytterhoevenifneq ($(VARIANT),)
2023243c1aSMasahiro Yamada  ifdef cross_compiling
2170cefe76SGeert Uytterhoeven    ifndef CROSS_COMPILE
2270cefe76SGeert Uytterhoeven      CROSS_COMPILE = xtensa_$(VARIANT)-
2370cefe76SGeert Uytterhoeven    endif
2470cefe76SGeert Uytterhoeven  endif
2570cefe76SGeert Uytterhoevenendif
2670cefe76SGeert Uytterhoeven
278e1a6dd2SChris Zankel# Platform configuration
288e1a6dd2SChris Zankel
298e1a6dd2SChris Zankelplatform-$(CONFIG_XTENSA_PLATFORM_XT2000)	:= xt2000
308e1a6dd2SChris Zankelplatform-$(CONFIG_XTENSA_PLATFORM_ISS)		:= iss
310d456badSMax Filippovplatform-$(CONFIG_XTENSA_PLATFORM_XTFPGA)	:= xtfpga
328e1a6dd2SChris Zankel
33b2444d34SChris Zankel# temporarily until string.h is fixed
34a753cd9aSMax FilippovKBUILD_CFLAGS += -ffreestanding -D__linux__
35f8f02ca7SMax FilippovKBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
36cf1c0aafSChris ZankelKBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
377bf5234dSMax FilippovKBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
38*a03cd760SMax FilippovKBUILD_CFLAGS += $(call cc-option,-mno-fdpic,)
39c20e1117SMax Filippovifneq ($(CONFIG_KERNEL_ABI_CALL0),)
40c20e1117SMax FilippovKBUILD_CFLAGS += -mabi=call0
41c20e1117SMax FilippovKBUILD_AFLAGS += -mabi=call0
42c20e1117SMax Filippovendif
43cf1c0aafSChris Zankel
44f8f02ca7SMax FilippovKBUILD_AFLAGS += -mlongcalls -mtext-section-literals
45*a03cd760SMax FilippovKBUILD_AFLAGS += $(call cc-option,-mno-fdpic,)
46*a03cd760SMax Filippov
47*a03cd760SMax FilippovKBUILD_LDFLAGS += -m elf32xtensa
48f8f02ca7SMax Filippov
4965501622SChris Zankelifneq ($(CONFIG_LD_NO_RELAX),)
50*a03cd760SMax FilippovKBUILD_LDFLAGS += --no-relax
5165501622SChris Zankelendif
5265501622SChris Zankel
53c425c546SMasahiro YamadaCHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)
5472100ed7SMax Filippov
55367b8112SChris Zankelvardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
56367b8112SChris Zankelplfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
57367b8112SChris Zankel
58367b8112SChris ZankelKBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
59367b8112SChris Zankel
60e7d163f7SChris ZankelKBUILD_DEFCONFIG := iss_defconfig
618e1a6dd2SChris Zankel
6219c5699fSMax Filippovlibs-y		+= arch/xtensa/lib/
638e1a6dd2SChris Zankel
648e1a6dd2SChris Zankelboot		:= arch/xtensa/boot
658e1a6dd2SChris Zankel
667af710d9SMax Filippovall Image zImage uImage xipImage: vmlinux
678e1a6dd2SChris Zankel	$(Q)$(MAKE) $(build)=$(boot) $@
688e1a6dd2SChris Zankel
695eacadb5SFiroz Khanarchheaders:
705eacadb5SFiroz Khan	$(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all
715eacadb5SFiroz Khan
728e1a6dd2SChris Zankeldefine archhelp
739a736fcbSMax Filippov  @echo '* Image       - Kernel ELF image with reset vector'
748e1a6dd2SChris Zankel  @echo '* zImage      - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
759a736fcbSMax Filippov  @echo '* uImage      - U-Boot wrapped image'
767af710d9SMax Filippov  @echo '  xipImage    - XIP image'
778e1a6dd2SChris Zankelendef
78