1 # SPDX-License-Identifier: GPL-2.0 !! 1 # 2 KBUILD_DEFCONFIG := mmu_defconfig !! 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 # >> 15 >> 16 KBUILD_DEFCONFIG := multi_defconfig >> 17 >> 18 # override top level makefile >> 19 AS += -m68020 >> 20 LDFLAGS := -m m68kelf >> 21 LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds >> 22 ifneq ($(SUBARCH),$(ARCH)) >> 23 ifeq ($(CROSS_COMPILE),) >> 24 CROSS_COMPILE := $(call cc-cross-prefix, \ >> 25 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-) >> 26 endif >> 27 endif >> 28 >> 29 ifdef CONFIG_SUN3 >> 30 LDFLAGS_vmlinux = -N >> 31 endif >> 32 >> 33 CHECKFLAGS += -D__mc68000__ 3 34 4 UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\" !! 35 # without -fno-strength-reduce the 53c7xx.c driver fails ;-( >> 36 KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2 >> 37 >> 38 # enable processor switch if compiled only for a single cpu >> 39 ifndef CONFIG_M68020 >> 40 ifndef CONFIG_M68030 >> 41 >> 42 ifndef CONFIG_M68060 >> 43 KBUILD_CFLAGS += -m68040 >> 44 endif 5 45 6 # What CPU version are we building for, and cr !! 46 ifndef CONFIG_M68040 7 # as major.minor.rev !! 47 KBUILD_CFLAGS += -m68060 8 CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VE !! 48 endif 9 CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER) !! 49 10 CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER) !! 50 endif 11 CPU_REV := $(word 3, $(subst ., , $(CPU_VER) !! 51 endif 12 !! 52 13 export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV !! 53 ifdef CONFIG_KGDB 14 !! 54 # If configured for kgdb support, include debugging infos and keep the 15 # Use cpu-related CONFIG_ vars to set compile !! 55 # frame pointer 16 # The various CONFIG_XILINX cpu features optio !! 56 KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g 17 # rather than bools y/n !! 57 endif 18 !! 58 19 # Work out HW multipler support. This is trick !! 59 ifndef CONFIG_SUN3 20 # 1. Spartan2 has no HW multipliers. !! 60 head-y := arch/m68k/kernel/head.o 21 # 2. MicroBlaze v3.x always uses them, except !! 61 else 22 # 3. All other FPGa/CPU ver combos, we can tru !! 62 head-y := arch/m68k/kernel/sun3-head.o 23 ifeq (,$(findstring spartan2,$(CONFIG_XILINX_M !! 63 endif 24 ifeq ($(CPU_MAJOR),3) !! 64 25 CPUFLAGS-1 += -mno-xl-soft-mul !! 65 core-y += arch/m68k/kernel/ arch/m68k/mm/ 26 else !! 66 libs-y += arch/m68k/lib/ 27 # USE_HW_MUL can be 0, 1, or 2, defining a !! 67 28 CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROB !! 68 core-$(CONFIG_Q40) += arch/m68k/q40/ 29 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_H !! 69 core-$(CONFIG_AMIGA) += arch/m68k/amiga/ 30 endif !! 70 core-$(CONFIG_ATARI) += arch/m68k/atari/ 31 endif !! 71 core-$(CONFIG_MAC) += arch/m68k/mac/ 32 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) !! 72 core-$(CONFIG_HP300) += arch/m68k/hp300/ 33 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARRE !! 73 core-$(CONFIG_APOLLO) += arch/m68k/apollo/ 34 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_ !! 74 core-$(CONFIG_MVME147) += arch/m68k/mvme147/ 35 !! 75 core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/ 36 ifdef CONFIG_CPU_BIG_ENDIAN !! 76 core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/ 37 KBUILD_CFLAGS += -mbig-endian !! 77 core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/ 38 KBUILD_AFLAGS += -mbig-endian !! 78 core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/ 39 KBUILD_LDFLAGS += -EB !! 79 core-$(CONFIG_M68040) += arch/m68k/fpsp040/ >> 80 core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ >> 81 core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/ >> 82 >> 83 all: zImage >> 84 >> 85 lilo: vmlinux >> 86 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi >> 87 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi >> 88 cat vmlinux > $(INSTALL_PATH)/vmlinux >> 89 cp System.map $(INSTALL_PATH)/System.map >> 90 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi >> 91 >> 92 zImage compressed: vmlinux.gz >> 93 >> 94 vmlinux.gz: vmlinux >> 95 >> 96 ifndef CONFIG_KGDB >> 97 cp vmlinux vmlinux.tmp >> 98 $(STRIP) vmlinux.tmp >> 99 gzip -9c vmlinux.tmp >vmlinux.gz >> 100 rm vmlinux.tmp >> 101 else >> 102 gzip -9c vmlinux >vmlinux.gz >> 103 endif >> 104 >> 105 bzImage: vmlinux.bz2 >> 106 >> 107 vmlinux.bz2: vmlinux >> 108 >> 109 ifndef CONFIG_KGDB >> 110 cp vmlinux vmlinux.tmp >> 111 $(STRIP) vmlinux.tmp >> 112 bzip2 -1c vmlinux.tmp >vmlinux.bz2 >> 113 rm vmlinux.tmp 40 else 114 else 41 KBUILD_CFLAGS += -mlittle-endian !! 115 bzip2 -1c vmlinux >vmlinux.bz2 42 KBUILD_AFLAGS += -mlittle-endian !! 116 endif 43 KBUILD_LDFLAGS += -EL !! 117 44 endif !! 118 archclean: 45 !! 119 rm -f vmlinux.gz vmlinux.bz2 46 CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VE << 47 << 48 # r31 holds current when in kernel mode << 49 KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(C << 50 << 51 libs-y += arch/microblaze/lib/ << 52 << 53 boot := arch/microblaze/boot << 54 << 55 # Are we making a simpleImage.<boardname> targ << 56 DTB:=$(subst simpleImage.,,$(filter simpleImag << 57 << 58 export DTB << 59 << 60 all: linux.bin << 61 << 62 archheaders: << 63 $(Q)$(MAKE) $(build)=arch/microblaze/k << 64 << 65 PHONY += linux.bin linux.bin.gz linux.bin.ub << 66 linux.bin.ub linux.bin.gz: linux.bin << 67 linux.bin: vmlinux << 68 linux.bin linux.bin.gz linux.bin.ub: << 69 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ << 70 @echo 'Kernel: $(boot)/$@ is ready' ' << 71 << 72 PHONY += simpleImage.$(DTB) << 73 simpleImage.$(DTB): vmlinux << 74 $(Q)$(MAKE) $(build)=$(boot) $(addpref << 75 @echo 'Kernel: $(boot)/$@ is ready' ' << 76 << 77 define archhelp << 78 echo '* linux.bin - Create raw binary' << 79 echo ' linux.bin.gz - Create compressed raw << 80 echo ' linux.bin.ub - Create U-Boot wrapped << 81 echo ' simpleImage.<dt> - Create the follow << 82 echo ' simpleImage.<dt> << 83 echo ' simpleImage.<dt>.u << 84 echo ' simpleImage.<dt>.u << 85 echo ' simpleImage.<dt>.s << 86 echo ' Targets with <dt> embed a device tre << 87 echo ' These targets support board with fir << 88 echo ' support passing a device tree direct << 89 echo ' name of a dts file from the arch/mic << 90 echo ' (minus the .dts extension).' << 91 endef << 92 120 93 MRPROPER_FILES += $(boot)/simpleImage.* !! 121 install: >> 122 sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.