1 # SPDX-License-Identifier: GPL-2.0 << 2 # 1 # 3 # sparc/Makefile 2 # 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 # Sparc. 7 # 6 # 8 # Copyright (C) 1994,1996,1998 David S. Miller !! 7 # Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) 9 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.l << 10 << 11 # We are not yet configured - so test on arch << 12 ifeq ($(ARCH),sparc64) << 13 KBUILD_DEFCONFIG := sparc64_defconfig << 14 else << 15 KBUILD_DEFCONFIG := sparc32_defconfig << 16 endif << 17 << 18 ifeq ($(CONFIG_SPARC32),y) << 19 ##### << 20 # sparc32 << 21 # 8 # 22 9 23 CHECKFLAGS += -D__sparc__ << 24 KBUILD_LDFLAGS := -m elf32_sparc << 25 export BITS := 32 << 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 << 35 KBUILD_AFLAGS += -m32 -Wa,-Av8 << 36 << 37 else << 38 ##### << 39 # sparc64 << 40 # 10 # >> 11 # Uncomment the first CFLAGS if you are doing kgdb source level >> 12 # debugging of the kernel to get the proper debugging information. 41 13 42 CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D !! 14 IS_EGCS := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) 43 KBUILD_LDFLAGS := -m elf64_sparc !! 15 NEW_GAS := $(shell if $(LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) 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 16 53 ifeq ($(CONFIG_MCOUNT),y) !! 17 ifeq ($(NEW_GAS),y) 54 KBUILD_CFLAGS += -pg !! 18 AS := $(AS) -32 >> 19 LDFLAGS := -m elf32_sparc 55 endif 20 endif 56 21 >> 22 #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7 >> 23 ifneq ($(IS_EGCS),y) >> 24 CFLAGS := $(CFLAGS) -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 >> 25 else >> 26 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 >> 27 AFLAGS := $(AFLAGS) -m32 57 endif 28 endif 58 29 59 libs-y += arch/sparc/prom/ !! 30 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000 60 libs-y += arch/sparc/lib/ !! 31 # Since 2.5.40, the first stage is left not btfix-ed. >> 32 # Actual linking is done with "make image". >> 33 LDFLAGS_vmlinux = -r >> 34 >> 35 head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o >> 36 HEAD_Y := $(head-y) >> 37 >> 38 core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ >> 39 libs-y += arch/sparc/prom/ arch/sparc/lib/ >> 40 >> 41 # Export what is needed by arch/sparc/boot/Makefile >> 42 # Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-) >> 43 INIT_Y := $(patsubst %/, %/built-in.o, $(init-y)) >> 44 CORE_Y := $(core-y) >> 45 CORE_Y += kernel/ mm/ fs/ ipc/ security/ crypto/ >> 46 CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y)) >> 47 DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y)) >> 48 NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) >> 49 LIBS_Y1 := $(patsubst %/, %/lib.a, $(libs-y)) >> 50 LIBS_Y2 := $(patsubst %/, %/built-in.o, $(libs-y)) >> 51 LIBS_Y := $(LIBS_Y1) $(LIBS_Y2) >> 52 export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y 61 53 62 drivers-$(CONFIG_PM) += arch/sparc/power/ !! 54 # Default target 63 drivers-$(CONFIG_VIDEO) += arch/sparc/video/ !! 55 all: image 64 56 65 boot := arch/sparc/boot 57 boot := arch/sparc/boot 66 58 67 # Default target !! 59 image tftpboot.img: vmlinux 68 all: zImage << 69 << 70 image zImage uImage tftpboot.img vmlinux.aout: << 71 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ 60 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 72 61 73 install: !! 62 archclean: 74 $(call cmd,install) !! 63 $(Q)$(MAKE) $(clean)=$(boot) >> 64 >> 65 prepare: include/asm-$(ARCH)/asm_offsets.h 75 66 76 archheaders: !! 67 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ 77 $(Q)$(MAKE) $(build)=arch/sparc/kernel !! 68 include/config/MARKER 78 69 79 vdso-install-$(CONFIG_SPARC64) += arch/sparc/ !! 70 include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s 80 vdso-install-$(CONFIG_COMPAT) += arch/sparc/ !! 71 $(call filechk,gen-asm-offsets) 81 72 82 # This is the image used for packaging !! 73 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ 83 KBUILD_IMAGE := $(boot)/zImage !! 74 arch/$(ARCH)/kernel/asm-offsets.s 84 75 85 # Don't use tabs in echo arguments. 76 # Don't use tabs in echo arguments. 86 define archhelp 77 define archhelp 87 echo '* vmlinux - standard SPARC kerne !! 78 echo '* image - kernel image ($(boot)/image)' 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 79 echo ' tftpboot.img - image prepared for tftp' 93 endef 80 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.