
#  (C) Copyright
#  Sony Computer Entertainment, Inc.,
#  2001,2002,2003,2004,2005,2006.

#  This file is free software; you can redistribute it and/or modify it under
#  the terms of the GNU General Public License as published by the Free
#  Software Foundation; either version 2 of the License, or (at your option) 
#  any later version.

#  This file is distributed in the hope that it will be useful, but WITHOUT
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#  for more details.

#  You should have received a copy of the GNU General Public License
#  along with this file; see the file COPYING.  If not, write to the Free
#  Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#  02110-1301, USA.


# Suppress building libgcc1.a, since the MIPS compiler port is complete
# and does not need anything from libgcc1.a.
LIBGCC1 =
CROSS_LIBGCC1 =

# Build libgcc.a with special flags
TARGET_LIBGCC2_CFLAGS = -fPIC

LIB2FUNCS_EXTRA = $(srcdir)/config/spu/divf.c  $(srcdir)/config/spu/sqrtf.c  \
		  $(srcdir)/config/spu/float_unssidf.c \
		  $(srcdir)/config/spu/float_unsdidf.c

LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c

# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
FPBIT = fp-bit.c
DPBIT = dp-bit.c

dp-bit.c: $(srcdir)/config/fp-bit.c
	echo '#undef US_SOFTWARE_GOFAST' > dp-bit.c
	cat $(srcdir)/config/fp-bit.c >> dp-bit.c

fp-bit.c: $(srcdir)/config/fp-bit.c
	echo '#define FLOAT' > fp-bit.c
	echo '#undef US_SOFTWARE_GOFAST' >> fp-bit.c
	cat $(srcdir)/config/fp-bit.c >> fp-bit.c

# Don't let CTOR_LIST end up in sdata section.
CRTSTUFF_T_CFLAGS =

#MULTILIB_OPTIONS=mlarge-mem/mtest-abi
#MULTILIB_DIRNAMES=large-mem test-abi
#MULTILIB_MATCHES=

# Neither gcc or newlib seem to have a standard way to generate multiple
# crt*.o files.  So we don't use the standard crt0.o name anymore.

EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o crt1.o crt2.o crtend1.o
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o

LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib

# Need to rebuild spu.o whenever spu_builtins.def is changed.
$(out_object_file): $(srcdir)/config/spu/spu_builtins.def

spu-c.o: $(srcdir)/config/spu/spu-c.c \
    $(srcdir)/config/spu/spu-protos.h \
    $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
    $(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H) $(OPTABS_H)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/spu/spu-c.c

