Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #
  2. # m68k/Makefile
  3. #
  4. # This file is included by the global makefile so that you can add your own
  5. # architecture-specific flags and dependencies. Remember to do have actions
  6. # for "archclean" and "archdep" for cleaning up and making dependencies for
  7. # this architecture
  8. #
  9. # This file is subject to the terms and conditions of the GNU General Public
  10. # License. See the file "COPYING" in the main directory of this archive
  11. # for more details.
  12. #
  13. # Copyright (C) 1994 by Hamish Macdonald
  14. # Copyright (C) 2002,2011 Greg Ungerer <gerg@snapgear.com>
  15. #
  16. KBUILD_DEFCONFIG := multi_defconfig
  17. #
  18. # Enable processor type. Ordering of these is important - we want to
  19. # use the minimum processor type of the range we support. The logic
  20. # for 680x0 will only allow use of the -m68060 or -m68040 if no other
  21. # 680x0 type is specified - and no option is specified for 68030 or
  22. # 68020. The other m68k/ColdFire types always specify some type of
  23. # compiler cpu type flag.
  24. #
  25. ifndef CONFIG_M68040
  26. cpuflags-$(CONFIG_M68060) := -m68060
  27. endif
  28. ifndef CONFIG_M68060
  29. cpuflags-$(CONFIG_M68040) := -m68040
  30. endif
  31. cpuflags-$(CONFIG_M68030) :=
  32. cpuflags-$(CONFIG_M68020) :=
  33. cpuflags-$(CONFIG_M68360) := -m68332
  34. cpuflags-$(CONFIG_M68000) := -m68000
  35. cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200)
  36. cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200)
  37. cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
  38. cpuflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200)
  39. cpuflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307)
  40. cpuflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
  41. cpuflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307)
  42. cpuflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
  43. cpuflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
  44. cpuflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
  45. cpuflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
  46. cpuflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200)
  47. cpuflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200)
  48. KBUILD_AFLAGS += $(cpuflags-y)
  49. KBUILD_CFLAGS += $(cpuflags-y) -pipe
  50. ifdef CONFIG_MMU
  51. # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
  52. KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
  53. else
  54. # we can use a m68k-linux-gcc toolchain with these in place
  55. KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
  56. KBUILD_CFLAGS += -D__uClinux__
  57. KBUILD_AFLAGS += -D__uClinux__
  58. endif
  59. LDFLAGS := -m m68kelf
  60. KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
  61. ifneq ($(SUBARCH),$(ARCH))
  62. ifeq ($(CROSS_COMPILE),)
  63. CROSS_COMPILE := $(call cc-cross-prefix, \
  64. m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
  65. endif
  66. endif
  67. ifdef CONFIG_SUN3
  68. LDFLAGS_vmlinux = -N
  69. endif
  70. CHECKFLAGS += -D__mc68000__
  71. ifdef CONFIG_KGDB
  72. # If configured for kgdb support, include debugging infos and keep the
  73. # frame pointer
  74. KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
  75. endif
  76. #
  77. # Select the assembler head startup code. Order is important. The default
  78. # head code is first, processor specific selections can override it after.
  79. #
  80. head-y := arch/m68k/kernel/head.o
  81. head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o
  82. head-$(CONFIG_M68360) := arch/m68k/platform/68360/head.o
  83. head-$(CONFIG_M68000) := arch/m68k/platform/68328/head.o
  84. head-$(CONFIG_COLDFIRE) := arch/m68k/platform/coldfire/head.o
  85. core-y += arch/m68k/kernel/ arch/m68k/mm/
  86. libs-y += arch/m68k/lib/
  87. core-$(CONFIG_Q40) += arch/m68k/q40/
  88. core-$(CONFIG_AMIGA) += arch/m68k/amiga/
  89. core-$(CONFIG_ATARI) += arch/m68k/atari/
  90. core-$(CONFIG_MAC) += arch/m68k/mac/
  91. core-$(CONFIG_HP300) += arch/m68k/hp300/
  92. core-$(CONFIG_APOLLO) += arch/m68k/apollo/
  93. core-$(CONFIG_MVME147) += arch/m68k/mvme147/
  94. core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
  95. core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
  96. core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
  97. core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
  98. core-$(CONFIG_NATFEAT) += arch/m68k/emu/
  99. core-$(CONFIG_M68040) += arch/m68k/fpsp040/
  100. core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
  101. core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
  102. core-$(CONFIG_M68360) += arch/m68k/platform/68360/
  103. core-$(CONFIG_M68000) += arch/m68k/platform/68328/
  104. core-$(CONFIG_M68EZ328) += arch/m68k/platform/68EZ328/
  105. core-$(CONFIG_M68VZ328) += arch/m68k/platform/68VZ328/
  106. core-$(CONFIG_COLDFIRE) += arch/m68k/platform/coldfire/
  107. core-$(CONFIG_M5206) += arch/m68k/platform/5206/
  108. core-$(CONFIG_M5206e) += arch/m68k/platform/5206/
  109. core-$(CONFIG_M520x) += arch/m68k/platform/520x/
  110. core-$(CONFIG_M523x) += arch/m68k/platform/523x/
  111. core-$(CONFIG_M5249) += arch/m68k/platform/5249/
  112. core-$(CONFIG_M527x) += arch/m68k/platform/527x/
  113. core-$(CONFIG_M5272) += arch/m68k/platform/5272/
  114. core-$(CONFIG_M528x) += arch/m68k/platform/528x/
  115. core-$(CONFIG_M5307) += arch/m68k/platform/5307/
  116. core-$(CONFIG_M532x) += arch/m68k/platform/532x/
  117. core-$(CONFIG_M5407) += arch/m68k/platform/5407/
  118. core-$(CONFIG_M54xx) += arch/m68k/platform/54xx/
  119. all: zImage
  120. lilo: vmlinux
  121. if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
  122. if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
  123. cat vmlinux > $(INSTALL_PATH)/vmlinux
  124. cp System.map $(INSTALL_PATH)/System.map
  125. if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
  126. zImage compressed: vmlinux.gz
  127. vmlinux.gz: vmlinux
  128. ifndef CONFIG_KGDB
  129. cp vmlinux vmlinux.tmp
  130. $(STRIP) vmlinux.tmp
  131. gzip -9c vmlinux.tmp >vmlinux.gz
  132. rm vmlinux.tmp
  133. else
  134. gzip -9c vmlinux >vmlinux.gz
  135. endif
  136. bzImage: vmlinux.bz2
  137. vmlinux.bz2: vmlinux
  138. ifndef CONFIG_KGDB
  139. cp vmlinux vmlinux.tmp
  140. $(STRIP) vmlinux.tmp
  141. bzip2 -1c vmlinux.tmp >vmlinux.bz2
  142. rm vmlinux.tmp
  143. else
  144. bzip2 -1c vmlinux >vmlinux.bz2
  145. endif
  146. archclean:
  147. rm -f vmlinux.gz vmlinux.bz2
  148. install:
  149. sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"