Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. cflags-y := -mb
  17. cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
  18. isa-y := any
  19. isa-$(CONFIG_SH_DSP) := sh
  20. isa-$(CONFIG_CPU_SH2) := sh2
  21. isa-$(CONFIG_CPU_SH2A) := sh2a
  22. isa-$(CONFIG_CPU_SH3) := sh3
  23. isa-$(CONFIG_CPU_SH4) := sh4
  24. isa-$(CONFIG_CPU_SH4A) := sh4a
  25. isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
  26. isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
  27. ifndef CONFIG_MMU
  28. isa-y := $(isa-y)-nommu
  29. endif
  30. ifndef CONFIG_SH_DSP
  31. ifndef CONFIG_SH_FPU
  32. isa-y := $(isa-y)-nofpu
  33. endif
  34. endif
  35. cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),)
  36. cflags-$(CONFIG_CPU_SH2) += -m2
  37. cflags-$(CONFIG_CPU_SH3) += -m3
  38. cflags-$(CONFIG_CPU_SH4) += -m4 \
  39. $(call cc-option,-mno-implicit-fp,-m4-nofpu)
  40. cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a-nofpu,)
  41. cflags-$(CONFIG_SH_DSP) += -Wa,-dsp
  42. cflags-$(CONFIG_SH_KGDB) += -g
  43. cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
  44. $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
  45. OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
  46. #
  47. # arch/sh/defconfig doesn't reflect any real hardware, and as such should
  48. # never be used by anyone. Use a board-specific defconfig that has a
  49. # reasonable chance of being current instead.
  50. #
  51. KBUILD_DEFCONFIG := rts7751r2d_defconfig
  52. #
  53. # Choosing incompatible machines durings configuration will result in
  54. # error messages during linking.
  55. #
  56. LDFLAGS_vmlinux += -e _stext
  57. ifdef CONFIG_CPU_LITTLE_ENDIAN
  58. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64'
  59. LDFLAGS += -EL
  60. else
  61. LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4'
  62. LDFLAGS += -EB
  63. endif
  64. CFLAGS += -pipe $(cflags-y)
  65. AFLAGS += $(cflags-y)
  66. head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
  67. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  68. core-y += arch/sh/kernel/ arch/sh/mm/
  69. core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
  70. # Boards
  71. machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x
  72. machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751
  73. machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300
  74. machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) := se/7343
  75. machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180
  76. machdir-$(CONFIG_SH_HP6XX) := hp6xx
  77. machdir-$(CONFIG_SH_EC3104) := ec3104
  78. machdir-$(CONFIG_SH_SATURN) := saturn
  79. machdir-$(CONFIG_SH_DREAMCAST) := dreamcast
  80. machdir-$(CONFIG_SH_BIGSUR) := bigsur
  81. machdir-$(CONFIG_SH_MPC1211) := mpc1211
  82. machdir-$(CONFIG_SH_SH03) := sh03
  83. machdir-$(CONFIG_SH_SECUREEDGE5410) := snapgear
  84. machdir-$(CONFIG_SH_HS7751RVOIP) := renesas/hs7751rvoip
  85. machdir-$(CONFIG_SH_RTS7751R2D) := renesas/rts7751r2d
  86. machdir-$(CONFIG_SH_7751_SYSTEMH) := renesas/systemh
  87. machdir-$(CONFIG_SH_EDOSK7705) := renesas/edosk7705
  88. machdir-$(CONFIG_SH_R7780RP) := renesas/r7780rp
  89. machdir-$(CONFIG_SH_7710VOIPGW) := renesas/sh7710voipgw
  90. machdir-$(CONFIG_SH_SH4202_MICRODEV) := superh/microdev
  91. machdir-$(CONFIG_SH_LANDISK) := landisk
  92. machdir-$(CONFIG_SH_TITAN) := titan
  93. machdir-$(CONFIG_SH_SHMIN) := shmin
  94. machdir-$(CONFIG_SH_UNKNOWN) := unknown
  95. incdir-y := $(notdir $(machdir-y))
  96. incdir-$(CONFIG_SH_HP6XX) := hp6xx
  97. ifneq ($(machdir-y),)
  98. core-y += arch/sh/boards/$(machdir-y)/
  99. endif
  100. # Companion chips
  101. core-$(CONFIG_HD64461) += arch/sh/cchips/hd6446x/hd64461/
  102. core-$(CONFIG_HD64465) += arch/sh/cchips/hd6446x/hd64465/
  103. core-$(CONFIG_VOYAGERGX) += arch/sh/cchips/voyagergx/
  104. cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2
  105. cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3
  106. cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4
  107. libs-y := arch/sh/lib/ $(libs-y) $(LIBGCC)
  108. drivers-y += arch/sh/drivers/
  109. drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
  110. boot := arch/sh/boot
  111. CPPFLAGS_vmlinux.lds := -traditional
  112. incdir-prefix := $(srctree)/include/asm-sh/
  113. # Update machine arch and proc symlinks if something which affects
  114. # them changed. We use .arch and .mach to indicate when they were
  115. # updated last, otherwise make uses the target directory mtime.
  116. include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) \
  117. include/config/auto.conf FORCE
  118. @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)'
  119. $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
  120. $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu
  121. @touch $@
  122. # Most boards have their own mach directories. For the ones that
  123. # don't, just reference the parent directory so the semantics are
  124. # kept roughly the same.
  125. include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
  126. include/config/auto.conf FORCE
  127. @echo -n ' SYMLINK include/asm-sh/mach -> '
  128. $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
  129. $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \
  130. echo -e 'include/asm-sh/$(incdir-y)'; \
  131. ln -fsn $(incdir-prefix)$(incdir-y) \
  132. include/asm-sh/mach; \
  133. else \
  134. echo -e 'include/asm-sh'; \
  135. ln -fsn $(incdir-prefix) include/asm-sh/mach; \
  136. fi
  137. @touch $@
  138. archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools
  139. PHONY += maketools FORCE
  140. maketools: include/linux/version.h FORCE
  141. $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
  142. all: zImage
  143. zImage: vmlinux
  144. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  145. compressed: zImage
  146. archclean:
  147. $(Q)$(MAKE) $(clean)=$(boot)
  148. CLEAN_FILES += include/asm-sh/machtypes.h
  149. define archhelp
  150. @echo ' zImage - Compressed kernel image (arch/sh/boot/zImage)'
  151. endef