#
# t-cris
#
# The Makefile fragment to include when compiling gcc et al for CRIS
#
#
# The makefile macros etc. are included in the order found in the
# section "Target Fragment" in the gcc info-files or the paper copy of
# "Using and Porting GNU CC"
#
# Don't run fixproto
STMP_FIXPROTO =

# CROSS_LIBGCC1 is not defined, to make sure we use our own routines.
#
CROSS_LIBGCC1=

# Do not test the nonexistent/empty libgcc1
LIBGCC1_TEST=

#
# Since we need to pass 64-bit entities BY VALUE, we have to bypass
# the normal calling scheme when we make the internal functions in
# libgcc2.a 
#
# Also, there is no DF-mode.  Just hope the word 'DF' is only used as
# in mode(DF) in libgcc2 (seems reasonable)
#
LIBGCC2_CFLAGS = -mlibfunc -g -DDF=SF -Dinhibit_libc

#
# When compiling libgcc2 into an archive, it would be handy to have an
# archive-program.  Exclude the guess about where to find it, and call
# it by its name.  There is no ranlib here (it may be lost).
#
AR_FOR_TARGET=ar-cris
RANLIB_TEST_FOR_TARGET=false

#
# We dont want the gcc-supplied headers.
#
USER_H = $(LANG_EXTRA_HEADERS)

#
# End of documented makefile fragment.  Over to hacking.
#

# This is where we want the C++ header files.  Experience shows that they are
# compiler-version-specific, also, as other include-files are here, they should be
# here as well (and not in $(libdir)/g++-include)
gxx_include_dir=$(libsubdir)/g++-include

# These two known to work.  Others attached by configure.  Use at own risk.
#
LANGUAGES=c c++

#
# Like install-cross, but without common-headers which are just a
# pain. 
#
INSTALL_TARGET= install-cris-common install-man install-cross-tools \
 install-libgcc # install-cris-misc

#
# We create a directory called cris_c_support, and have to depend on a
# few files in there.
#
# Not any more
# VPATH+=:cris_c_support

#
# install-cris-common is like install-common, except it doesnt install
# any stupid scripts called 'c++' and 'g++' in /usr/local/bin.
#  Will also never overwrite /usr/local/bin/gcc.
#
install-cris-common: native install-dir gcc-cross g++-cross specs
	for file in $(COMPILERS); do \
	  if [ -f $$file ] ; then \
	    rm -f $(libsubdir)/$$file; \
	    $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
	  else \
            true; \
	  fi; \
	done
	for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) ..; do \
	  if [ x"$$file" != x.. ]; then \
	    rm -f $(libsubdir)/$$file; \
	    $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
	  else \
	    true; \
	  fi; \
	done
	-rm -f $(libsubdir)/specs
	$(INSTALL_DATA) specs $(libsubdir)/specs
#
# Install the gcc driver program as gcc-<first word in target>
# Install the g++ driver program as g++-<first word in target>
#  The canonical cross-compiler name has changed for some reason, but we keep
# the "old" name.
#
	-if [ -f gcc-cross ] ; then \
	  target_name=`echo $(target) | sed 's/-.*//'`; \
	  rm -f $(bindir)/gcc-$$target_name; \
	  rm -f $(bindir)/$$target_name-gcc; \
	  $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$$target_name; \
	  $(HARDLINK) $(bindir)/gcc-$$target_name $(bindir)/$$target_name-gcc; \
	fi
	if [ -f g++-cross ] ; then \
	  target_name=`echo $(target) | sed 's/-.*//'`; \
	  rm -f $(bindir)/g++-$$target_name; \
	  rm -f $(bindir)/$$target_name-g++; \
	  $(INSTALL_PROGRAM) g++-cross $(bindir)/g++-$$target_name; \
	  $(HARDLINK) $(bindir)/g++-$$target_name $(bindir)/$$target_name-g++; \
	fi
	-rm -f $(libsubdir)/cpp
	$(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
#
# End of cris makefile fragment 
#