Makefile 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. # $Id: Makefile,v 1.35 2004/04/15 03:39:20 sugioka Exp $
  2. #
  3. # This file is subject to the terms and conditions of the GNU General Public
  4. # License. See the file "COPYING" in the main directory of this archive
  5. # for more details.
  6. #
  7. # Copyright (C) 1999 Kaz Kojima
  8. # Copyright (C) 2002, 2003, 2004 Paul Mundt
  9. # Copyright (C) 2002 M. R. Brown
  10. #
  11. # This file is included by the global makefile so that you can add your own
  12. # architecture-specific flags and dependencies. Remember to do have actions
  13. # for "archclean" and "archdep" for cleaning up and making dependencies for
  14. # this architecture
  15. #
  16. isa-y := any
  17. isa-$(CONFIG_SH_DSP) := sh
  18. isa-$(CONFIG_CPU_SH2) := sh2
  19. isa-$(CONFIG_CPU_SH2A) := sh2a
  20. isa-$(CONFIG_CPU_SH3) := sh3
  21. isa-$(CONFIG_CPU_SH4) := sh4
  22. isa-$(CONFIG_CPU_SH4A) := sh4a
  23. isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
  24. isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
  25. ifndef CONFIG_MMU
  26. isa-y := $(isa-y)-nommu
  27. endif
  28. ifndef CONFIG_SH_DSP
  29. ifndef CONFIG_SH_FPU
  30. isa-y := $(isa-y)-nofpu
  31. endif
  32. endif
  33. cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,)
  34. cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \
  35. $(call cc-option,-m2a-nofpu,)
  36. cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,)
  37. cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \
  38. $(call cc-option,-mno-implicit-fp,-m4-nofpu)
  39. cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
  40. $(call cc-option,-m4a-nofpu,)
  41. cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
  42. cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
  43. cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) -ffreestanding
  44. cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
  45. $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
  46. OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
  47. #
  48. # arch/sh/defconfig doesn't reflect any real hardware, and as such should
  49. # never be used by anyone. Use a board-specific defconfig that has a
  50. # reasonable chance of being current instead.
  51. #
  52. KBUILD_DEFCONFIG := r7780rp_defconfig
  53. KBUILD_IMAGE := arch/sh/boot/zImage
  54. #
  55. # Choosing incompatible machines durings configuration will result in
  56. # error messages during linking.
  57. #
  58. LDFLAGS_vmlinux += -e _stext
  59. ifdef CONFIG_CPU_LITTLE_ENDIAN
  60. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64'
  61. LDFLAGS += -EL
  62. else
  63. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4'
  64. LDFLAGS += -EB
  65. endif
  66. CFLAGS += -pipe $(cflags-y)
  67. AFLAGS += $(cflags-y)
  68. head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
  69. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  70. core-y += arch/sh/kernel/ arch/sh/mm/
  71. core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
  72. # Boards
  73. machdir-$(CONFIG_SH_SOLUTION_ENGINE) += se/770x
  74. machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) += se/7722
  75. machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) += se/7751
  76. machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) += se/7780
  77. machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) += se/7300
  78. machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343
  79. machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) += se/73180
  80. machdir-$(CONFIG_SH_HP6XX) += hp6xx
  81. machdir-$(CONFIG_SH_DREAMCAST) += dreamcast
  82. machdir-$(CONFIG_SH_MPC1211) += mpc1211
  83. machdir-$(CONFIG_SH_SH03) += sh03
  84. machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear
  85. machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip
  86. machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d
  87. machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh
  88. machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705
  89. machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp
  90. machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw
  91. machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev
  92. machdir-$(CONFIG_SH_LANDISK) += landisk
  93. machdir-$(CONFIG_SH_TITAN) += titan
  94. machdir-$(CONFIG_SH_SHMIN) += shmin
  95. machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206
  96. machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619
  97. machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2
  98. incdir-y := $(notdir $(machdir-y))
  99. ifneq ($(machdir-y),)
  100. core-y += $(addprefix arch/sh/boards/, \
  101. $(filter-out ., $(patsubst %,%/,$(machdir-y))))
  102. endif
  103. # Companion chips
  104. core-$(CONFIG_HD64461) += arch/sh/cchips/hd6446x/hd64461/
  105. core-$(CONFIG_HD64465) += arch/sh/cchips/hd6446x/hd64465/
  106. core-$(CONFIG_VOYAGERGX) += arch/sh/cchips/voyagergx/
  107. cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2
  108. cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a
  109. cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3
  110. cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4
  111. libs-y := arch/sh/lib/ $(libs-y) $(LIBGCC)
  112. drivers-y += arch/sh/drivers/
  113. drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
  114. boot := arch/sh/boot
  115. CPPFLAGS_vmlinux.lds := -traditional
  116. incdir-prefix := $(srctree)/include/asm-sh/
  117. # Update machine arch and proc symlinks if something which affects
  118. # them changed. We use .arch and .mach to indicate when they were
  119. # updated last, otherwise make uses the target directory mtime.
  120. include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) \
  121. include/config/auto.conf FORCE
  122. @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)'
  123. $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
  124. $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu
  125. @touch $@
  126. # Most boards have their own mach directories. For the ones that
  127. # don't, just reference the parent directory so the semantics are
  128. # kept roughly the same.
  129. #
  130. # When multiple boards are compiled in at the same time, preference
  131. # for the mach link is given to whichever has a directory for its
  132. # headers. However, this is only a workaround until platforms that
  133. # can live in the same kernel image back away from relying on the
  134. # mach link.
  135. include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
  136. include/config/auto.conf FORCE
  137. $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
  138. $(Q)rm -f include/asm-sh/mach
  139. $(Q)for i in $(incdir-y); do \
  140. if [ -d $(incdir-prefix)$$i ]; then \
  141. echo -n ' SYMLINK include/asm-sh/mach -> '; \
  142. echo -e "include/asm-sh/$$i"; \
  143. ln -fsn $(incdir-prefix)$$i \
  144. include/asm-sh/mach; \
  145. else \
  146. if [ ! -d include/asm-sh/mach ]; then \
  147. echo -n ' SYMLINK include/asm-sh/mach -> '; \
  148. echo -e 'include/asm-sh'; \
  149. ln -fsn $(incdir-prefix) include/asm-sh/mach; \
  150. fi; \
  151. fi; \
  152. done
  153. @touch $@
  154. archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools
  155. PHONY += maketools FORCE
  156. maketools: include/linux/version.h FORCE
  157. $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
  158. all: zImage
  159. zImage uImage uImage.srec vmlinux.srec: vmlinux
  160. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  161. compressed: zImage
  162. archclean:
  163. $(Q)$(MAKE) $(clean)=$(boot)
  164. CLEAN_FILES += include/asm-sh/machtypes.h \
  165. include/asm-sh/cpu include/asm-sh/.cpu \
  166. include/asm-sh/mach include/asm-sh/.mach
  167. define archhelp
  168. @echo '* zImage - Compressed kernel image'
  169. @echo ' vmlinux.srec - Create an ELF S-record'
  170. @echo ' uImage - Create a bootable image for U-Boot'
  171. @echo ' uImage.srec - Create an S-record for U-Boot'
  172. endef