18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci# 38c2ecf20Sopenharmony_ci# sparc/Makefile 48c2ecf20Sopenharmony_ci# 58c2ecf20Sopenharmony_ci# Makefile for the architecture dependent flags and dependencies on the 68c2ecf20Sopenharmony_ci# Sparc and sparc64. 78c2ecf20Sopenharmony_ci# 88c2ecf20Sopenharmony_ci# Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu) 98c2ecf20Sopenharmony_ci# Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci# We are not yet configured - so test on arch 128c2ecf20Sopenharmony_ciifeq ($(ARCH),sparc64) 138c2ecf20Sopenharmony_ci KBUILD_DEFCONFIG := sparc64_defconfig 148c2ecf20Sopenharmony_cielse 158c2ecf20Sopenharmony_ci KBUILD_DEFCONFIG := sparc32_defconfig 168c2ecf20Sopenharmony_ciendif 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciifeq ($(CONFIG_SPARC32),y) 198c2ecf20Sopenharmony_ci##### 208c2ecf20Sopenharmony_ci# sparc32 218c2ecf20Sopenharmony_ci# 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciCHECKFLAGS += -D__sparc__ 248c2ecf20Sopenharmony_ciKBUILD_LDFLAGS := -m elf32_sparc 258c2ecf20Sopenharmony_ciexport BITS := 32 268c2ecf20Sopenharmony_ciUTS_MACHINE := sparc 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci# We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some 298c2ecf20Sopenharmony_ci# versions of gcc. Some gcc versions won't pass -Av8 to binutils when you 308c2ecf20Sopenharmony_ci# give -mcpu=v8. This silently worked with older bintutils versions but 318c2ecf20Sopenharmony_ci# does not any more. 328c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 338c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -Wa,-Av8 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ciKBUILD_AFLAGS += -m32 -Wa,-Av8 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cielse 388c2ecf20Sopenharmony_ci##### 398c2ecf20Sopenharmony_ci# sparc64 408c2ecf20Sopenharmony_ci# 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciCHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ 438c2ecf20Sopenharmony_ciKBUILD_LDFLAGS := -m elf64_sparc 448c2ecf20Sopenharmony_ciexport BITS := 64 458c2ecf20Sopenharmony_ciUTS_MACHINE := sparc64 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow 488c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare 498c2ecf20Sopenharmony_ciKBUILD_CFLAGS += -Wa,--undeclared-regs 508c2ecf20Sopenharmony_ciKBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3) 518c2ecf20Sopenharmony_ciKBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciifeq ($(CONFIG_MCOUNT),y) 548c2ecf20Sopenharmony_ci KBUILD_CFLAGS += -pg 558c2ecf20Sopenharmony_ciendif 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ciendif 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_cihead-y := arch/sparc/kernel/head_$(BITS).o 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci# See arch/sparc/Kbuild for the core part of the kernel 628c2ecf20Sopenharmony_cicore-y += arch/sparc/ 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_cilibs-y += arch/sparc/prom/ 658c2ecf20Sopenharmony_cilibs-y += arch/sparc/lib/ 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_cidrivers-$(CONFIG_PM) += arch/sparc/power/ 688c2ecf20Sopenharmony_cidrivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ciboot := arch/sparc/boot 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci# Default target 738c2ecf20Sopenharmony_ciall: zImage 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ciimage zImage uImage tftpboot.img vmlinux.aout: vmlinux 768c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ciinstall: 798c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(build)=$(boot) $@ 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ciarchclean: 828c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(clean)=$(boot) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ciarchheaders: 858c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ciPHONY += vdso_install 888c2ecf20Sopenharmony_civdso_install: 898c2ecf20Sopenharmony_ci $(Q)$(MAKE) $(build)=arch/sparc/vdso $@ 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci# This is the image used for packaging 928c2ecf20Sopenharmony_ciKBUILD_IMAGE := $(boot)/zImage 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci# Don't use tabs in echo arguments. 958c2ecf20Sopenharmony_ciifeq ($(ARCH),sparc) 968c2ecf20Sopenharmony_cidefine archhelp 978c2ecf20Sopenharmony_ci echo '* image - kernel image ($(boot)/image)' 988c2ecf20Sopenharmony_ci echo '* zImage - stripped kernel image ($(boot)/zImage)' 998c2ecf20Sopenharmony_ci echo ' uImage - U-Boot SPARC32 Image (only for LEON)' 1008c2ecf20Sopenharmony_ci echo ' tftpboot.img - image prepared for tftp' 1018c2ecf20Sopenharmony_ciendef 1028c2ecf20Sopenharmony_cielse 1038c2ecf20Sopenharmony_cidefine archhelp 1048c2ecf20Sopenharmony_ci echo '* vmlinux - standard sparc64 kernel' 1058c2ecf20Sopenharmony_ci echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)' 1068c2ecf20Sopenharmony_ci echo ' vmlinux.aout - a.out kernel for sparc64' 1078c2ecf20Sopenharmony_ci echo ' tftpboot.img - image prepared for tftp' 1088c2ecf20Sopenharmony_ciendef 1098c2ecf20Sopenharmony_ciendif 110