Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_BF523) := bf527
  20. machine-$(CONFIG_BF524) := bf527
  21. machine-$(CONFIG_BF525) := bf527
  22. machine-$(CONFIG_BF526) := bf527
  23. machine-$(CONFIG_BF527) := bf527
  24. machine-$(CONFIG_BF531) := bf533
  25. machine-$(CONFIG_BF532) := bf533
  26. machine-$(CONFIG_BF533) := bf533
  27. machine-$(CONFIG_BF534) := bf537
  28. machine-$(CONFIG_BF536) := bf537
  29. machine-$(CONFIG_BF537) := bf537
  30. machine-$(CONFIG_BF542) := bf548
  31. machine-$(CONFIG_BF544) := bf548
  32. machine-$(CONFIG_BF547) := bf548
  33. machine-$(CONFIG_BF548) := bf548
  34. machine-$(CONFIG_BF549) := bf548
  35. machine-$(CONFIG_BF561) := bf561
  36. MACHINE := $(machine-y)
  37. export MACHINE
  38. cpu-$(CONFIG_BF522) := bf522
  39. cpu-$(CONFIG_BF523) := bf523
  40. cpu-$(CONFIG_BF524) := bf524
  41. cpu-$(CONFIG_BF525) := bf525
  42. cpu-$(CONFIG_BF526) := bf526
  43. cpu-$(CONFIG_BF527) := bf527
  44. cpu-$(CONFIG_BF531) := bf531
  45. cpu-$(CONFIG_BF532) := bf532
  46. cpu-$(CONFIG_BF533) := bf533
  47. cpu-$(CONFIG_BF534) := bf534
  48. cpu-$(CONFIG_BF536) := bf536
  49. cpu-$(CONFIG_BF537) := bf537
  50. cpu-$(CONFIG_BF542) := bf542
  51. cpu-$(CONFIG_BF544) := bf544
  52. cpu-$(CONFIG_BF547) := bf547
  53. cpu-$(CONFIG_BF548) := bf548
  54. cpu-$(CONFIG_BF549) := bf549
  55. cpu-$(CONFIG_BF561) := bf561
  56. rev-$(CONFIG_BF_REV_0_0) := 0.0
  57. rev-$(CONFIG_BF_REV_0_1) := 0.1
  58. rev-$(CONFIG_BF_REV_0_2) := 0.2
  59. rev-$(CONFIG_BF_REV_0_3) := 0.3
  60. rev-$(CONFIG_BF_REV_0_4) := 0.4
  61. rev-$(CONFIG_BF_REV_0_5) := 0.5
  62. rev-$(CONFIG_BF_REV_NONE) := none
  63. rev-$(CONFIG_BF_REV_ANY) := any
  64. KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
  65. KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
  66. head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
  67. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
  68. # If we have a machine-specific directory, then include it in the build.
  69. ifneq ($(machine-y),)
  70. core-y += arch/$(ARCH)/mach-$(MACHINE)/
  71. core-y += arch/$(ARCH)/mach-$(MACHINE)/boards/
  72. endif
  73. ifeq ($(CONFIG_MPU),y)
  74. core-y += arch/$(ARCH)/kernel/cplb-mpu/
  75. else
  76. core-y += arch/$(ARCH)/kernel/cplb-nompu/
  77. endif
  78. libs-y += arch/$(ARCH)/lib/
  79. drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
  80. # Update machine arch symlinks if something which affects
  81. # them changed. We use .mach to indicate when they were updated
  82. # last, otherwise make uses the target directory mtime.
  83. show_mach_symlink = :
  84. quiet_show_mach_symlink = echo ' SYMLINK include/asm-$(ARCH)/mach-$(MACHINE) -> include/asm-$(ARCH)/mach'
  85. silent_show_mach_symlink = :
  86. include/asm-blackfin/.mach: $(wildcard include/config/arch/*.h) include/config/auto.conf
  87. @$($(quiet)show_mach_symlink)
  88. ifneq ($(KBUILD_SRC),)
  89. $(Q)mkdir -p include/asm-$(ARCH)
  90. $(Q)ln -fsn $(srctree)/include/asm-$(ARCH)/mach-$(MACHINE) include/asm-$(ARCH)/mach
  91. else
  92. $(Q)ln -fsn mach-$(MACHINE) include/asm-$(ARCH)/mach
  93. endif
  94. @touch $@
  95. CLEAN_FILES += \
  96. include/asm-$(ARCH)/asm-offsets.h \
  97. arch/$(ARCH)/kernel/asm-offsets.s \
  98. include/asm-$(ARCH)/mach \
  99. include/asm-$(ARCH)/.mach
  100. archprepare: include/asm-blackfin/.mach
  101. archclean:
  102. $(Q)$(MAKE) $(clean)=$(boot)
  103. INSTALL_PATH ?= /tftpboot
  104. boot := arch/$(ARCH)/boot
  105. BOOT_TARGETS = vmImage
  106. PHONY += $(BOOT_TARGETS) install
  107. KBUILD_IMAGE := $(boot)/vmImage
  108. all: vmImage
  109. $(BOOT_TARGETS): vmlinux
  110. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  111. install:
  112. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
  113. define archhelp
  114. echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
  115. echo ' install - Install kernel using'
  116. echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or'
  117. echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or'
  118. echo ' install to $$(INSTALL_PATH)'
  119. endef