Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.
  6. #
  7. # This file is subject to the terms and conditions of the GNU General Public
  8. # License. See the file "COPYING" in the main directory of this archive
  9. # for more details.
  10. #
  11. # Copyright (C) 1994 by Hamish Macdonald
  12. # Copyright (C) 2002,2011 Greg Ungerer <[email protected]>
  13. #
  14. KBUILD_DEFCONFIG := multi_defconfig
  15. ifdef cross_compiling
  16. ifeq ($(CROSS_COMPILE),)
  17. CROSS_COMPILE := $(call cc-cross-prefix, \
  18. m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
  19. endif
  20. endif
  21. #
  22. # Enable processor type. Ordering of these is important - we want to
  23. # use the minimum processor type of the range we support. The logic
  24. # for 680x0 will only allow use of the -m68060 or -m68040 if no other
  25. # 680x0 type is specified - and no option is specified for 68030 or
  26. # 68020. The other m68k/ColdFire types always specify some type of
  27. # compiler cpu type flag.
  28. #
  29. ifndef CONFIG_M68040
  30. cpuflags-$(CONFIG_M68060) = -m68060
  31. endif
  32. ifndef CONFIG_M68060
  33. cpuflags-$(CONFIG_M68040) = -m68040
  34. endif
  35. cpuflags-$(CONFIG_M68030) =
  36. cpuflags-$(CONFIG_M68020) =
  37. cpuflags-$(CONFIG_M68000) = -m68000
  38. cpuflags-$(CONFIG_M5441x) = $(call cc-option,-mcpu=54455,-mcfv4e)
  39. cpuflags-$(CONFIG_M54xx) = $(call cc-option,-mcpu=5475,-m5200)
  40. cpuflags-$(CONFIG_M5407) = $(call cc-option,-mcpu=5407,-m5200)
  41. cpuflags-$(CONFIG_M532x) = $(call cc-option,-mcpu=532x,-m5307)
  42. cpuflags-$(CONFIG_M537x) = $(call cc-option,-mcpu=537x,-m5307)
  43. cpuflags-$(CONFIG_M5307) = $(call cc-option,-mcpu=5307,-m5200)
  44. cpuflags-$(CONFIG_M528x) = $(call cc-option,-mcpu=528x,-m5307)
  45. cpuflags-$(CONFIG_M5275) = $(call cc-option,-mcpu=5275,-m5307)
  46. cpuflags-$(CONFIG_M5272) = $(call cc-option,-mcpu=5272,-m5307)
  47. cpuflags-$(CONFIG_M5271) = $(call cc-option,-mcpu=5271,-m5307)
  48. cpuflags-$(CONFIG_M523x) = $(call cc-option,-mcpu=523x,-m5307)
  49. cpuflags-$(CONFIG_M525x) = $(call cc-option,-mcpu=5253,-m5200)
  50. cpuflags-$(CONFIG_M5249) = $(call cc-option,-mcpu=5249,-m5200)
  51. cpuflags-$(CONFIG_M520x) = $(call cc-option,-mcpu=5208,-m5200)
  52. cpuflags-$(CONFIG_M5206e) = $(call cc-option,-mcpu=5206e,-m5200)
  53. cpuflags-$(CONFIG_M5206) = $(call cc-option,-mcpu=5206,-m5200)
  54. # Evaluate tune cc-option calls now
  55. cpuflags-y := $(cpuflags-y)
  56. KBUILD_AFLAGS += $(cpuflags-y)
  57. KBUILD_CFLAGS += $(cpuflags-y)
  58. KBUILD_CFLAGS += -pipe -ffreestanding
  59. ifdef CONFIG_MMU
  60. KBUILD_CFLAGS += -ffixed-a2
  61. else
  62. # we can use a m68k-linux-gcc toolchain with these in place
  63. KBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\"
  64. KBUILD_CPPFLAGS += -D__uClinux__
  65. endif
  66. KBUILD_LDFLAGS := -m m68kelf
  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. libs-y += arch/m68k/lib/
  77. all: zImage
  78. lilo: vmlinux
  79. if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
  80. if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
  81. cat vmlinux > $(INSTALL_PATH)/vmlinux
  82. cp System.map $(INSTALL_PATH)/System.map
  83. if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
  84. zImage compressed: vmlinux.gz
  85. vmlinux.gz: vmlinux
  86. ifndef CONFIG_KGDB
  87. cp vmlinux vmlinux.tmp
  88. $(STRIP) vmlinux.tmp
  89. $(KGZIP) -9c vmlinux.tmp >vmlinux.gz
  90. rm vmlinux.tmp
  91. else
  92. $(KGZIP) -9c vmlinux >vmlinux.gz
  93. endif
  94. bzImage: vmlinux.bz2
  95. vmlinux.bz2: vmlinux
  96. ifndef CONFIG_KGDB
  97. cp vmlinux vmlinux.tmp
  98. $(STRIP) vmlinux.tmp
  99. $(KBZIP2) -1c vmlinux.tmp >vmlinux.bz2
  100. rm vmlinux.tmp
  101. else
  102. $(KBZIP2) -1c vmlinux >vmlinux.bz2
  103. endif
  104. CLEAN_FILES += vmlinux.gz vmlinux.bz2
  105. archheaders:
  106. $(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all
  107. install: KBUILD_IMAGE := vmlinux.gz
  108. install:
  109. $(call cmd,install)