blob: 4bd1e14c6b908cca0fcf04d96a766ab10f372387 [file] [log] [blame]
Chris Zankel8e1a6dd2005-06-23 22:01:10 -07001#
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.
7#
8# This file is included by the global makefile so that you can add your own
9# architecture-specific flags and dependencies. Remember to do have actions
10# for "archclean" and "archdep" for cleaning up and making dependencies for
11# this architecture
12
13# Core configuration.
Chris Zankel173d6682006-12-10 02:18:48 -080014# (Use VAR=<xtensa_config> to use another default compiler.)
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070015
Chris Zankel173d6682006-12-10 02:18:48 -080016variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf
17variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070018
Chris Zankel173d6682006-12-10 02:18:48 -080019VARIANT = $(variant-y)
20export VARIANT
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070021
22# Platform configuration
23
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070024platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
25platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
26
27PLATFORM = $(platform-y)
28export PLATFORM
29
Chris Zankelb2444d32007-08-04 09:23:54 -070030# temporarily until string.h is fixed
Sam Ravnborga0f97e02007-10-14 22:21:35 +020031KBUILD_CFLAGS += -ffreestanding
Chris Zankelb2444d32007-08-04 09:23:54 -070032
Sam Ravnborga0f97e02007-10-14 22:21:35 +020033KBUILD_CFLAGS += -pipe -mlongcalls
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070034
Chris Zankele7d163f2005-06-30 02:58:59 -070035KBUILD_DEFCONFIG := iss_defconfig
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070036
37# ramdisk/initrd support
38# You need a compressed ramdisk image, named ramdisk.gz in
39# arch/xtensa/boot/ramdisk
40
41core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
42
43# Test for cross compiling
44
Chris Zankel173d6682006-12-10 02:18:48 -080045ifneq ($(VARIANT),)
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070046 COMPILE_ARCH = $(shell uname -m)
47
48 ifneq ($(COMPILE_ARCH), xtensa)
49 ifndef CROSS_COMPILE
Chris Zankel173d6682006-12-10 02:18:48 -080050 CROSS_COMPILE = xtensa_$(VARIANT)-
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070051 endif
52 endif
53endif
54
55#
56
Sam Ravnborga0f97e02007-10-14 22:21:35 +020057LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070058
59head-y := arch/xtensa/kernel/head.o
Chris Zankele7d163f2005-06-30 02:58:59 -070060core-y += arch/xtensa/kernel/ arch/xtensa/mm/
61ifneq ($(PLATFORM),)
Chris Zankelb26d0ab2007-09-13 13:44:07 -070062core-y += arch/xtensa/platforms/$(PLATFORM)/
Chris Zankele7d163f2005-06-30 02:58:59 -070063endif
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070064libs-y += arch/xtensa/lib/ $(LIBGCC)
65
Chris Zankele7d163f2005-06-30 02:58:59 -070066boot := arch/xtensa/boot
67
68archinc := include/asm-xtensa
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070069
Sam Ravnborg5bb78262005-09-11 22:30:22 +020070archprepare: $(archinc)/.platform
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070071
Chris Zankel173d6682006-12-10 02:18:48 -080072# Update processor variant and platform symlinks if something which affects
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070073# them changed.
74
Roman Zippel2e3646e2006-06-08 22:12:42 -070075$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
Chris Zankel173d6682006-12-10 02:18:48 -080076 @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)'
Chris Zankele7d163f2005-06-30 02:58:59 -070077 $(Q)mkdir -p $(archinc)
Chris Zankel173d6682006-12-10 02:18:48 -080078 $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
Chris Zankele7d163f2005-06-30 02:58:59 -070079 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
80 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
81 @touch $@
82
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070083
84all: zImage
85
86bzImage : zImage
87
88zImage zImage.initrd: vmlinux
89 $(Q)$(MAKE) $(build)=$(boot) $@
90
Sam Ravnborg0013a852005-09-09 20:57:26 +020091CLEAN_FILES += arch/xtensa/vmlinux.lds \
Chris Zankel173d6682006-12-10 02:18:48 -080092 $(archinc)/platform $(archinc)/variant \
Chris Zankele7d163f2005-06-30 02:58:59 -070093 $(archinc)/.platform
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070094
95define archhelp
96 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
97endef
98