1281eff53SGreg Ungerer# 2281eff53SGreg Ungerer# m68k/Makefile 3281eff53SGreg Ungerer# 4281eff53SGreg Ungerer# This file is included by the global makefile so that you can add your own 58212f898SMasahiro Yamada# architecture-specific flags and dependencies. 6281eff53SGreg Ungerer# 7281eff53SGreg Ungerer# This file is subject to the terms and conditions of the GNU General Public 8281eff53SGreg Ungerer# License. See the file "COPYING" in the main directory of this archive 9281eff53SGreg Ungerer# for more details. 10281eff53SGreg Ungerer# 11281eff53SGreg Ungerer# Copyright (C) 1994 by Hamish Macdonald 12281eff53SGreg Ungerer# Copyright (C) 2002,2011 Greg Ungerer <gerg@snapgear.com> 13281eff53SGreg Ungerer# 14281eff53SGreg Ungerer 15b739912eSAdrian BunkKBUILD_DEFCONFIG := multi_defconfig 16ef85ecbfSAdrian Bunk 1723243c1aSMasahiro Yamadaifdef cross_compiling 18f25e918eSGeert Uytterhoeven ifeq ($(CROSS_COMPILE),) 19f25e918eSGeert Uytterhoeven CROSS_COMPILE := $(call cc-cross-prefix, \ 20f25e918eSGeert Uytterhoeven m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-) 21f25e918eSGeert Uytterhoeven endif 22f25e918eSGeert Uytterhoevenendif 23f25e918eSGeert Uytterhoeven 24281eff53SGreg Ungerer# 25281eff53SGreg Ungerer# Enable processor type. Ordering of these is important - we want to 26281eff53SGreg Ungerer# use the minimum processor type of the range we support. The logic 27281eff53SGreg Ungerer# for 680x0 will only allow use of the -m68060 or -m68040 if no other 28281eff53SGreg Ungerer# 680x0 type is specified - and no option is specified for 68030 or 29281eff53SGreg Ungerer# 68020. The other m68k/ColdFire types always specify some type of 30281eff53SGreg Ungerer# compiler cpu type flag. 31281eff53SGreg Ungerer# 32281eff53SGreg Ungererifndef CONFIG_M68040 332367b026SMasahiro Yamadacpuflags-$(CONFIG_M68060) = -m68060 341da177e4SLinus Torvaldsendif 35281eff53SGreg Ungererifndef CONFIG_M68060 362367b026SMasahiro Yamadacpuflags-$(CONFIG_M68040) = -m68040 37281eff53SGreg Ungererendif 382367b026SMasahiro Yamadacpuflags-$(CONFIG_M68030) = 392367b026SMasahiro Yamadacpuflags-$(CONFIG_M68020) = 402367b026SMasahiro Yamadacpuflags-$(CONFIG_M68000) = -m68000 412367b026SMasahiro Yamadacpuflags-$(CONFIG_M5441x) = $(call cc-option,-mcpu=54455,-mcfv4e) 422367b026SMasahiro Yamadacpuflags-$(CONFIG_M54xx) = $(call cc-option,-mcpu=5475,-m5200) 432367b026SMasahiro Yamadacpuflags-$(CONFIG_M5407) = $(call cc-option,-mcpu=5407,-m5200) 442367b026SMasahiro Yamadacpuflags-$(CONFIG_M532x) = $(call cc-option,-mcpu=532x,-m5307) 452367b026SMasahiro Yamadacpuflags-$(CONFIG_M537x) = $(call cc-option,-mcpu=537x,-m5307) 462367b026SMasahiro Yamadacpuflags-$(CONFIG_M5307) = $(call cc-option,-mcpu=5307,-m5200) 472367b026SMasahiro Yamadacpuflags-$(CONFIG_M528x) = $(call cc-option,-mcpu=528x,-m5307) 482367b026SMasahiro Yamadacpuflags-$(CONFIG_M5275) = $(call cc-option,-mcpu=5275,-m5307) 492367b026SMasahiro Yamadacpuflags-$(CONFIG_M5272) = $(call cc-option,-mcpu=5272,-m5307) 502367b026SMasahiro Yamadacpuflags-$(CONFIG_M5271) = $(call cc-option,-mcpu=5271,-m5307) 512367b026SMasahiro Yamadacpuflags-$(CONFIG_M523x) = $(call cc-option,-mcpu=523x,-m5307) 522367b026SMasahiro Yamadacpuflags-$(CONFIG_M525x) = $(call cc-option,-mcpu=5253,-m5200) 532367b026SMasahiro Yamadacpuflags-$(CONFIG_M5249) = $(call cc-option,-mcpu=5249,-m5200) 542367b026SMasahiro Yamadacpuflags-$(CONFIG_M520x) = $(call cc-option,-mcpu=5208,-m5200) 552367b026SMasahiro Yamadacpuflags-$(CONFIG_M5206e) = $(call cc-option,-mcpu=5206e,-m5200) 562367b026SMasahiro Yamadacpuflags-$(CONFIG_M5206) = $(call cc-option,-mcpu=5206,-m5200) 572367b026SMasahiro Yamada 582367b026SMasahiro Yamada# Evaluate tune cc-option calls now 592367b026SMasahiro Yamadacpuflags-y := $(cpuflags-y) 60281eff53SGreg Ungerer 61281eff53SGreg UngererKBUILD_AFLAGS += $(cpuflags-y) 6228713169SFinn ThainKBUILD_CFLAGS += $(cpuflags-y) 6328713169SFinn Thain 6428713169SFinn ThainKBUILD_CFLAGS += -pipe -ffreestanding 6528713169SFinn Thain 66281eff53SGreg Ungererifdef CONFIG_MMU 67bc7c9993SFinn ThainKBUILD_CFLAGS += -ffixed-a2 68281eff53SGreg Ungererelse 69281eff53SGreg Ungerer# we can use a m68k-linux-gcc toolchain with these in place 7040b13fd7SMasahiro YamadaKBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\" 7140b13fd7SMasahiro YamadaKBUILD_CPPFLAGS += -D__uClinux__ 72281eff53SGreg Ungererendif 73281eff53SGreg Ungerer 74d503ac53SMasahiro YamadaKBUILD_LDFLAGS := -m m68kelf 75281eff53SGreg Ungerer 76281eff53SGreg Ungererifdef CONFIG_SUN3 77281eff53SGreg UngererLDFLAGS_vmlinux = -N 78281eff53SGreg Ungererendif 79281eff53SGreg Ungerer 80281eff53SGreg UngererCHECKFLAGS += -D__mc68000__ 81281eff53SGreg Ungerer 82281eff53SGreg Ungerer 83281eff53SGreg Ungererifdef CONFIG_KGDB 84281eff53SGreg Ungerer# If configured for kgdb support, include debugging infos and keep the 85281eff53SGreg Ungerer# frame pointer 86281eff53SGreg UngererKBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g 87281eff53SGreg Ungererendif 88281eff53SGreg Ungerer 89281eff53SGreg Ungererlibs-y += arch/m68k/lib/ 90281eff53SGreg Ungerer 91281eff53SGreg Ungerer 92281eff53SGreg Ungererall: zImage 93281eff53SGreg Ungerer 94281eff53SGreg Ungererlilo: vmlinux 95281eff53SGreg Ungerer if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi 96281eff53SGreg Ungerer if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi 97281eff53SGreg Ungerer cat vmlinux > $(INSTALL_PATH)/vmlinux 98281eff53SGreg Ungerer cp System.map $(INSTALL_PATH)/System.map 99281eff53SGreg Ungerer if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 100281eff53SGreg Ungerer 101281eff53SGreg UngererzImage compressed: vmlinux.gz 102281eff53SGreg Ungerer 103281eff53SGreg Ungerervmlinux.gz: vmlinux 104281eff53SGreg Ungerer 105281eff53SGreg Ungererifndef CONFIG_KGDB 106281eff53SGreg Ungerer cp vmlinux vmlinux.tmp 107281eff53SGreg Ungerer $(STRIP) vmlinux.tmp 108e4a42c82SDenis Efremov $(KGZIP) -9c vmlinux.tmp >vmlinux.gz 109281eff53SGreg Ungerer rm vmlinux.tmp 110281eff53SGreg Ungererelse 111e4a42c82SDenis Efremov $(KGZIP) -9c vmlinux >vmlinux.gz 112281eff53SGreg Ungererendif 113281eff53SGreg Ungerer 114281eff53SGreg UngererbzImage: vmlinux.bz2 115281eff53SGreg Ungerer 116281eff53SGreg Ungerervmlinux.bz2: vmlinux 117281eff53SGreg Ungerer 118281eff53SGreg Ungererifndef CONFIG_KGDB 119281eff53SGreg Ungerer cp vmlinux vmlinux.tmp 120281eff53SGreg Ungerer $(STRIP) vmlinux.tmp 121e4a42c82SDenis Efremov $(KBZIP2) -1c vmlinux.tmp >vmlinux.bz2 122281eff53SGreg Ungerer rm vmlinux.tmp 123281eff53SGreg Ungererelse 124e4a42c82SDenis Efremov $(KBZIP2) -1c vmlinux >vmlinux.bz2 125281eff53SGreg Ungererendif 126281eff53SGreg Ungerer 127e3a54948SMasahiro YamadaCLEAN_FILES += vmlinux.gz vmlinux.bz2 128281eff53SGreg Ungerer 129005e13a9SFiroz Khanarchheaders: 130005e13a9SFiroz Khan $(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all 131005e13a9SFiroz Khan 132*f774f5bbSMasahiro Yamadainstall: KBUILD_IMAGE := vmlinux.gz 133281eff53SGreg Ungererinstall: 134*f774f5bbSMasahiro Yamada $(call cmd,install) 135