1 # SPDX-License-Identifier: GPL-2.0-only !! 1 # 2 OBJCOPYFLAGS :=-O binary !! 2 # sparc/Makefile 3 GZFLAGS :=-9 !! 3 # >> 4 # Makefile for the architecture dependent flags and dependencies on the >> 5 # Sparc. >> 6 # >> 7 # Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) >> 8 # >> 9 >> 10 # >> 11 # Uncomment the first CFLAGS if you are doing kgdb source level >> 12 # debugging of the kernel to get the proper debugging information. >> 13 >> 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; ) >> 15 NEW_GAS := $(shell if $(LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) >> 16 >> 17 ifeq ($(NEW_GAS),y) >> 18 AS := $(AS) -32 >> 19 LDFLAGS := -m elf32_sparc >> 20 endif >> 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 >> 28 endif >> 29 >> 30 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000 >> 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 4 53 5 ifdef CONFIG_CPU_HAS_FPU !! 54 # Default target 6 FPUEXT = f !! 55 all: image 7 endif << 8 << 9 ifdef CONFIG_CPU_HAS_VDSP << 10 VDSPEXT = v << 11 endif << 12 << 13 ifdef CONFIG_CPU_HAS_TEE << 14 TEEEXT = t << 15 endif << 16 << 17 ifdef CONFIG_CPU_CK610 << 18 CPUTYPE = ck610 << 19 CSKYABI = abiv1 << 20 endif << 21 << 22 ifdef CONFIG_CPU_CK810 << 23 CPUTYPE = ck810 << 24 CSKYABI = abiv2 << 25 endif << 26 << 27 ifdef CONFIG_CPU_CK807 << 28 CPUTYPE = ck807 << 29 CSKYABI = abiv2 << 30 endif << 31 56 32 ifdef CONFIG_CPU_CK860 !! 57 boot := arch/sparc/boot 33 CPUTYPE = ck860 << 34 CSKYABI = abiv2 << 35 endif << 36 << 37 ifneq ($(CSKYABI),) << 38 MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEE << 39 KBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$( << 40 KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_S << 41 KBUILD_CFLAGS += -msoft-float -mdiv << 42 KBUILD_CFLAGS += -fno-tree-vectorize << 43 endif << 44 58 45 KBUILD_CFLAGS += -pipe !! 59 image tftpboot.img: vmlinux 46 ifeq ($(CSKYABI),abiv2) !! 60 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 47 KBUILD_CFLAGS += -mno-stack-size << 48 endif << 49 << 50 ifdef CONFIG_FRAME_POINTER << 51 KBUILD_CFLAGS += -mbacktrace << 52 endif << 53 << 54 abidirs := $(patsubst %,arch/csky/%/,$(CSKYABI << 55 KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%in << 56 << 57 KBUILD_CPPFLAGS += -mlittle-endian << 58 LDFLAGS += -EL << 59 << 60 KBUILD_AFLAGS += $(KBUILD_CFLAGS) << 61 61 62 core-y += arch/csky/$(CSKYABI)/ !! 62 archclean: >> 63 $(Q)$(MAKE) $(clean)=$(boot) 63 64 64 libs-y += arch/csky/lib/ \ !! 65 prepare: include/asm-$(ARCH)/asm_offsets.h 65 $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLA << 66 66 67 boot := arch/csky/boot !! 67 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ >> 68 include/config/MARKER 68 69 69 all: zImage !! 70 include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s >> 71 $(call filechk,gen-asm-offsets) 70 72 71 zImage Image uImage: vmlinux !! 73 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ 72 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$ !! 74 arch/$(ARCH)/kernel/asm-offsets.s 73 75 >> 76 # Don't use tabs in echo arguments. 74 define archhelp 77 define archhelp 75 echo '* zImage - Compressed kernel im !! 78 echo '* image - kernel image ($(boot)/image)' 76 echo ' Image - Uncompressed kernel !! 79 echo ' tftpboot.img - image prepared for tftp' 77 echo ' uImage - U-Boot wrapped zImag << 78 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.