Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 #
0003 # sparc/Makefile
0004 #
0005 # Makefile for the architecture dependent flags and dependencies on the
0006 # Sparc and sparc64.
0007 #
0008 # Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu)
0009 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
0010 
0011 # We are not yet configured - so test on arch
0012 ifeq ($(ARCH),sparc64)
0013         KBUILD_DEFCONFIG := sparc64_defconfig
0014 else
0015         KBUILD_DEFCONFIG := sparc32_defconfig
0016 endif
0017 
0018 ifeq ($(CONFIG_SPARC32),y)
0019 #####
0020 # sparc32
0021 #
0022 
0023 CHECKFLAGS     += -D__sparc__
0024 KBUILD_LDFLAGS := -m elf32_sparc
0025 export BITS    := 32
0026 UTS_MACHINE    := sparc
0027 
0028 # We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some
0029 # versions of gcc.  Some gcc versions won't pass -Av8 to binutils when you
0030 # give -mcpu=v8.  This silently worked with older bintutils versions but
0031 # does not any more.
0032 KBUILD_CFLAGS  += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
0033 KBUILD_CFLAGS  += -Wa,-Av8
0034 
0035 KBUILD_AFLAGS  += -m32 -Wa,-Av8
0036 
0037 else
0038 #####
0039 # sparc64
0040 #
0041 
0042 CHECKFLAGS    += -D__sparc__ -D__sparc_v9__ -D__arch64__
0043 KBUILD_LDFLAGS := -m elf64_sparc
0044 export BITS   := 64
0045 UTS_MACHINE   := sparc64
0046 
0047 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
0048 KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
0049 KBUILD_CFLAGS += -Wa,--undeclared-regs
0050 KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
0051 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
0052 
0053 ifeq ($(CONFIG_MCOUNT),y)
0054   KBUILD_CFLAGS += -pg
0055 endif
0056 
0057 endif
0058 
0059 head-y                 := arch/sparc/kernel/head_$(BITS).o
0060 
0061 libs-y                 += arch/sparc/prom/
0062 libs-y                 += arch/sparc/lib/
0063 
0064 drivers-$(CONFIG_PM) += arch/sparc/power/
0065 
0066 boot := arch/sparc/boot
0067 
0068 # Default target
0069 all: zImage
0070 
0071 image zImage uImage tftpboot.img vmlinux.aout: vmlinux
0072         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0073 
0074 install:
0075         $(call cmd,install)
0076 
0077 archheaders:
0078         $(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all
0079 
0080 PHONY += vdso_install
0081 vdso_install:
0082         $(Q)$(MAKE) $(build)=arch/sparc/vdso $@
0083 
0084 # This is the image used for packaging
0085 KBUILD_IMAGE := $(boot)/zImage
0086 
0087 # Don't use tabs in echo arguments.
0088 ifeq ($(ARCH),sparc)
0089 define archhelp
0090   echo  '* image        - kernel image ($(boot)/image)'
0091   echo  '* zImage       - stripped kernel image ($(boot)/zImage)'
0092   echo  '  uImage       - U-Boot SPARC32 Image (only for LEON)'
0093   echo  '  tftpboot.img - image prepared for tftp'
0094 endef
0095 else
0096 define archhelp
0097   echo  '* vmlinux      - standard sparc64 kernel'
0098   echo  '* zImage       - stripped and compressed sparc64 kernel ($(boot)/zImage)'
0099   echo  '  vmlinux.aout - a.out kernel for sparc64'
0100   echo  '  tftpboot.img - image prepared for tftp'
0101 endef
0102 endif