kbuild: enable 'make AFLAGS=...' to add additional options to AS
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / blackfin / Makefile
CommitLineData
1394f032
BW
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
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
ca9cb6fd 18KBUILD_DEFCONFIG := BF537-STAMP_defconfig
1394f032
BW
19
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
e2dd3f1e
MF
27machine-$(CONFIG_BF542) := bf548
28machine-$(CONFIG_BF544) := bf548
24a07a12
RH
29machine-$(CONFIG_BF548) := bf548
30machine-$(CONFIG_BF549) := bf548
1394f032
BW
31machine-$(CONFIG_BF561) := bf561
32MACHINE := $(machine-y)
33export MACHINE
34
de3025f4
JZ
35cpu-$(CONFIG_BF531) := bf531
36cpu-$(CONFIG_BF532) := bf532
37cpu-$(CONFIG_BF533) := bf533
38cpu-$(CONFIG_BF534) := bf534
39cpu-$(CONFIG_BF536) := bf536
40cpu-$(CONFIG_BF537) := bf537
e2dd3f1e
MF
41cpu-$(CONFIG_BF542) := bf542
42cpu-$(CONFIG_BF544) := bf544
de3025f4
JZ
43cpu-$(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
a0f97e06 56KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
222d394d 57KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
1394f032
BW
58
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