18c2ecf20Sopenharmony_ci# 28c2ecf20Sopenharmony_ci# m68k/Makefile 38c2ecf20Sopenharmony_ci# 48c2ecf20Sopenharmony_ci# This file is included by the global makefile so that you can add your own 58c2ecf20Sopenharmony_ci# architecture-specific flags and dependencies. Remember to do have actions 68c2ecf20Sopenharmony_ci# for "archclean" and "archdep" for cleaning up and making dependencies for 78c2ecf20Sopenharmony_ci# this architecture 88c2ecf20Sopenharmony_ci# 98c2ecf20Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public 108c2ecf20Sopenharmony_ci# License. See the file "COPYING" in the main directory of this archive 118c2ecf20Sopenharmony_ci# for more details. 128c2ecf20Sopenharmony_ci# 138c2ecf20Sopenharmony_ci# Copyright (C) 1994 by Hamish Macdonald 148c2ecf20Sopenharmony_ci# Copyright (C) 2002,2011 Greg Ungerer <gerg@snapgear.com> 158c2ecf20Sopenharmony_ci# 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciKBUILD_DEFCONFIG := multi_defconfig 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciifneq ($(SUBARCH),$(ARCH)) 208c2ecf20Sopenharmony_ci ifeq ($(CROSS_COMPILE),) 218c2ecf20Sopenharmony_ci CROSS_COMPILE := $(call cc-cross-prefix, \ 228c2ecf20Sopenharmony_ci m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-) 238c2ecf20Sopenharmony_ci endif 248c2ecf20Sopenharmony_ciendif 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci# 278c2ecf20Sopenharmony_ci# Enable processor type. Ordering of these is important - we want to 288c2ecf20Sopenharmony_ci# use the minimum processor type of the range we support. The logic 298c2ecf20Sopenharmony_ci# for 680x0 will only allow use of the -m68060 or -m68040 if no other 308c2ecf20Sopenharmony_ci# 680x0 type is specified - and no option is specified for 68030 or 318c2ecf20Sopenharmony_ci# 68020. The other m68k/ColdFire types always specify some type of 328c2ecf20Sopenharmony_ci# compiler cpu type flag. 338c2ecf20Sopenharmony_ci# 348c2ecf20Sopenharmony_ciifndef CONFIG_M68040 358c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M68060) = -m68060 368c2ecf20Sopenharmony_ciendif 378c2ecf20Sopenharmony_ciifndef CONFIG_M68060 388c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M68040) = -m68040 398c2ecf20Sopenharmony_ciendif 408c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M68030) = 418c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M68020) = 428c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M68000) = -m68000 438c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5441x) = $(call cc-option,-mcpu=54455,-mcfv4e) 448c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M54xx) = $(call cc-option,-mcpu=5475,-m5200) 458c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5407) = $(call cc-option,-mcpu=5407,-m5200) 468c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M532x) = $(call cc-option,-mcpu=532x,-m5307) 478c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M537x) = $(call cc-option,-mcpu=537x,-m5307) 488c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5307) = $(call cc-option,-mcpu=5307,-m5200) 498c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M528x) = $(call cc-option,-mcpu=528x,-m5307) 508c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5275) = $(call cc-option,-mcpu=5275,-m5307) 518c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5272) = $(call cc-option,-mcpu=5272,-m5307) 528c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5271) = $(call cc-option,-mcpu=5271,-m5307) 538c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M523x) = $(call cc-option,-mcpu=523x,-m5307) 548c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M525x) = $(call cc-option,-mcpu=5253,-m5200) 558c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5249) = $(call cc-option,-mcpu=5249,-m5200) 568c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M520x) = $(call cc-option,-mcpu=5208,-m5200) 578c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5206e) = $(call cc-option,-mcpu=5206e,-m5200) 588c2ecf20Sopenharmony_cicpuflags-$(CONFIG_M5206) = $(call cc-option,-mcpu=5206,-m5200) 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci# Evaluate tune cc-option calls now 618c2ecf20Sopenharmony_cicpuflags-y := $(cpuflags-y) 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciKBUILD_AFLAGS += $(cpuflags-y) 648c2ecf20Sopenharmony_ciKBUILD_CFLAGS += $(cpuflags-y) 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -pipe -ffreestanding 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ciifdef CONFIG_MMU 698c2ecf20Sopenharmony_ci# without -fno-strength-reduce the 53c7xx.c driver fails ;-( 708c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2 718c2ecf20Sopenharmony_cielse 728c2ecf20Sopenharmony_ci# we can use a m68k-linux-gcc toolchain with these in place 738c2ecf20Sopenharmony_ciKBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\" 748c2ecf20Sopenharmony_ciKBUILD_CPPFLAGS += -D__uClinux__ 758c2ecf20Sopenharmony_ciendif 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ciKBUILD_LDFLAGS := -m m68kelf 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciifdef CONFIG_SUN3 808c2ecf20Sopenharmony_ciLDFLAGS_vmlinux = -N 818c2ecf20Sopenharmony_ciendif 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ciCHECKFLAGS += -D__mc68000__ 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciifdef CONFIG_KGDB 878c2ecf20Sopenharmony_ci# If configured for kgdb support, include debugging infos and keep the 888c2ecf20Sopenharmony_ci# frame pointer 898c2ecf20Sopenharmony_ciKBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g 908c2ecf20Sopenharmony_ciendif 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci# 938c2ecf20Sopenharmony_ci# Select the assembler head startup code. Order is important. The default 948c2ecf20Sopenharmony_ci# head code is first, processor specific selections can override it after. 958c2ecf20Sopenharmony_ci# 968c2ecf20Sopenharmony_cihead-y := arch/m68k/kernel/head.o 978c2ecf20Sopenharmony_cihead-$(CONFIG_SUN3) := arch/m68k/kernel/sun3-head.o 988c2ecf20Sopenharmony_cihead-$(CONFIG_M68000) := arch/m68k/68000/head.o 998c2ecf20Sopenharmony_cihead-$(CONFIG_COLDFIRE) := arch/m68k/coldfire/head.o 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_cicore-y += arch/m68k/ 1028c2ecf20Sopenharmony_cilibs-y += arch/m68k/lib/ 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ciall: zImage 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_cililo: vmlinux 1088c2ecf20Sopenharmony_ci if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi 1098c2ecf20Sopenharmony_ci if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi 1108c2ecf20Sopenharmony_ci cat vmlinux > $(INSTALL_PATH)/vmlinux 1118c2ecf20Sopenharmony_ci cp System.map $(INSTALL_PATH)/System.map 1128c2ecf20Sopenharmony_ci if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_cizImage compressed: vmlinux.gz 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_civmlinux.gz: vmlinux 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ciifndef CONFIG_KGDB 1198c2ecf20Sopenharmony_ci cp vmlinux vmlinux.tmp 1208c2ecf20Sopenharmony_ci $(STRIP) vmlinux.tmp 1218c2ecf20Sopenharmony_ci $(KGZIP) -9c vmlinux.tmp >vmlinux.gz 1228c2ecf20Sopenharmony_ci rm vmlinux.tmp 1238c2ecf20Sopenharmony_cielse 1248c2ecf20Sopenharmony_ci $(KGZIP) -9c vmlinux >vmlinux.gz 1258c2ecf20Sopenharmony_ciendif 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_cibzImage: vmlinux.bz2 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_civmlinux.bz2: vmlinux 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ciifndef CONFIG_KGDB 1328c2ecf20Sopenharmony_ci cp vmlinux vmlinux.tmp 1338c2ecf20Sopenharmony_ci $(STRIP) vmlinux.tmp 1348c2ecf20Sopenharmony_ci $(KBZIP2) -1c vmlinux.tmp >vmlinux.bz2 1358c2ecf20Sopenharmony_ci rm vmlinux.tmp 1368c2ecf20Sopenharmony_cielse 1378c2ecf20Sopenharmony_ci $(KBZIP2) -1c vmlinux >vmlinux.bz2 1388c2ecf20Sopenharmony_ciendif 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ciCLEAN_FILES += vmlinux.gz vmlinux.bz2 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ciarchheaders: 1438c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ciinstall: 1468c2ecf20Sopenharmony_ci sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)" 147