Back to home page

LXR

 
 

    


0001 #
0002 # sparc/Makefile
0003 #
0004 # Makefile for the architecture dependent flags and dependencies on the
0005 # Sparc and sparc64.
0006 #
0007 # Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu)
0008 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
0009 
0010 # We are not yet configured - so test on arch
0011 ifeq ($(ARCH),sparc)
0012         KBUILD_DEFCONFIG := sparc32_defconfig
0013 else
0014         KBUILD_DEFCONFIG := sparc64_defconfig
0015 endif
0016 
0017 ifeq ($(CONFIG_SPARC32),y)
0018 #####
0019 # sparc32
0020 #
0021 
0022 CHECKFLAGS     += -D__sparc__
0023 LDFLAGS        := -m elf32_sparc
0024 export BITS    := 32
0025 UTS_MACHINE    := sparc
0026 
0027 # We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some
0028 # versions of gcc.  Some gcc versions won't pass -Av8 to binutils when you
0029 # give -mcpu=v8.  This silently worked with older bintutils versions but
0030 # does not any more.
0031 KBUILD_CFLAGS  += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
0032 KBUILD_CFLAGS  += -Wa,-Av8
0033 
0034 KBUILD_AFLAGS  += -m32 -Wa,-Av8
0035 
0036 else
0037 #####
0038 # sparc64
0039 #
0040 
0041 CHECKFLAGS    += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
0042 LDFLAGS       := -m elf64_sparc
0043 export BITS   := 64
0044 UTS_MACHINE   := sparc64
0045 
0046 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
0047 KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
0048 KBUILD_CFLAGS += -Wa,--undeclared-regs
0049 KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
0050 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
0051 
0052 ifeq ($(CONFIG_MCOUNT),y)
0053   KBUILD_CFLAGS += -pg
0054 endif
0055 
0056 endif
0057 
0058 head-y                 := arch/sparc/kernel/head_$(BITS).o
0059 
0060 # See arch/sparc/Kbuild for the core part of the kernel
0061 core-y                 += arch/sparc/
0062 
0063 libs-y                 += arch/sparc/prom/
0064 libs-y                 += arch/sparc/lib/
0065 
0066 drivers-$(CONFIG_PM) += arch/sparc/power/
0067 drivers-$(CONFIG_OPROFILE)      += arch/sparc/oprofile/
0068 
0069 boot := arch/sparc/boot
0070 
0071 # Default target
0072 all: zImage
0073 
0074 image zImage uImage tftpboot.img vmlinux.aout: vmlinux
0075         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0076 
0077 install:
0078         $(Q)$(MAKE) $(build)=$(boot) $@
0079 
0080 archclean:
0081         $(Q)$(MAKE) $(clean)=$(boot)
0082 
0083 # This is the image used for packaging
0084 KBUILD_IMAGE := $(boot)/zImage
0085 
0086 # Don't use tabs in echo arguments.
0087 ifeq ($(ARCH),sparc)
0088 define archhelp
0089   echo  '* image        - kernel image ($(boot)/image)'
0090   echo  '* zImage       - stripped kernel image ($(boot)/zImage)'
0091   echo  '  uImage       - U-Boot SPARC32 Image (only for LEON)'
0092   echo  '  tftpboot.img - image prepared for tftp'
0093 endef
0094 else
0095 define archhelp
0096   echo  '* vmlinux      - standard sparc64 kernel'
0097   echo  '* zImage       - stripped and compressed sparc64 kernel ($(boot)/zImage)'
0098   echo  '  vmlinux.aout - a.out kernel for sparc64'
0099   echo  '  tftpboot.img - image prepared for tftp'
0100 endef
0101 endif