Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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)
  58. KBUILD_CFLAGS += -pipe -ffreestanding
  59. ifdef CONFIG_MMU
  60. # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
  61. KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
  62. else
  63. # we can use a m68k-linux-gcc toolchain with these in place
  64. KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
  65. KBUILD_CFLAGS += -D__uClinux__
  66. KBUILD_AFLAGS += -D__uClinux__
  67. endif
  68. KBUILD_LDFLAGS := -m m68kelf
  69. KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
  70. ifdef CONFIG_SUN3
  71. LDFLAGS_vmlinux = -N
  72. endif
  73. CHECKFLAGS += -D__mc68000__
  74. ifdef CONFIG_KGDB
  75. # If configured for kgdb support, include debugging infos and keep the
  76. # frame pointer
  77. KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
  78. endif
  79. #
  80. # Select the assembler head startup code. Order is important. The default
  81. # head code is first, processor specific selections can override it after.
  82. #
  83. head-y := arch/m68k/kernel/head.o
  84. head-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o
  85. head-$(CONFIG_M68000) := arch/m68k/68000/head.o
  86. head-$(CONFIG_COLDFIRE) := arch/m68k/coldfire/head.o
  87. core-y += arch/m68k/kernel/ arch/m68k/mm/
  88. libs-y += arch/m68k/lib/
  89. core-$(CONFIG_Q40) += arch/m68k/q40/
  90. core-$(CONFIG_AMIGA) += arch/m68k/amiga/
  91. core-$(CONFIG_ATARI) += arch/m68k/atari/
  92. core-$(CONFIG_MAC) += arch/m68k/mac/
  93. core-$(CONFIG_HP300) += arch/m68k/hp300/
  94. core-$(CONFIG_APOLLO) += arch/m68k/apollo/
  95. core-$(CONFIG_MVME147) += arch/m68k/mvme147/
  96. core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
  97. core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
  98. core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
  99. core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
  100. core-$(CONFIG_NATFEAT) += arch/m68k/emu/
  101. core-$(CONFIG_M68040) += arch/m68k/fpsp040/
  102. core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
  103. core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
  104. core-$(CONFIG_M68000) += arch/m68k/68000/
  105. core-$(CONFIG_COLDFIRE) += arch/m68k/coldfire/
  106. all: zImage
  107. lilo: vmlinux
  108. if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
  109. if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
  110. cat vmlinux > $(INSTALL_PATH)/vmlinux
  111. cp System.map $(INSTALL_PATH)/System.map
  112. if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
  113. zImage compressed: vmlinux.gz
  114. vmlinux.gz: vmlinux
  115. ifndef CONFIG_KGDB
  116. cp vmlinux vmlinux.tmp
  117. $(STRIP) vmlinux.tmp
  118. gzip -9c vmlinux.tmp >vmlinux.gz
  119. rm vmlinux.tmp
  120. else
  121. gzip -9c vmlinux >vmlinux.gz
  122. endif
  123. bzImage: vmlinux.bz2
  124. vmlinux.bz2: vmlinux
  125. ifndef CONFIG_KGDB
  126. cp vmlinux vmlinux.tmp
  127. $(STRIP) vmlinux.tmp
  128. bzip2 -1c vmlinux.tmp >vmlinux.bz2
  129. rm vmlinux.tmp
  130. else
  131. bzip2 -1c vmlinux >vmlinux.bz2
  132. endif
  133. archclean:
  134. rm -f vmlinux.gz vmlinux.bz2
  135. install:
  136. sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"