Merge commit 'upstream/master'
[pandora-kernel.git] / arch / blackfin / Makefile
1 #
2 # arch/blackfin/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8
9 ifeq ($(CROSS_COMPILE),)
10 CROSS_COMPILE    := bfin-uclinux-
11 endif
12 LDFLAGS_vmlinux  := -X
13 OBJCOPYFLAGS     := -O binary -R .note -R .comment -S
14 GZFLAGS          := -9
15
16 KBUILD_CFLAGS           += $(call cc-option,-mno-fdpic)
17 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
18 CFLAGS_MODULE    += -mlong-calls
19 KALLSYMS         += --symbol-prefix=_
20
21 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
22
23 # setup the machine name and the machine dependent settings
24 machine-$(CONFIG_BF522) := bf527
25 machine-$(CONFIG_BF523) := bf527
26 machine-$(CONFIG_BF524) := bf527
27 machine-$(CONFIG_BF525) := bf527
28 machine-$(CONFIG_BF526) := bf527
29 machine-$(CONFIG_BF527) := bf527
30 machine-$(CONFIG_BF531) := bf533
31 machine-$(CONFIG_BF532) := bf533
32 machine-$(CONFIG_BF533) := bf533
33 machine-$(CONFIG_BF534) := bf537
34 machine-$(CONFIG_BF536) := bf537
35 machine-$(CONFIG_BF537) := bf537
36 machine-$(CONFIG_BF542) := bf548
37 machine-$(CONFIG_BF544) := bf548
38 machine-$(CONFIG_BF547) := bf548
39 machine-$(CONFIG_BF548) := bf548
40 machine-$(CONFIG_BF549) := bf548
41 machine-$(CONFIG_BF561) := bf561
42 MACHINE := $(machine-y)
43 export MACHINE
44
45 cpu-$(CONFIG_BF522) := bf522
46 cpu-$(CONFIG_BF523) := bf523
47 cpu-$(CONFIG_BF524) := bf524
48 cpu-$(CONFIG_BF525) := bf525
49 cpu-$(CONFIG_BF526) := bf526
50 cpu-$(CONFIG_BF527) := bf527
51 cpu-$(CONFIG_BF531) := bf531
52 cpu-$(CONFIG_BF532) := bf532
53 cpu-$(CONFIG_BF533) := bf533
54 cpu-$(CONFIG_BF534) := bf534
55 cpu-$(CONFIG_BF536) := bf536
56 cpu-$(CONFIG_BF537) := bf537
57 cpu-$(CONFIG_BF542) := bf542
58 cpu-$(CONFIG_BF544) := bf544
59 cpu-$(CONFIG_BF547) := bf547
60 cpu-$(CONFIG_BF548) := bf548
61 cpu-$(CONFIG_BF549) := bf549
62 cpu-$(CONFIG_BF561) := bf561
63
64 rev-$(CONFIG_BF_REV_0_0)  := 0.0
65 rev-$(CONFIG_BF_REV_0_1)  := 0.1
66 rev-$(CONFIG_BF_REV_0_2)  := 0.2
67 rev-$(CONFIG_BF_REV_0_3)  := 0.3
68 rev-$(CONFIG_BF_REV_0_4)  := 0.4
69 rev-$(CONFIG_BF_REV_0_5)  := 0.5
70 rev-$(CONFIG_BF_REV_NONE) := none
71 rev-$(CONFIG_BF_REV_ANY)  := any
72
73 KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
74 KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
75
76 # - we utilize the silicon rev from the toolchain, so move it over to the checkflags
77 # - the l1_text attribute is Blackfin specific, so fake it out as used to kill warnings
78 CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }')
79 CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -Dl1_text=__used__
80
81 head-y   := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
82
83 core-y   += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
84
85 # If we have a machine-specific directory, then include it in the build.
86 ifneq ($(machine-y),)
87 core-y   += arch/$(ARCH)/mach-$(MACHINE)/
88 core-y   += arch/$(ARCH)/mach-$(MACHINE)/boards/
89 endif
90
91 ifeq ($(CONFIG_MPU),y)
92 core-y  += arch/$(ARCH)/kernel/cplb-mpu/
93 else
94 core-y  += arch/$(ARCH)/kernel/cplb-nompu/
95 endif
96
97 libs-y   += arch/$(ARCH)/lib/
98
99 drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
100
101
102
103 #       Update machine arch symlinks if something which affects
104 #       them changed.  We use .mach to indicate when they were updated
105 #       last, otherwise make uses the target directory mtime.
106
107        show_mach_symlink = :
108  quiet_show_mach_symlink = echo '  SYMLINK include/asm-$(ARCH)/mach-$(MACHINE) -> include/asm-$(ARCH)/mach'
109 silent_show_mach_symlink = :
110 include/asm-blackfin/.mach: $(wildcard include/config/arch/*.h) include/config/auto.conf
111         @$($(quiet)show_mach_symlink)
112 ifneq ($(KBUILD_SRC),)
113         $(Q)mkdir -p include/asm-$(ARCH)
114         $(Q)ln -fsn $(srctree)/include/asm-$(ARCH)/mach-$(MACHINE) include/asm-$(ARCH)/mach
115 else
116         $(Q)ln -fsn mach-$(MACHINE) include/asm-$(ARCH)/mach
117 endif
118         @touch $@
119
120 CLEAN_FILES += \
121         include/asm-$(ARCH)/asm-offsets.h \
122         arch/$(ARCH)/kernel/asm-offsets.s \
123         include/asm-$(ARCH)/mach \
124         include/asm-$(ARCH)/.mach
125
126 archprepare: include/asm-blackfin/.mach
127 archclean:
128         $(Q)$(MAKE) $(clean)=$(boot)
129
130
131 INSTALL_PATH ?= /tftpboot
132 boot := arch/$(ARCH)/boot
133 BOOT_TARGETS = vmImage
134 PHONY += $(BOOT_TARGETS) install
135 KBUILD_IMAGE := $(boot)/vmImage
136
137 all: vmImage
138
139 $(BOOT_TARGETS): vmlinux
140         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
141
142 install:
143         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
144
145 define archhelp
146   echo  '* vmImage         - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
147   echo  '  install         - Install kernel using'
148   echo  '                     (your) ~/bin/$(CROSS_COMPILE)installkernel or'
149   echo  '                     (distribution) PATH: $(CROSS_COMPILE)installkernel or'
150   echo  '                     install to $$(INSTALL_PATH)'
151 endef