# Compile the extra library functions.

LIB2FUNCS_EXTRA = \
	$(srcdir)/config/picochip/libgccExtras/ashrsi3.c 		\
	$(srcdir)/config/picochip/libgccExtras/ashlsi3.c		\
	$(srcdir)/config/picochip/libgccExtras/divmodhi4.S 		\
	$(srcdir)/config/picochip/libgccExtras/udivmodsi4.S 		\
	$(srcdir)/config/picochip/libgccExtras/divmodsi4.S 		\
	$(srcdir)/config/picochip/libgccExtras/ucmpsi2.S 		\
	$(srcdir)/config/picochip/libgccExtras/cmpsi2.S 		\
	$(srcdir)/config/picochip/libgccExtras/firstSetBit32.S		\
	$(srcdir)/config/picochip/libgccExtras/lshrsi3.c

# Prevent some of the more complicated libgcc functions from being
# compiled. This is because they are generally too big to fit into an
# AE anyway, so there is no point in having them. Also, some don't
# compile properly so we'll ignore them for the moment.

LIB1ASMFUNCS = _mulsc3 _divsc3
LIB1ASMSRC = picochip/libgccExtras/fake_libgcc.S

# Turn off the building of exception handling libraries.
LIB2ADDEH =
LIB2ADDEHDEP =

# Turn off ranlib on target libraries.
RANLIB_FOR_TARGET = cat

# Special libgcc setup. Make single/double floating point the same,
# and use our own include files.
TARGET_LIBGCC2_CFLAGS = -DDF=SF -I../../includes/

# Switch off all debugging for the embedded libraries.
# (embedded processors need small libraries by default).  
# NOTE: If the debug level is increased, turn off instruction scheduling.
LIBGCC2_DEBUG_CFLAGS = -g0

# Enable different libraries to be linked for different AE types.
MULTILIB_OPTIONS = mae=MUL/mae=ANY/mae=MAC
MULTILIB_DIRNAMES = mul any mac

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

# Software floating point support. Floating point is not properly
# supported, but is existence can be useful for some types of testing.
fp-bit.c:	$(srcdir)/config/fp-bit.c
	echo '#define FLOAT' > fp-bit.c
	echo '#define FLOAT_ONLY' >> fp-bit.c
	echo '#define SMALL_MACHINE' >> fp-bit.c
	cat $(srcdir)/config/fp-bit.c >> fp-bit.c

