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. |
| 14 | # (Use CPU=<xtensa_config> to use another default compiler.) |
| 15 | |
| 16 | cpu-$(CONFIG_XTENSA_CPU_LINUX_BE) := linux_be |
| 17 | cpu-$(CONFIG_XTENSA_CPU_LINUX_CUSTOM) := linux_custom |
| 18 | |
| 19 | CPU = $(cpu-y) |
| 20 | export CPU |
| 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 | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 30 | CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/) |
| 31 | CPPFLAGS += -Iinclude/asm |
| 32 | CFLAGS += -pipe -mlongcalls |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 33 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 34 | KBUILD_DEFCONFIG := iss_defconfig |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 35 | |
| 36 | # ramdisk/initrd support |
| 37 | # You need a compressed ramdisk image, named ramdisk.gz in |
| 38 | # arch/xtensa/boot/ramdisk |
| 39 | |
| 40 | core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/ |
| 41 | |
| 42 | # Test for cross compiling |
| 43 | |
| 44 | ifneq ($(CPU),) |
| 45 | COMPILE_ARCH = $(shell uname -m) |
| 46 | |
| 47 | ifneq ($(COMPILE_ARCH), xtensa) |
| 48 | ifndef CROSS_COMPILE |
| 49 | CROSS_COMPILE = xtensa_$(CPU)- |
| 50 | endif |
| 51 | endif |
| 52 | endif |
| 53 | |
| 54 | # |
| 55 | |
| 56 | LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) |
| 57 | |
| 58 | head-y := arch/xtensa/kernel/head.o |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 59 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ |
| 60 | ifneq ($(PLATFORM),) |
| 61 | core-y += arch/xtensa/platform-$(PLATFORM)/ |
| 62 | endif |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 63 | libs-y += arch/xtensa/lib/ $(LIBGCC) |
| 64 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 65 | boot := arch/xtensa/boot |
| 66 | |
| 67 | archinc := include/asm-xtensa |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 68 | |
Sam Ravnborg | 5bb7826 | 2005-09-11 22:30:22 +0200 | [diff] [blame] | 69 | archprepare: $(archinc)/.platform |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 70 | |
| 71 | # Update machine cpu and platform symlinks if something which affects |
| 72 | # them changed. |
| 73 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 74 | $(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER |
| 75 | @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)' |
| 76 | $(Q)mkdir -p $(archinc) |
| 77 | $(Q)mkdir -p $(archinc)/xtensa |
| 78 | $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config |
| 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 | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 92 | $(archinc)/platform $(archinc)/xtensa/config \ |
| 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 | |