Blame view

arch/xtensa/Makefile 2.62 KB
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
1
2
3
4
5
6
7
8
9
10
11
12
13
  #
  # This file is subject to the terms and conditions of the GNU General Public
  # License.  See the file "COPYING" in the main directory of this archive
  # for more details.
  #
  # Copyright (C) 2001 - 2005  Tensilica Inc.
  #
  # This file is included by the global makefile so that you can add your own
  # architecture-specific flags and dependencies. Remember to do have actions
  # for "archclean" and "archdep" for cleaning up and making dependencies for
  # this architecture
  
  # Core configuration.
173d66813   Chris Zankel   [PATCH] xtensa: r...
14
  # (Use VAR=<xtensa_config> to use another default compiler.)
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
15

173d66813   Chris Zankel   [PATCH] xtensa: r...
16
  variant-$(CONFIG_XTENSA_VARIANT_FSF)		:= fsf
0025427ee   Chris Zankel   xtensa: Add confi...
17
  variant-$(CONFIG_XTENSA_VARIANT_DC232B)		:= dc232b
000af2c5a   Johannes Weiner   xtensa: s6000 var...
18
  variant-$(CONFIG_XTENSA_VARIANT_S6000)		:= s6000
173d66813   Chris Zankel   [PATCH] xtensa: r...
19
  variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM)	:= custom
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
20

173d66813   Chris Zankel   [PATCH] xtensa: r...
21
22
  VARIANT = $(variant-y)
  export VARIANT
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
23
24
  
  # Platform configuration
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
25
26
  platform-$(CONFIG_XTENSA_PLATFORM_XT2000)	:= xt2000
  platform-$(CONFIG_XTENSA_PLATFORM_ISS)		:= iss
f82e939fb   Johannes Weiner   xtensa: platform:...
27
  platform-$(CONFIG_XTENSA_PLATFORM_S6105)	:= s6105
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
28
29
30
  
  PLATFORM = $(platform-y)
  export PLATFORM
b2444d34a   Chris Zankel   [XTENSA] Add free...
31
  # temporarily until string.h is fixed
a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
32
  KBUILD_CFLAGS += -ffreestanding
b2444d34a   Chris Zankel   [XTENSA] Add free...
33

a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
34
  KBUILD_CFLAGS += -pipe -mlongcalls
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
35

cf1c0aaf8   Chris Zankel   xtensa: Add -mfor...
36
  KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
367b8112f   Chris Zankel   xtensa: move head...
37
38
39
40
41
42
43
44
  vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
  plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
  
  ifeq ($(KBUILD_SRC),)
  KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
  else
  KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
  endif
e7d163f76   Chris Zankel   [PATCH] xtensa: R...
45
  KBUILD_DEFCONFIG := iss_defconfig
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
46
47
48
49
50
51
52
53
  
  # ramdisk/initrd support
  # You need a compressed ramdisk image, named ramdisk.gz in
  # arch/xtensa/boot/ramdisk
  
  core-$(CONFIG_EMBEDDED_RAMDISK)	+= arch/xtensa/boot/ramdisk/
  
  # Test for cross compiling
173d66813   Chris Zankel   [PATCH] xtensa: r...
54
  ifneq ($(VARIANT),)
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
55
56
57
58
    COMPILE_ARCH = $(shell uname -m)
  
    ifneq ($(COMPILE_ARCH), xtensa)
      ifndef CROSS_COMPILE
173d66813   Chris Zankel   [PATCH] xtensa: r...
59
        CROSS_COMPILE = xtensa_$(VARIANT)-
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
60
61
62
      endif
    endif
  endif
f1933189b   Chris Zankel   xtensa: only buil...
63
64
65
66
67
68
  # Only build variant and/or platform if it includes a Makefile
  
  buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
  buildplf := $(shell test -a $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
  
  # Find libgcc.a
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
69

a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
70
  LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
71
72
  
  head-y		:= arch/xtensa/kernel/head.o
e7d163f76   Chris Zankel   [PATCH] xtensa: R...
73
  core-y		+= arch/xtensa/kernel/ arch/xtensa/mm/
f1933189b   Chris Zankel   xtensa: only buil...
74
  core-y		+= $(buildvar) $(buildplf)
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
75
  libs-y		+= arch/xtensa/lib/ $(LIBGCC)
e7d163f76   Chris Zankel   [PATCH] xtensa: R...
76
  boot		:= arch/xtensa/boot
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
77
78
79
80
81
82
  all: zImage
  
  bzImage : zImage
  
  zImage zImage.initrd: vmlinux
  	$(Q)$(MAKE) $(build)=$(boot) $@
8e1a6dd2f   Chris Zankel   [PATCH] xtensa: A...
83
84
85
  define archhelp
    @echo '* zImage      - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
  endef