Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. CROSS_COMPILE ?= bfin-uclinux-
  9. LDFLAGS_vmlinux := -X
  10. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  11. GZFLAGS := -9
  12. KBUILD_CFLAGS += $(call cc-option,-mno-fdpic)
  13. KBUILD_AFLAGS += $(call cc-option,-mno-fdpic)
  14. CFLAGS_MODULE += -mlong-calls
  15. KALLSYMS += --symbol-prefix=_
  16. KBUILD_DEFCONFIG := BF537-STAMP_defconfig
  17. # setup the machine name and the machine dependent settings
  18. machine-$(CONFIG_BF522) := bf527
  19. machine-$(CONFIG_BF525) := bf527
  20. machine-$(CONFIG_BF527) := bf527
  21. machine-$(CONFIG_BF531) := bf533
  22. machine-$(CONFIG_BF532) := bf533
  23. machine-$(CONFIG_BF533) := bf533
  24. machine-$(CONFIG_BF534) := bf537
  25. machine-$(CONFIG_BF536) := bf537
  26. machine-$(CONFIG_BF537) := bf537
  27. machine-$(CONFIG_BF542) := bf548
  28. machine-$(CONFIG_BF544) := bf548
  29. machine-$(CONFIG_BF547) := bf548
  30. machine-$(CONFIG_BF548) := bf548
  31. machine-$(CONFIG_BF549) := bf548
  32. machine-$(CONFIG_BF561) := bf561
  33. MACHINE := $(machine-y)
  34. export MACHINE
  35. cpu-$(CONFIG_BF522) := bf522
  36. cpu-$(CONFIG_BF525) := bf525
  37. cpu-$(CONFIG_BF527) := bf527
  38. cpu-$(CONFIG_BF531) := bf531
  39. cpu-$(CONFIG_BF532) := bf532
  40. cpu-$(CONFIG_BF533) := bf533
  41. cpu-$(CONFIG_BF534) := bf534
  42. cpu-$(CONFIG_BF536) := bf536
  43. cpu-$(CONFIG_BF537) := bf537
  44. cpu-$(CONFIG_BF542) := bf542
  45. cpu-$(CONFIG_BF544) := bf544
  46. cpu-$(CONFIG_BF547) := bf547
  47. cpu-$(CONFIG_BF548) := bf548
  48. cpu-$(CONFIG_BF549) := bf549
  49. cpu-$(CONFIG_BF561) := bf561
  50. rev-$(CONFIG_BF_REV_0_0) := 0.0
  51. rev-$(CONFIG_BF_REV_0_1) := 0.1
  52. rev-$(CONFIG_BF_REV_0_2) := 0.2
  53. rev-$(CONFIG_BF_REV_0_3) := 0.3
  54. rev-$(CONFIG_BF_REV_0_4) := 0.4
  55. rev-$(CONFIG_BF_REV_0_5) := 0.5
  56. rev-$(CONFIG_BF_REV_NONE) := none
  57. rev-$(CONFIG_BF_REV_ANY) := any
  58. KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
  59. KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
  60. head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
  61. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
  62. # If we have a machine-specific directory, then include it in the build.
  63. ifneq ($(machine-y),)
  64. core-y += arch/$(ARCH)/mach-$(MACHINE)/
  65. core-y += arch/$(ARCH)/mach-$(MACHINE)/boards/
  66. endif
  67. libs-y += arch/$(ARCH)/lib/
  68. drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
  69. # Update machine arch symlinks if something which affects
  70. # them changed. We use .mach to indicate when they were updated
  71. # last, otherwise make uses the target directory mtime.
  72. include/asm-blackfin/.mach: $(wildcard include/config/arch/*.h) include/config/auto.conf
  73. @echo ' SYMLINK include/asm-$(ARCH)/mach-$(MACHINE) -> include/asm-$(ARCH)/mach'
  74. ifneq ($(KBUILD_SRC),)
  75. $(Q)mkdir -p include/asm-$(ARCH)
  76. $(Q)ln -fsn $(srctree)/include/asm-$(ARCH)/mach-$(MACHINE) include/asm-$(ARCH)/mach
  77. else
  78. $(Q)ln -fsn mach-$(MACHINE) include/asm-$(ARCH)/mach
  79. endif
  80. @touch $@
  81. CLEAN_FILES += \
  82. include/asm-$(ARCH)/asm-offsets.h \
  83. arch/$(ARCH)/kernel/asm-offsets.s \
  84. include/asm-$(ARCH)/mach \
  85. include/asm-$(ARCH)/.mach
  86. archprepare: include/asm-blackfin/.mach
  87. archclean:
  88. $(Q)$(MAKE) $(clean)=$(boot)
  89. boot := arch/$(ARCH)/boot
  90. BOOT_TARGETS = vmImage
  91. PHONY += $(BOOT_TARGETS) install
  92. KBUILD_IMAGE := $(boot)/vmImage
  93. all: vmImage
  94. $(BOOT_TARGETS): vmlinux
  95. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  96. install:
  97. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
  98. define archhelp
  99. echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
  100. echo ' install - Install kernel using'
  101. echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or'
  102. echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or'
  103. echo ' install to $$(INSTALL_PATH)'
  104. endef