Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 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. |
| 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 Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 14 | # (Use VAR=<xtensa_config> to use another default compiler.) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 15 | |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 16 | variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf |
| 17 | variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 18 | |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 19 | VARIANT = $(variant-y) |
| 20 | export VARIANT |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 21 | |
| 22 | # Platform configuration |
| 23 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 24 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 |
| 25 | platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss |
| 26 | |
| 27 | PLATFORM = $(platform-y) |
| 28 | export PLATFORM |
| 29 | |
Chris Zankel | b2444d3 | 2007-08-04 09:23:54 -0700 | [diff] [blame] | 30 | # temporarily until string.h is fixed |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 31 | KBUILD_CFLAGS += -ffreestanding |
Chris Zankel | b2444d3 | 2007-08-04 09:23:54 -0700 | [diff] [blame] | 32 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 33 | KBUILD_CFLAGS += -pipe -mlongcalls |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 34 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 35 | KBUILD_DEFCONFIG := iss_defconfig |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 36 | |
| 37 | # ramdisk/initrd support |
| 38 | # You need a compressed ramdisk image, named ramdisk.gz in |
| 39 | # arch/xtensa/boot/ramdisk |
| 40 | |
| 41 | core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/ |
| 42 | |
| 43 | # Test for cross compiling |
| 44 | |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 45 | ifneq ($(VARIANT),) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 46 | COMPILE_ARCH = $(shell uname -m) |
| 47 | |
| 48 | ifneq ($(COMPILE_ARCH), xtensa) |
| 49 | ifndef CROSS_COMPILE |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 50 | CROSS_COMPILE = xtensa_$(VARIANT)- |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 51 | endif |
| 52 | endif |
| 53 | endif |
| 54 | |
| 55 | # |
| 56 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 57 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 58 | |
| 59 | head-y := arch/xtensa/kernel/head.o |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 60 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ |
| 61 | ifneq ($(PLATFORM),) |
| 62 | core-y += arch/xtensa/platform-$(PLATFORM)/ |
| 63 | endif |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 64 | libs-y += arch/xtensa/lib/ $(LIBGCC) |
| 65 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 66 | boot := arch/xtensa/boot |
| 67 | |
| 68 | archinc := include/asm-xtensa |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 69 | |
Sam Ravnborg | 5bb7826 | 2005-09-11 22:30:22 +0200 | [diff] [blame] | 70 | archprepare: $(archinc)/.platform |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 71 | |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 72 | # Update processor variant and platform symlinks if something which affects |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 73 | # them changed. |
| 74 | |
Roman Zippel | 2e3646e | 2006-06-08 22:12:42 -0700 | [diff] [blame] | 75 | $(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 76 | @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)' |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 77 | $(Q)mkdir -p $(archinc) |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 78 | $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 79 | @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)' |
| 80 | $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform |
| 81 | @touch $@ |
| 82 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 83 | |
| 84 | all: zImage |
| 85 | |
| 86 | bzImage : zImage |
| 87 | |
| 88 | zImage zImage.initrd: vmlinux |
| 89 | $(Q)$(MAKE) $(build)=$(boot) $@ |
| 90 | |
Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame] | 91 | CLEAN_FILES += arch/xtensa/vmlinux.lds \ |
Chris Zankel | 173d6681 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 92 | $(archinc)/platform $(archinc)/variant \ |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 93 | $(archinc)/.platform |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 94 | |
| 95 | define archhelp |
| 96 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' |
| 97 | endef |
| 98 | |