kbuild: enable 'make CFLAGS=...' to add additional options to CC
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / xtensa / Makefile
CommitLineData
8e1a6dd2
CZ
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.
173d6681 14# (Use VAR=<xtensa_config> to use another default compiler.)
8e1a6dd2 15
173d6681
CZ
16variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf
17variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
8e1a6dd2 18
173d6681
CZ
19VARIANT = $(variant-y)
20export VARIANT
8e1a6dd2
CZ
21
22# Platform configuration
23
8e1a6dd2
CZ
24platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
25platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
26
27PLATFORM = $(platform-y)
28export PLATFORM
29
b2444d34 30# temporarily until string.h is fixed
a0f97e06 31KBUILD_CFLAGS += -ffreestanding
b2444d34 32
a0f97e06 33KBUILD_CFLAGS += -pipe -mlongcalls
8e1a6dd2 34
e7d163f7 35KBUILD_DEFCONFIG := iss_defconfig
8e1a6dd2
CZ
36
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
173d6681 45ifneq ($(VARIANT),)
8e1a6dd2
CZ
46 COMPILE_ARCH = $(shell uname -m)
47
48 ifneq ($(COMPILE_ARCH), xtensa)
49 ifndef CROSS_COMPILE
173d6681 50 CROSS_COMPILE = xtensa_$(VARIANT)-
8e1a6dd2
CZ
51 endif
52 endif
53endif
54
55#
56
a0f97e06 57LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
8e1a6dd2
CZ
58
59head-y := arch/xtensa/kernel/head.o
e7d163f7
CZ
60core-y += arch/xtensa/kernel/ arch/xtensa/mm/
61ifneq ($(PLATFORM),)
62core-y += arch/xtensa/platform-$(PLATFORM)/
63endif
8e1a6dd2
CZ
64libs-y += arch/xtensa/lib/ $(LIBGCC)
65
e7d163f7
CZ
66boot := arch/xtensa/boot
67
68archinc := include/asm-xtensa
8e1a6dd2 69
5bb78269 70archprepare: $(archinc)/.platform
8e1a6dd2 71
173d6681 72# Update processor variant and platform symlinks if something which affects
8e1a6dd2
CZ
73# them changed.
74
2e3646e5 75$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
173d6681 76 @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)'
e7d163f7 77 $(Q)mkdir -p $(archinc)
173d6681 78 $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
e7d163f7
CZ
79 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
80 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
81 @touch $@
82
8e1a6dd2
CZ
83
84all: zImage
85
86bzImage : zImage
87
88zImage zImage.initrd: vmlinux
89 $(Q)$(MAKE) $(build)=$(boot) $@
90
0013a854 91CLEAN_FILES += arch/xtensa/vmlinux.lds \
173d6681 92 $(archinc)/platform $(archinc)/variant \
e7d163f7 93 $(archinc)/.platform
8e1a6dd2
CZ
94
95define archhelp
96 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
97endef
98