Makefile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. ifneq ($(SUBARCH),$(ARCH))
  18. ifeq ($(CROSS_COMPILE),)
  19. CROSS_COMPILE := $(call cc-cross-prefix, \
  20. m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
  21. endif
  22. endif
  23. #
  24. # Enable processor type. Ordering of these is important - we want to
  25. # use the minimum processor type of the range we support. The logic
  26. # for 680x0 will only allow use of the -m68060 or -m68040 if no other
  27. # 680x0 type is specified - and no option is specified for 68030 or
  28. # 68020. The other m68k/ColdFire types always specify some type of
  29. # compiler cpu type flag.
  30. #
  31. ifndef CONFIG_M68040
  32. cpuflags-$(CONFIG_M68060) := -m68060
  33. endif
  34. ifndef CONFIG_M68060
  35. cpuflags-$(CONFIG_M68040) := -m68040
  36. endif
  37. cpuflags-$(CONFIG_M68030) :=
  38. cpuflags-$(CONFIG_M68020) :=
  39. cpuflags-$(CONFIG_M68360) := -m68332
  40. cpuflags-$(CONFIG_M68000) := -m68000
  41. cpuflags-$(CONFIG_M5441x) := $(call cc-option,-mcpu=54455,-mcfv4e)
  42. cpuflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200)
  43. cpuflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200)
  44. cpuflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
  45. cpuflags-$(CONFIG_M537x) := $(call cc-option,-mcpu=537x,-m5307)
  46. cpuflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200)
  47. cpuflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307)
  48. cpuflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
  49. cpuflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307)
  50. cpuflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
  51. cpuflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
  52. cpuflags-$(CONFIG_M525x) := $(call cc-option,-mcpu=5253,-m5200)
  53. cpuflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
  54. cpuflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
  55. cpuflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200)
  56. cpuflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200)
  57. KBUILD_AFLAGS += $(cpuflags-y)
  58. KBUILD_CFLAGS += $(cpuflags-y)
  59. KBUILD_CFLAGS += -pipe -ffreestanding
  60. ifdef CONFIG_MMU
  61. # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
  62. KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
  63. else
  64. # we can use a m68k-linux-gcc toolchain with these in place
  65. KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
  66. KBUILD_CFLAGS += -D__uClinux__
  67. KBUILD_AFLAGS += -D__uClinux__
  68. endif
  69. LDFLAGS := -m m68kelf
  70. KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
  71. ifdef CONFIG_SUN3
  72. LDFLAGS_vmlinux = -N
  73. endif
  74. CHECKFLAGS += -D__mc68000__
  75. ifdef CONFIG_KGDB
  76. # If configured for kgdb support, include debugging infos and keep the
  77. # frame pointer
  78. KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
  79. endif
  80. #
  81. # Select the assembler head startup code. Order is important. The default
  82. # head code is first, processor specific selections can override it after.
  83. #
  84. head-y := arch/m68k/kernel/head.o
  85. head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o
  86. head-$(CONFIG_M68360) := arch/m68k/68360/head.o
  87. head-$(CONFIG_M68000) := arch/m68k/68000/head.o
  88. head-$(CONFIG_COLDFIRE) := arch/m68k/coldfire/head.o
  89. core-y += arch/m68k/kernel/ arch/m68k/mm/
  90. libs-y += arch/m68k/lib/
  91. core-$(CONFIG_Q40) += arch/m68k/q40/
  92. core-$(CONFIG_AMIGA) += arch/m68k/amiga/
  93. core-$(CONFIG_ATARI) += arch/m68k/atari/
  94. core-$(CONFIG_MAC) += arch/m68k/mac/
  95. core-$(CONFIG_HP300) += arch/m68k/hp300/
  96. core-$(CONFIG_APOLLO) += arch/m68k/apollo/
  97. core-$(CONFIG_MVME147) += arch/m68k/mvme147/
  98. core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
  99. core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
  100. core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
  101. core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
  102. core-$(CONFIG_NATFEAT) += arch/m68k/emu/
  103. core-$(CONFIG_M68040) += arch/m68k/fpsp040/
  104. core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
  105. core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
  106. core-$(CONFIG_M68360) += arch/m68k/68360/
  107. core-$(CONFIG_M68000) += arch/m68k/68000/
  108. core-$(CONFIG_COLDFIRE) += arch/m68k/coldfire/
  109. all: zImage
  110. lilo: vmlinux
  111. if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
  112. if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
  113. cat vmlinux > $(INSTALL_PATH)/vmlinux
  114. cp System.map $(INSTALL_PATH)/System.map
  115. if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
  116. zImage compressed: vmlinux.gz
  117. vmlinux.gz: vmlinux
  118. ifndef CONFIG_KGDB
  119. cp vmlinux vmlinux.tmp
  120. $(STRIP) vmlinux.tmp
  121. gzip -9c vmlinux.tmp >vmlinux.gz
  122. rm vmlinux.tmp
  123. else
  124. gzip -9c vmlinux >vmlinux.gz
  125. endif
  126. bzImage: vmlinux.bz2
  127. vmlinux.bz2: vmlinux
  128. ifndef CONFIG_KGDB
  129. cp vmlinux vmlinux.tmp
  130. $(STRIP) vmlinux.tmp
  131. bzip2 -1c vmlinux.tmp >vmlinux.bz2
  132. rm vmlinux.tmp
  133. else
  134. bzip2 -1c vmlinux >vmlinux.bz2
  135. endif
  136. archclean:
  137. rm -f vmlinux.gz vmlinux.bz2
  138. install:
  139. sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"