blob: 20841663270fa50694669b90c4e54a55eb250bf1 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001#
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
10CROSS_COMPILE ?= bfin-uclinux-
11LDFLAGS_vmlinux := -X
12OBJCOPYFLAGS := -O binary -R .note -R .comment -S
13GZFLAGS := -9
14
15CFLAGS_MODULE += -mlong-calls
16KALLSYMS += --symbol-prefix=_
17
Mike Frysingerca9cb6f2007-05-21 18:09:35 +080018KBUILD_DEFCONFIG := BF537-STAMP_defconfig
Bryan Wu1394f032007-05-06 14:50:22 -070019
20# setup the machine name and the machine dependent settings
21machine-$(CONFIG_BF531) := bf533
22machine-$(CONFIG_BF532) := bf533
23machine-$(CONFIG_BF533) := bf533
24machine-$(CONFIG_BF534) := bf537
25machine-$(CONFIG_BF536) := bf537
26machine-$(CONFIG_BF537) := bf537
Mike Frysingere2dd3f12007-07-24 18:20:18 +080027machine-$(CONFIG_BF542) := bf548
28machine-$(CONFIG_BF544) := bf548
Roy Huang24a07a12007-07-12 22:41:45 +080029machine-$(CONFIG_BF548) := bf548
30machine-$(CONFIG_BF549) := bf548
Bryan Wu1394f032007-05-06 14:50:22 -070031machine-$(CONFIG_BF561) := bf561
32MACHINE := $(machine-y)
33export MACHINE
34
Jie Zhangde3025f2007-06-25 18:04:12 +080035cpu-$(CONFIG_BF531) := bf531
36cpu-$(CONFIG_BF532) := bf532
37cpu-$(CONFIG_BF533) := bf533
38cpu-$(CONFIG_BF534) := bf534
39cpu-$(CONFIG_BF536) := bf536
40cpu-$(CONFIG_BF537) := bf537
Mike Frysingere2dd3f12007-07-24 18:20:18 +080041cpu-$(CONFIG_BF542) := bf542
42cpu-$(CONFIG_BF544) := bf544
Jie Zhangde3025f2007-06-25 18:04:12 +080043cpu-$(CONFIG_BF548) := bf548
44cpu-$(CONFIG_BF549) := bf549
45cpu-$(CONFIG_BF561) := bf561
46
47rev-$(CONFIG_BF_REV_0_0) := 0.0
48rev-$(CONFIG_BF_REV_0_1) := 0.1
49rev-$(CONFIG_BF_REV_0_2) := 0.2
50rev-$(CONFIG_BF_REV_0_3) := 0.3
51rev-$(CONFIG_BF_REV_0_4) := 0.4
52rev-$(CONFIG_BF_REV_0_5) := 0.5
53rev-$(CONFIG_BF_REV_NONE) := none
54rev-$(CONFIG_BF_REV_ANY) := any
55
56CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
57AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
Bryan Wu1394f032007-05-06 14:50:22 -070058
59head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
60
61core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
62
63# If we have a machine-specific directory, then include it in the build.
64ifneq ($(machine-y),)
65core-y += arch/$(ARCH)/mach-$(MACHINE)/
66core-y += arch/$(ARCH)/mach-$(MACHINE)/boards/
67endif
68
69libs-y += arch/$(ARCH)/lib/
70
71drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
72
73
74
75# Update machine arch symlinks if something which affects
76# them changed. We use .mach to indicate when they were updated
77# last, otherwise make uses the target directory mtime.
78
79include/asm-blackfin/.mach: $(wildcard include/config/arch/*.h) include/config/auto.conf
80 @echo ' SYMLINK include/asm-$(ARCH)/mach-$(MACHINE) -> include/asm-$(ARCH)/mach'
81ifneq ($(KBUILD_SRC),)
82 $(Q)mkdir -p include/asm-$(ARCH)
83 $(Q)ln -fsn $(srctree)/include/asm-$(ARCH)/mach-$(MACHINE) include/asm-$(ARCH)/mach
84else
85 $(Q)ln -fsn mach-$(MACHINE) include/asm-$(ARCH)/mach
86endif
87 @touch $@
88
89CLEAN_FILES += \
90 include/asm-$(ARCH)/asm-offsets.h \
91 arch/$(ARCH)/kernel/asm-offsets.s \
92 include/asm-$(ARCH)/mach \
93 include/asm-$(ARCH)/.mach
94
95archprepare: include/asm-blackfin/.mach
96archclean:
97 $(Q)$(MAKE) $(clean)=$(boot)
98
99
100all: vmImage
101boot := arch/$(ARCH)/boot
102BOOT_TARGETS = vmImage
103.PHONY: $(BOOT_TARGETS)
104$(BOOT_TARGETS): vmlinux
105 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
106define archhelp
107 echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
108endef