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