blob: 27847e4ffcbfa5212a7ca87fc104941686c5473d [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.
14# (Use CPU=<xtensa_config> to use another default compiler.)
15
16cpu-$(CONFIG_XTENSA_CPU_LINUX_BE) := linux_be
17cpu-$(CONFIG_XTENSA_CPU_LINUX_CUSTOM) := linux_custom
18
19CPU = $(cpu-y)
20export CPU
21
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 Zankele7d163f2005-06-30 02:58:59 -070030CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/)
31CPPFLAGS += -Iinclude/asm
32CFLAGS += -pipe -mlongcalls
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070033
Chris Zankele7d163f2005-06-30 02:58:59 -070034KBUILD_DEFCONFIG := iss_defconfig
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070035
36# ramdisk/initrd support
37# You need a compressed ramdisk image, named ramdisk.gz in
38# arch/xtensa/boot/ramdisk
39
40core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
41
42# Test for cross compiling
43
44ifneq ($(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
52endif
53
54#
55
56LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
57
58head-y := arch/xtensa/kernel/head.o
Chris Zankele7d163f2005-06-30 02:58:59 -070059core-y += arch/xtensa/kernel/ arch/xtensa/mm/
60ifneq ($(PLATFORM),)
61core-y += arch/xtensa/platform-$(PLATFORM)/
62endif
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070063libs-y += arch/xtensa/lib/ $(LIBGCC)
64
Chris Zankele7d163f2005-06-30 02:58:59 -070065boot := arch/xtensa/boot
66
67archinc := include/asm-xtensa
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070068
69arch/xtensa/kernel/asm-offsets.s: \
Chris Zankele7d163f2005-06-30 02:58:59 -070070 arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070071
72include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
73 $(call filechk,gen-asm-offsets)
74
Chris Zankele7d163f2005-06-30 02:58:59 -070075prepare: $(archinc)/.platform $(archinc)/offsets.h
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070076
77# Update machine cpu and platform symlinks if something which affects
78# them changed.
79
Chris Zankele7d163f2005-06-30 02:58:59 -070080$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER
81 @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
82 $(Q)mkdir -p $(archinc)
83 $(Q)mkdir -p $(archinc)/xtensa
84 $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
85 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
86 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
87 @touch $@
88
Chris Zankel8e1a6dd2005-06-23 22:01:10 -070089
90all: zImage
91
92bzImage : zImage
93
94zImage zImage.initrd: vmlinux
95 $(Q)$(MAKE) $(build)=$(boot) $@
96
Chris Zankele7d163f2005-06-30 02:58:59 -070097CLEAN_FILES += arch/xtensa/vmlinux.lds $(archinc)/offset.h \
98 $(archinc)/platform $(archinc)/xtensa/config \
99 $(archinc)/.platform
Chris Zankel8e1a6dd2005-06-23 22:01:10 -0700100
101define archhelp
102 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
103endef
104