blob: 01159cb5f16d4d9878206027f391c45fa24f2a20 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001# $Id: Makefile,v 1.52 2002/02/09 19:49:31 davem Exp $
2# sparc64/Makefile
3#
4# Makefile for the architecture dependent flags and dependencies on the
5# 64-bit Sparc.
6#
7# Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu)
8# Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
9#
10
11CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -m64
12
13CPPFLAGS_vmlinux.lds += -Usparc
14
15CC := $(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
17NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow)
18NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
19UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; )
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Linus Torvalds1da177e2005-04-16 15:20:36 -070021ifneq ($(NEW_GAS),y)
22AS = sparc64-linux-as
23LD = sparc64-linux-ld
24NM = sparc64-linux-nm
25AR = sparc64-linux-ar
26RANLIB = sparc64-linux-ranlib
27else
28AS := $(AS) -64
29LDFLAGS := -m elf64_sparc
30endif
31
32ifneq ($(UNDECLARED_REGS),y)
33CC_UNDECL =
34else
35CC_UNDECL = -Wa,--undeclared-regs
36AS := $(AS) --undeclared-regs
37endif
38
39ifneq ($(NEW_GCC),y)
Sam Ravnborga0f97e02007-10-14 22:21:35 +020040 KBUILD_CFLAGS += -pipe -mno-fpu -mtune=ultrasparc -mmedlow \
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
42else
Sam Ravnborga0f97e02007-10-14 22:21:35 +020043 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
45 $(CC_UNDECL)
Sam Ravnborg222d3942007-10-15 21:59:31 +020046 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047endif
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049ifeq ($(CONFIG_MCOUNT),y)
Sam Ravnborga0f97e02007-10-14 22:21:35 +020050 KBUILD_CFLAGS += -pg
Linus Torvalds1da177e2005-04-16 15:20:36 -070051endif
52
53head-y := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
54
55core-y += arch/sparc64/kernel/ arch/sparc64/mm/
56core-$(CONFIG_SOLARIS_EMUL) += arch/sparc64/solaris/
57core-y += arch/sparc64/math-emu/
58libs-y += arch/sparc64/prom/ arch/sparc64/lib/
Linus Torvalds1da177e2005-04-16 15:20:36 -070059drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
60
61boot := arch/sparc64/boot
62
63image tftpboot.img vmlinux.aout: vmlinux
64 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
65
66archclean:
67 $(Q)$(MAKE) $(clean)=$(boot)
68
69define archhelp
70 echo '* vmlinux - Standard sparc64 kernel'
71 echo ' vmlinux.aout - a.out kernel for sparc64'
72 echo ' tftpboot.img - Image prepared for tftp'
73endef
74