1 # $Id: Makefile,v 1.51.2.1 2002/03/14 01:26:21 kanoj Exp $
4 # Makefile for the architecture dependent flags and dependencies on the
7 # Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu)
8 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
11 # If the solaris /bin/sh wasn't so broken, I wouldn't need the following
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 )
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; )
29 RANLIB = sparc64-linux-ranlib
32 LD := $(LD) -m elf64_sparc
35 ifneq ($(UNDECLARED_REGS),y)
38 CC_UNDECL = -Wa,--undeclared-regs
39 AS := $(AS) --undeclared-regs
43 CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mmedlow \
44 -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
46 CFLAGS := $(CFLAGS) -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
47 -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare \
49 AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
52 ifeq ($(INLINE_LIMIT),y)
53 CFLAGS := $(CFLAGS) -finline-limit=100000
56 ifeq ($(CONFIG_MCOUNT),y)
57 CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS))
58 CFLAGS := $(CFLAGS) -pg
61 LINKFLAGS = -T arch/sparc64/vmlinux.lds
63 HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
65 SUBDIRS += arch/sparc64/kernel arch/sparc64/lib arch/sparc64/mm \
68 ifneq ($(CONFIG_SOLARIS_EMUL),n)
69 SUBDIRS += arch/sparc64/solaris
72 SUBDIRS += arch/sparc64/math-emu
74 CORE_FILES := arch/sparc64/kernel/kernel.o arch/sparc64/mm/mm.o $(CORE_FILES)
76 ifeq ($(CONFIG_SOLARIS_EMUL),y)
77 CORE_FILES += arch/sparc64/solaris/solaris.o
80 CORE_FILES += arch/sparc64/math-emu/math-emu.o
82 LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/promlib.a \
83 $(TOPDIR)/arch/sparc64/lib/lib.a
86 $(ELFTOAOUT) -o $(TOPDIR)/vmlinux.aout $(TOPDIR)/vmlinux
89 rm -f $(TOPDIR)/include/asm-sparc64/asm_offsets.h
93 check_asm: include/linux/version.h
94 $(MAKE) -C arch/sparc64/kernel check_asm
97 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
103 @$(MAKEBOOT) tftpboot.img