Makefile 3.9 KB
Newer Older
B
Bryan Wu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#
# arch/blackfin/Makefile
#
# 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.
#


CROSS_COMPILE    ?= bfin-uclinux-
LDFLAGS_vmlinux  := -X
OBJCOPYFLAGS     := -O binary -R .note -R .comment -S
GZFLAGS          := -9

15 16
KBUILD_CFLAGS           += $(call cc-option,-mno-fdpic)
KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
B
Bryan Wu 已提交
17 18 19
CFLAGS_MODULE    += -mlong-calls
KALLSYMS         += --symbol-prefix=_

20
KBUILD_DEFCONFIG := BF537-STAMP_defconfig
B
Bryan Wu 已提交
21 22

# setup the machine name and the machine dependent settings
23
machine-$(CONFIG_BF522) := bf527
24 25
machine-$(CONFIG_BF523) := bf527
machine-$(CONFIG_BF524) := bf527
26
machine-$(CONFIG_BF525) := bf527
27
machine-$(CONFIG_BF526) := bf527
28
machine-$(CONFIG_BF527) := bf527
B
Bryan Wu 已提交
29 30 31 32 33 34
machine-$(CONFIG_BF531) := bf533
machine-$(CONFIG_BF532) := bf533
machine-$(CONFIG_BF533) := bf533
machine-$(CONFIG_BF534) := bf537
machine-$(CONFIG_BF536) := bf537
machine-$(CONFIG_BF537) := bf537
35 36
machine-$(CONFIG_BF542) := bf548
machine-$(CONFIG_BF544) := bf548
37
machine-$(CONFIG_BF547) := bf548
38 39
machine-$(CONFIG_BF548) := bf548
machine-$(CONFIG_BF549) := bf548
B
Bryan Wu 已提交
40 41 42 43
machine-$(CONFIG_BF561) := bf561
MACHINE := $(machine-y)
export MACHINE

44
cpu-$(CONFIG_BF522) := bf522
45 46
cpu-$(CONFIG_BF523) := bf523
cpu-$(CONFIG_BF524) := bf524
47
cpu-$(CONFIG_BF525) := bf525
48
cpu-$(CONFIG_BF526) := bf526
49
cpu-$(CONFIG_BF527) := bf527
50 51 52 53 54 55
cpu-$(CONFIG_BF531) := bf531
cpu-$(CONFIG_BF532) := bf532
cpu-$(CONFIG_BF533) := bf533
cpu-$(CONFIG_BF534) := bf534
cpu-$(CONFIG_BF536) := bf536
cpu-$(CONFIG_BF537) := bf537
56 57
cpu-$(CONFIG_BF542) := bf542
cpu-$(CONFIG_BF544) := bf544
58
cpu-$(CONFIG_BF547) := bf547
59 60 61 62 63 64 65 66 67 68 69 70 71
cpu-$(CONFIG_BF548) := bf548
cpu-$(CONFIG_BF549) := bf549
cpu-$(CONFIG_BF561) := bf561

rev-$(CONFIG_BF_REV_0_0)  := 0.0
rev-$(CONFIG_BF_REV_0_1)  := 0.1
rev-$(CONFIG_BF_REV_0_2)  := 0.2
rev-$(CONFIG_BF_REV_0_3)  := 0.3
rev-$(CONFIG_BF_REV_0_4)  := 0.4
rev-$(CONFIG_BF_REV_0_5)  := 0.5
rev-$(CONFIG_BF_REV_NONE) := none
rev-$(CONFIG_BF_REV_ANY)  := any

72
KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
73
KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
B
Bryan Wu 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

head-y   := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o

core-y   += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/

# If we have a machine-specific directory, then include it in the build.
ifneq ($(machine-y),)
core-y   += arch/$(ARCH)/mach-$(MACHINE)/
core-y   += arch/$(ARCH)/mach-$(MACHINE)/boards/
endif

libs-y   += arch/$(ARCH)/lib/

drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/



#	Update machine arch symlinks if something which affects
#	them changed.  We use .mach to indicate when they were updated
#	last, otherwise make uses the target directory mtime.

include/asm-blackfin/.mach: $(wildcard include/config/arch/*.h) include/config/auto.conf
	@echo '  SYMLINK include/asm-$(ARCH)/mach-$(MACHINE) -> include/asm-$(ARCH)/mach'
ifneq ($(KBUILD_SRC),)
	$(Q)mkdir -p include/asm-$(ARCH)
	$(Q)ln -fsn $(srctree)/include/asm-$(ARCH)/mach-$(MACHINE) include/asm-$(ARCH)/mach
else
	$(Q)ln -fsn mach-$(MACHINE) include/asm-$(ARCH)/mach
endif
	@touch $@

CLEAN_FILES += \
	include/asm-$(ARCH)/asm-offsets.h \
	arch/$(ARCH)/kernel/asm-offsets.s \
	include/asm-$(ARCH)/mach \
	include/asm-$(ARCH)/.mach

archprepare: include/asm-blackfin/.mach
archclean:
	$(Q)$(MAKE) $(clean)=$(boot)


boot := arch/$(ARCH)/boot
BOOT_TARGETS = vmImage
118 119 120 121 122
PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(boot)/vmImage

all: vmImage

B
Bryan Wu 已提交
123 124
$(BOOT_TARGETS): vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
125 126 127 128

install:
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install

B
Bryan Wu 已提交
129 130
define archhelp
  echo  '* vmImage         - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
131 132 133 134
  echo  '  install         - Install kernel using'
  echo  '                     (your) ~/bin/$(CROSS_COMPILE)installkernel or'
  echo  '                     (distribution) PATH: $(CROSS_COMPILE)installkernel or'
  echo  '                     install to $$(INSTALL_PATH)'
B
Bryan Wu 已提交
135
endef