1 # SPDX-License-Identifier: GPL-2.0 !! 1 # $Id: Makefile,v 1.51.2.1 2002/03/14 01:26:21 kanoj Exp $ 2 # !! 2 # sparc64/Makefile 3 # sparc/Makefile << 4 # 3 # 5 # Makefile for the architecture dependent flag 4 # Makefile for the architecture dependent flags and dependencies on the 6 # Sparc and sparc64. !! 5 # 64-bit Sparc. 7 # 6 # 8 # Copyright (C) 1994,1996,1998 David S. Miller !! 7 # Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu) 9 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.l 8 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) >> 9 # 10 10 11 # We are not yet configured - so test on arch !! 11 # If the solaris /bin/sh wasn't so broken, I wouldn't need the following 12 ifeq ($(ARCH),sparc64) !! 12 # line... 13 KBUILD_DEFCONFIG := sparc64_defconfig !! 13 SHELL =/bin/bash >> 14 >> 15 CC := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi ) >> 16 >> 17 NEW_GCC := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) >> 18 NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) >> 19 UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; ) >> 20 INLINE_LIMIT := $(shell if $(CC) -m64 -finline-limit=100000 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) >> 21 >> 22 export NEW_GCC >> 23 >> 24 ifneq ($(NEW_GAS),y) >> 25 AS = sparc64-linux-as >> 26 LD = sparc64-linux-ld >> 27 NM = sparc64-linux-nm >> 28 AR = sparc64-linux-ar >> 29 RANLIB = sparc64-linux-ranlib 14 else 30 else 15 KBUILD_DEFCONFIG := sparc32_defconfig !! 31 AS := $(AS) -64 >> 32 LD := $(LD) -m elf64_sparc >> 33 endif >> 34 ELFTOAOUT = elftoaout >> 35 ifneq ($(UNDECLARED_REGS),y) >> 36 CC_UNDECL = >> 37 else >> 38 CC_UNDECL = -Wa,--undeclared-regs >> 39 AS := $(AS) --undeclared-regs 16 endif 40 endif 17 41 18 ifeq ($(CONFIG_SPARC32),y) !! 42 ifneq ($(NEW_GCC),y) 19 ##### !! 43 CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mmedlow \ 20 # sparc32 !! 44 -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare 21 # !! 45 else >> 46 CFLAGS := $(CFLAGS) -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \ >> 47 -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare \ >> 48 $(CC_UNDECL) >> 49 AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL) >> 50 endif 22 51 23 CHECKFLAGS += -D__sparc__ !! 52 ifeq ($(INLINE_LIMIT),y) 24 KBUILD_LDFLAGS := -m elf32_sparc !! 53 CFLAGS := $(CFLAGS) -finline-limit=100000 25 export BITS := 32 !! 54 endif 26 UTS_MACHINE := sparc << 27 << 28 # We are adding -Wa,-Av8 to KBUILD_CFLAGS to d << 29 # versions of gcc. Some gcc versions won't pa << 30 # give -mcpu=v8. This silently worked with ol << 31 # does not any more. << 32 KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu << 33 KBUILD_CFLAGS += -Wa,-Av8 << 34 55 35 KBUILD_AFLAGS += -m32 -Wa,-Av8 !! 56 ifeq ($(CONFIG_MCOUNT),y) >> 57 CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) >> 58 CFLAGS := $(CFLAGS) -pg >> 59 endif 36 60 37 else !! 61 LINKFLAGS = -T arch/sparc64/vmlinux.lds 38 ##### << 39 # sparc64 << 40 # << 41 62 42 CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D !! 63 HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o 43 KBUILD_LDFLAGS := -m elf64_sparc << 44 export BITS := 64 << 45 UTS_MACHINE := sparc64 << 46 << 47 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ult << 48 KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall- << 49 KBUILD_CFLAGS += -Wa,--undeclared-regs << 50 KBUILD_CFLAGS += $(call cc-option,-mtune=ultra << 51 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--u << 52 64 53 ifeq ($(CONFIG_MCOUNT),y) !! 65 SUBDIRS += arch/sparc64/kernel arch/sparc64/lib arch/sparc64/mm \ 54 KBUILD_CFLAGS += -pg !! 66 arch/sparc64/prom >> 67 >> 68 ifneq ($(CONFIG_SOLARIS_EMUL),n) >> 69 SUBDIRS += arch/sparc64/solaris 55 endif 70 endif 56 71 >> 72 SUBDIRS += arch/sparc64/math-emu >> 73 >> 74 CORE_FILES := arch/sparc64/kernel/kernel.o arch/sparc64/mm/mm.o $(CORE_FILES) >> 75 >> 76 ifeq ($(CONFIG_SOLARIS_EMUL),y) >> 77 CORE_FILES += arch/sparc64/solaris/solaris.o 57 endif 78 endif 58 79 59 libs-y += arch/sparc/prom/ !! 80 CORE_FILES += arch/sparc64/math-emu/math-emu.o 60 libs-y += arch/sparc/lib/ !! 81 >> 82 LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/promlib.a \ >> 83 $(TOPDIR)/arch/sparc64/lib/lib.a 61 84 62 drivers-$(CONFIG_PM) += arch/sparc/power/ !! 85 vmlinux.aout: vmlinux 63 drivers-$(CONFIG_VIDEO) += arch/sparc/video/ !! 86 $(ELFTOAOUT) -o $(TOPDIR)/vmlinux.aout $(TOPDIR)/vmlinux 64 87 65 boot := arch/sparc/boot !! 88 archmrproper: >> 89 rm -f $(TOPDIR)/include/asm-sparc64/asm_offsets.h 66 90 67 # Default target !! 91 archdep: check_asm 68 all: zImage << 69 92 70 image zImage uImage tftpboot.img vmlinux.aout: !! 93 check_asm: include/linux/version.h 71 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 94 $(MAKE) -C arch/sparc64/kernel check_asm 72 95 73 install: << 74 $(call cmd,install) << 75 96 76 archheaders: !! 97 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 77 $(Q)$(MAKE) $(build)=arch/sparc/kernel << 78 98 79 vdso-install-$(CONFIG_SPARC64) += arch/sparc/ !! 99 archclean: 80 vdso-install-$(CONFIG_COMPAT) += arch/sparc/ !! 100 @$(MAKEBOOT) clean 81 101 82 # This is the image used for packaging !! 102 tftpboot.img: 83 KBUILD_IMAGE := $(boot)/zImage !! 103 @$(MAKEBOOT) tftpboot.img 84 104 85 # Don't use tabs in echo arguments. !! 105 image: 86 define archhelp !! 106 @$(MAKEBOOT) image 87 echo '* vmlinux - standard SPARC kerne << 88 echo ' image - kernel image ($(boot << 89 echo '* zImage - stripped/compressed << 90 echo ' uImage - U-Boot SPARC32 Image << 91 echo ' vmlinux.aout - a.out kernel for SPA << 92 echo ' tftpboot.img - image prepared for t << 93 endef <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.