Makefile 5.1 KB

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